09-19-2016 02:25 AM
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.
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.
09-25-2016 07:44 AM
09-26-2016 06:53 AM
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.
09-26-2016 08:18 AM
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