This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Debugging Linux kernel on AM335x (3359) using gdb

Other Parts Discussed in Thread: AM3359

I am trying to debug the kernel on remote target, the AM3359 but my first break point works at the entry point of kernel,  after that the processor do not accept any other break point. I am a newbie on arm but I think that I have to change the state from microprocessor, something like "debug mode"  so that I can use break points.

I did a test using an standalone program with no problem but I think that linux set something at the beginning that makes break points or single step impossible.

  78         .arm
  79
  80         __HEAD
  81 ENTRY(stext)
  82
  83  THUMB( adr     r9, BSYM(1f)    )       @ Kernel is always entered in ARM.
  84  THUMB( bx      r9              )       @ If this is a Thumb-2 kernel,  <=================== The only break point that works
  85  THUMB( .thumb                  )       @ switch to Thumb now.
  86  THUMB(1:                       )
  87
  88         setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
  89                                                 @ and irqs disabled
  90         mrc     p15, 0, r9, c0, c0              @ get processor id
  91         bl      __lookup_processor_type         @ r5=procinfo r9=cpuid
  92         movs    r10, r5                         @ invalid processor (r5=0)?
  93  THUMB( it      eq )            @ force fixup-able long branch encoding
  94         beq     __error_p                       @ yes, error 'p'

I have been digging at ARM documentation but I don't understand how to change the cpu to debug mode. Maybe the line 88 is setting the condition.

Any help is welcome.