cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
c.mcclenaghan
Contributor
Contributor
5,689 Views
Registered: ‎02-24-2014

Re: SDK debugging with Petalinux core files

Hi all

 

Thanks for your responses. Let me clarify my question a little.

 

I can use TCF to debug applications from the SDK without issue. The TCF agent is enabled in the rootfs and connects correctly.

 

root@Zynq:/tmp# ps
  PID USER       VSZ STAT COMMAND
    1 root      1836 S    init
    2 root         0 SW   [kthreadd]
<snip>
  856 root     17064 S    /usr/sbin/tcf-agent -d -L- -l0

I can create a core file on the Zynq following a seg fault (forced in the below example with a test example, make-a-seg-fault )

 

root@Zynq:/tmp# ls -l
-rwxr-xr-x    1 root     root      16906844 Jan  1 00:04 make-a-seg-fault
root@Zynq:/tmp# ulimit -c unlimited
root@Zynq:/tmp# ulimit
unlimited
root@Zynq:/tmp# ./make-a-seg-fault
Segmentation fault (core dumped)
root@Zynq:/tmp# ls -l
-rw-------    1 root     root       5197824 Jan  1 00:18 core
-rwxr-xr-x    1 root     root      16906844 Jan  1 00:04 make-a-seg-fault

My question arises as I cannot see how to configure the SDK Debug Configurations to use the core file instead of downloading the application and running the remote copy. With a desktop application using GDB I might do the following:

 

gdb make-a-seg-fault core

I've searched the documentation, the git source for tcf-agent and

 

# tcf-agent -h

on the Zynq doesn't yield any obvious options.

 

Am I missing something obvious or is this not yet supported in TCF.

 

Thanks

Chris

 

PS. In case you're wondering, our application only generated a seg-fault while running stand-alone on the board not while under the debugger.

 

0 Kudos
3 Replies
pvenugo
Moderator
Moderator
5,589 Views
Registered: ‎07-31-2012

Hi,

 

Let me know if the attached debugging steps help you.

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
c.mcclenaghan
Contributor
Contributor
5,563 Views
Registered: ‎02-24-2014

Hi Praveen

 

Thanks for the document. As I said before, TCF is enabled in the rootfs and I can debug my project successfully from the SDK.

The issue arises when trying to use load a core file into the debugger instead of the running binary.

 

To expand, in your document at Figure 3-11, I might have expected to see an option to load a core file along with the Remote File Path as one can do from the gdb command line.

 

Regards

Chris

 

0 Kudos
rgrossman
Adventurer
Adventurer
5,554 Views
Registered: ‎12-03-2015

Hi Chris,

 

The fact that your application runs fine in the debugger but not stand-alone is a symptom of an uninitialized variable. When compiled with the debug switch, the compiler explicitly sets all variables to 0. This is not done when compiling with optimization on.

Something easy to check for if you can't get the debugger to work on the core file.

 

Have you tried running the arm-gnu debugger directly from the command line? It is in .../petalinux-v2015.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin 

 

Cheers,

Ron 

0 Kudos