AnsweredAssumed Answered

LS1043A CW Tap Debugging Kernel Modules

Question asked by Thomas Morrison on May 11, 2020
Latest reply on May 13, 2020 by Thomas Morrison

Hi,

 

I have CodeWarrior & CodeWarrior Tap and I want to debug a kernel module, and I am having

some difficulty in understanding...

 

I have read

  * targeting manual (https://www.nxp.com/docs/en/user-guide/CWARMv8TM.pdf 

  * debugging manual (CodeWarrior for ARMv8 to Debug )

  * and this one old application note: (https://www.nxp.com/docs/en/application-note/AN4980.pdf )

 

How do I set a breakpoint in my kernel module?

 

In gdb before doing the insmod - I did:

   ka-module-config-suspend True

 

It did see the symbols, but it didn't break inside of the init_module routine...

 

I've also edited the debug configuration to "suspend target when module is insert or removal"

and waited until Linux is done with all the built-in modules, and then start CW (so the first insmod

will be my module).....It suspended, but not @ my init_module (which I also tried to set a break point)

 

Kernel Awareness: Module Breakpoint init is hit
INFO: auto-loading symbolics
INFO: symbol file /home/tom/plkSrc/build_dir/target-aarch64_generic_musl/root-layerscape/lib/modules/4.14.162/plk1000e.ko loaded successfully
[CW-INFO]Successfully loaded symbols for module plk1000e
[CW-INFO]Detected read-only areas inside module. Using hardware
breakpoints inside those ranges.
[Switching to Thread 2]

Thread 2 hit Breakpoint -1, do_init_module (mod=0xffff000000b0c3c0 <__this_module>) at ./include/linux/slab.h:488
488                return kmem_cache_alloc_trace(kmalloc_caches[index],

 

I've seen a couple old videos, but is there a more modern Application Note that tells me

how to do this with the modern cw tap (i.e.: there doesn't seem to be an OS Resources view in debug)

 

I'm lost...

 

Tom

Outcomes