Unable to hit software breakpoints in a kernel module p2020rdb, t4240rdb (64-bit) using CodeWarrior + GigaTAP.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to hit software breakpoints in a kernel module p2020rdb, t4240rdb (64-bit) using CodeWarrior + GigaTAP.

1,027 Views
saqlain_raza
Contributor I

Hello Everyone,

 

I have been running into some problems when trying to debug a kernel module using codewarrior IDE for Power and a Giga bit probe.

Kernel debugging works perfectly fine with both SW and HW breakpoints hitting. However when I try to debug a kernel module then none of the software breakpoints placed inside the kernel module gets hit, though I am able to get HW bp's hit in the KMod which points to something that the module actually tries to access the addresses on which the breakpoints are being placed.

 

I have built my kernel with debug information and includes CodeWarrior Debug Support from the kernel menuconfig.

 

Is there any thing else which I am missing ?

 

Thanks,

Saqlain.

Labels (1)
0 Kudos
7 Replies

755 Views
trytohelp
NXP Employee
NXP Employee

Hi Saqlain,

Just see you don't have received feedback from your request.

If I'm right you're using CW for PA V8.8. Am I right ?

Have a great day,
Pascal
NXP Technical Support

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

755 Views
saqlain_raza
Contributor I

Hi Pascal,

Thanks for the response :

I am using CodeWarrior For Power Architecture V 10.5.0

It seems that at least for a p2020rdb some type of virtual to physical address translation is required. For example if I place a breakpoint at one of my kernel modules symbol with an address 0xf23dc038, then the CCS verbose console shows that the actual address passed to the CCS API ccs_write_mem, ccs_read_mem functions is a different one such as 0x03f064038 .

I have a couple of SRs opened for trying to get some info about this virtual to phys addr translation. It would be really helpful if I can get some info that how this translation is achieved.

For a t4240rdb I don't see any address translation for the KMod and can see dnh instructions placed as a result of the breakpoint placement but stepping over these don't halt the debugger.

Looking forward to your response....

Thanks,

Saqlain Raza.

0 Kudos

755 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Saqlain,

As we discussed previously, in Linux Kernel (modules) debugging, users need to enable and configure Memory Translation map in the panel <project>_core00_RAM_<process>_Attach->Debugger->OS Awareness->Target OS(Linux)->Debug.

The Virtual Address is the effective address which is used in the debugged program, physical Address is real address where the program is running on the target, please configure the Memory Size to make the current debugged source code located in the memory translation range. This configuration should be coincident with the related MMU TLB configuration in Linux Kernel. In addition, please make sure that the configuration coincides with you current debugging code. For 64 bit Kernel debugging, please also specify 64 bit addresses.

If the Memory Translation map is configured correctly, the assemble code displayed in the Disassembly Window is what you expect and coincides with the C source code.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

755 Views
saqlain_raza
Contributor I

Hi Yiping,

Would the MMU Translation options specified in the debug configuration be used for doing a TLB0/TLB1 based address translation or would it be used for doing a page walk using the Linux kernel Page Global directory (PGD) entries ?

0 Kudos

755 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Saqlain,

The Memory Translation only helps CodeWarrior debugger to find the place where the current executing code is located, otherwise you will find that CodeWarrior cannot read the correct dissemble code back from the target in the disassembly Window. This configuration doesn't affect the program running on the target board.

Thanks,

Yiping

0 Kudos

755 Views
saqlain_raza
Contributor I

Hello everyone,

After setting up the translation map in the debug configuration (Debugger->OS Awareness->Target OS(Linux)->Debug) the software breakpoints have started to work on a P2020RDB (32-bit) kernel module debug but still I am not able to get it working on T4240RDB (64-bit) kernel module debug.

What values should be specified for :

- Physical base address:

- Virtual base address:

- Memory size:

for T4240RDB (64-bit) kernel module debugging. Currently I have specified the following values for T4240RDB but no luck :

- Physical base address: 0x0

- Virtual base address: 0xc000000000000000

- Memory size: 0x0000000180000000 (Not sure about this because there is no LOWMEM_SIZE option in the KConfig for PPC-64)

I have also tried setting up Memory Size as the sum of the page sizes of all valid TLB1 entries but that also doesn't help and I don't see any Virtual to physical address translation going on when I try to insert a software bp in the Kmod, however as already mentioned hardrware breakpoints are working fine which means that my KMod addresses are valid.

Any help ????

I am using 4K as the page size.

0 Kudos

755 Views
trytohelp
NXP Employee
NXP Employee

Hi Saqlain,

I've contacted colleagues supporting this tool (don't have enough background to help you).

Pascal

0 Kudos