UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant jsara
Participant
9,361 Views
Registered: ‎08-14-2015

SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

I am trying to debug a simple application using the SDK on the Vivado 2015.2 SDK.  The target is Zynq (ZED Board) running Linuz, as supplied with the board.

 

A simple application debugs fine and also runs fine without the debugger.

 

I would like to use the BOOST libraries, which I compiled successfully.

 

When I build a program that just includes some boost headers (mainly ASIO) the program will run fine without the debugger (download to linux and run), but I cannot debug it.

 

When debugging it crashes before reaching main with an exception thrown - I think its a segmentation fault.  The boost libraries have some static function calls (that happen on program init - before main() is called.

 

Does anyone know how to fix this problem, since the code runs correctly without the debugger I assume that this is related to gdb, or some configuration parameter of gdb?

0 Kudos
8 Replies
Participant jsara
Participant
9,337 Views
Registered: ‎08-14-2015

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

The actual error I get is SIGILL - illegal instruction when running with the debugger.  Without the debugger (GDB) the program runs fine.

0 Kudos
Newbie ardanew
Newbie
9,190 Views
Registered: ‎12-09-2015

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

Looks like a gdbserver error

 

try

- updating gdbserver to the new version (not tested by me for now)

or

- manually fix ELF header OS/ABI from UNIX-GNU(3) to UNIX-SystemV(0) (works for me for now)

0 Kudos
Scholar sampatd
Scholar
9,187 Views
Registered: ‎09-05-2011

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

0 Kudos
Newbie ardanew
Newbie
9,177 Views
Registered: ‎12-09-2015

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

the bug is caused by old gdb (in my case its arm-xilinx-linux-gnueabi-gdb.exe), sdks 2015.3, 2015.4. if i manually patch this executable

D8 : 7C FF -> 50 82
495F : 0F 85 9C 00 00 00 -> 90 90 90 90 90 90

the bug is no more there.

 

this bug is referenced by

https://sourceware.org/ml/gdb-patches/2015-03/msg00925.html

and must be gone in new gdb versions (but currently sdk uses an old GNU gdbserver Sourcery CodeBench Lite 2015.05-17 7.7.50.20140217-cvs version)

 

maybe gdb should be updated in new sdk versions...

0 Kudos
Participant jsara
Participant
9,158 Views
Registered: ‎08-14-2015

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

Using the system debugger fixed the problem.  Sounds like there is another solution to upgrade the gdb version.  Thanks for the replies.

0 Kudos
Scholar sampatd
Scholar
9,097 Views
Registered: ‎09-05-2011

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

Good to know system debugger fixed the issue. It is preferable to use the System Debugger. Moving forward, GNU debugger will not support the latest Xilinx devices:
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_4/SDK_Doc/SDK_tasks/task_faq_inwhichscenarioshouldiusedebugger.html

0 Kudos
Participant jsara
Participant
9,078 Views
Registered: ‎08-14-2015

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

It would be helpful if:

 

* Tutorials used features that worked rather than features that are known to be defective.  I was using gdb because the tutorial said to.

 

* Posts of problems are answered.  In this case they were but months after the problem was discovered.  This is a problem for using SOC products which as I understand it have no other support mechanism.

 

0 Kudos
Scholar sampatd
Scholar
8,968 Views
Registered: ‎09-05-2011

Re: SDK 2015.2 Debugging on Zynq with Linux - GDB Problem - Cannot Debug - Crashed Before Main

Thanks for the feedback.
0 Kudos