Why does CodeWarrior halt unexpectedly when debugging threads?

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does CodeWarrior halt unexpectedly when debugging threads?

Jump to solution
613 Views
alanbacklund
Contributor I

I am trying to remote debug the CodeWarrior Linux_Examples/Thread program and the program always appears to halt before it reaches the end. Where it halts varies depending what breakpoints have been set (if any). The program runs fine when it is not being debugged. It also works when it is debugged on the target with gdb.

 

I have unstripped libpthread.so.0 and ld.so.1 libraries. Remote debugging did not work without the unstripped ld.so.1 library. The unstripped libpthread.so.0 does not seem to have any effect.

I have enabled connection logging  but have not found the log.

I am using QorIQ-SDK-V1.4-20130625-yocto to generate Linux, CodeWarrior PA 10.3 (CW_PA_v10.3_Linux_b130315) and a P1020RDB-PC development system.

 

Thanks

Labels (1)
0 Kudos
1 Solution
165 Views
addiyi
NXP Employee
NXP Employee

Hi,

I have reproduced your scenario, using a board with e500v2 cpu and CW PA 10.3 for Windows. So indeed, using un-stripped library CW halt unexpectedly when debugging threads. As an workaround until this issue will be fixed, you can used stripped libraries, which allow you to debug the application, but not the libraries.

Adrian

View solution in original post

0 Kudos
6 Replies
165 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hi Alan,

Please try to use AppTRK source provided in CodeWarrior 10.3 C:\Program Files\Freescale\CW PA v10.3\PA\PA_Tools\AppTRK, which should work.

Thanks


0 Kudos
165 Views
alanbacklund
Contributor I

The code in the CW apptrk is different than the code in the SDK apptrk, but they both have the same the version. It took several attempts before I was sure I had the CW apptrk. It didn't fix the problems.Switching to SDK 1.3.2 also did not help.

I am now testing using gdbserver with eclipse.

Thanks

0 Kudos
165 Views
addiyi
NXP Employee
NXP Employee

Hi Alan,

Please try to use files attached. I was able to debug correctly Thread project using these libs. Copy libs files to your target board and provide execution rights. (chmod +x). Then copy to n /lib and then change the symbolic links as below:

In /lib folder:

ln -fs ld-2.15_nostrip.so ld.so.1

ln -fs libpthread-2.15_nostrip.so  libpthread.so.0

and rename the libthread lib:

mv libthread_db-1.0_nostrip.so libthread_db.so.1

After that you can start apptrk or apptrk_debug (this will provide debug messages).

NOTE: take a look to screenshots attached.

NOTE2: I used CW 10.3 for Windows and SDK 1.4

0 Kudos
166 Views
addiyi
NXP Employee
NXP Employee

Hi,

I have reproduced your scenario, using a board with e500v2 cpu and CW PA 10.3 for Windows. So indeed, using un-stripped library CW halt unexpectedly when debugging threads. As an workaround until this issue will be fixed, you can used stripped libraries, which allow you to debug the application, but not the libraries.

Adrian

View solution in original post

0 Kudos
165 Views
alanbacklund
Contributor I

You're right the program finishes with no breakpoints or breakpoints in the main program if the libraries are stripped. Setting a breakpoint in a thread still stops the program unexpectedly.

Thanks

Is there any way I can monitor the status of this issue?

0 Kudos
165 Views
addiyi
NXP Employee
NXP Employee

Hi Alan,

CW 10.3 doesn't provide support for SDK 1.4, so this is the cause of the issue. For CW 10.3, compatible SDK is 1.3.2. You can get it form here (SDK1.3.2). Also, is mandatory yo use both libpthread.so.0 and ld.so.1 unstripped.

Adrian

0 Kudos