2010-12-03 10:28:36     Debugging application with gdbserver over serial

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-12-03 10:28:36     Debugging application with gdbserver over serial

Reggy Perrin (UNITED STATES)

Message: 96455   

 

Hi folks,

 

We're attempting to track down a software bug (a thread lockup issue in a multi-threaded C++ app) using gdbserver operating over a serial port.  However, this appears to be very unstable, and constantly traps the processor, or otherwise won't give us valid backtraces to help isolate our issue.

 

Is this method capable of handling a multi-threaded C++ application?  If not, is there a better alternative?

 

We need to insure the capability of this method, to make sure we are going down the right path.

 

Thanks,

RP

QuoteReplyEditDelete

 

 

2010-12-05 23:42:31     Re: Debugging application with gdbserver over serial

Simon Brewer (AUSTRALIA)

Message: 96499   

 

Hi Reggy,

 

what release are you using?  What processor are you running on?  Do you have a test case that shows the problem?

 

Simon

QuoteReplyEditDelete

 

 

2010-12-06 12:52:27     Re: Debugging application with gdbserver over serial

Reggy Perrin (UNITED STATES)

Message: 96508   

 

Simon:

 

Processor:  BF524

 

Linux version 2.6.36-ADI-2011R1-pre-svn9439

Compiled for ADSP-BF524 Rev any, running on 0.2

 

C:\>"\Program Files\Analog Devices\GNU Toolchain\2009R1.1\linux-uclibc\bin\bfin-linux-uclibc-gdb.exe" TestApp.dbg

 

GNU gdb 6.6

Copyright (C) 2006 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB.  Type "show warranty" for details.

This GDB was configured as "--host=i586-mingw32msvc --target=bfin-linux-uclibc"...

(gdb) handle SIG32 nostop noprint pass

Signal        Stop      Print   Pass to program Description

SIG32         No        No      Yes             Real-time event 32

(gdb) target remote COM4

Remote debugging using COM4

0x02e50c60 in ?? ()

<m Files/Analog Devices/GNU Toolchain/2009R1.1/linux-uclibc/bfin-linux-uclibc/runtime"

(gdb) set scheduler-locking step

(gdb) b main

Breakpoint 1 at 0x2c5f0ee: file main.cpp, line 239.

(gdb) c

Continuing.

Error while mapping shared library sections:

/usr/lib/libasound.so.2: Invalid argument.

Error while mapping shared library sections:

/lib/libstdc++.so.6: Invalid argument.

Error while mapping shared library sections:

/lib/libdl.so.0: Invalid argument.

Error while mapping shared library sections:

/lib/libpthread.so.0: Invalid argument.

Error while mapping shared library sections:

/lib/libgcc_s.so.1: Invalid argument.

Error while mapping shared library sections:

/lib/libc.so.0: Invalid argument.

Error while mapping shared library sections:

/lib/libm.so.0: Invalid argument.

Error while mapping shared library sections:

/lib/librt.so.0: Invalid argument.

Error while mapping shared library sections:

/lib/ld-uClibc.so.0: Invalid argument.

 

Breakpoint 1, main () at main.cpp:239

239             prior.sched_priority = 99;

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

0x010ccece in ?? ()

(gdb) bt

#0  0x010ccece in ?? ()

#1  0x02ef6da0 in ?? ()

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

(gdb)

QuoteReplyEditDelete

 

 

2010-12-06 21:35:04     Re: Debugging application with gdbserver over serial

Sonic Zhang (CHINA)

Message: 96519   

 

Could you try on 2010R1-RC5 other than ADI-2011R1-pre-svn? We have never run any testing against the svn trunk yet.

QuoteReplyEditDelete

 

 

2010-12-07 15:22:42     Re: Debugging application with gdbserver over serial

Reggy Perrin (UNITED STATES)

Message: 96543   

 

Folks,

 

Just to be clear, I'm not asking (yet) to resolve this issue, but am asking about the strategy:

 

    Can gdbserver, connected via a serial port, fully support multi-threaded C++ debugging?

 

If gdbserver isn't robust enough to support a multi-threaded application, we shouldn't be trying to get this method working, and need to find an alternative approach.

 

Our core issue is deep in a thread, and we are trying to determine the proper method for debugging.  If gdbserver isn't the right tool, what is the best tool for handling these issues buried deep?

 

Thanks

QuoteReplyEditDelete

 

 

2010-12-07 17:08:11     Re: Debugging application with gdbserver over serial

Reggy Perrin (UNITED STATES)

Message: 96545   

 

Additionally, we've moved to the RC5 kernel and we have the same results.

QuoteReplyEditDelete

 

 

2010-12-08 04:30:45     Re: Debugging application with gdbserver over serial

Mike Frysinger (UNITED STATES)

Message: 96555   

 

C++ and pthreads should work fine with gdbserver

 

however, you're running things under Windows and clearly that's causing a problem.  try under Linux.

QuoteReplyEditDelete

 

 

2010-12-08 04:30:49     Re: Debugging application with gdbserver over serial

Mike Frysinger (UNITED STATES)

Message: 96556   

 

you cannot mix kernel and toolchain versions.  like the FAQ states, you must use the same version of software for everything.

QuoteReplyEditDelete

 

 

2010-12-08 15:42:21     Re: Debugging application with gdbserver over serial

Reggy Perrin (UNITED STATES)

Message: 96567   

 

Mike,

 

We've moved to debugging in linux (as opposed to using Windows), and are seeing a more stable environment.  We will continue to test and advise of our progress.

 

R

QuoteReplyEditDelete

Attachments

    Outcomes