Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] debugging threads
@ 2007-09-03 14:12 Will Wagner
  2007-09-04 10:55 ` Will Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Will Wagner @ 2007-09-03 14:12 UTC (permalink / raw)
  To: buildroot

Hello,

I am trying to debug a multithreaded app and am having some problems. 
I've hunted around how to do this and have done the following:

Built uClibc with debug threads on so have a libthread_db.so
Built gdbserver for target

I then execute gdbserver with:
gdbserver 192.168.42.15:2345 /usr/sbin/threaded_test

On the host machine I run:
~/buildroot/build_i686/staging_dir/usr/bin/i686-linux-gdb ~/threaded_test

Once gdb starts I point it to the shared libs with:
set solib-absolute-prefix ~/buildroot/project_build_i686/uclibc/root

Then connect to gdbserver with
target remote 192.168.42.101:2345

I am able to debug the application until a call to create a thread 
(pthread_create) when I get the following error:

Program received signal SIG32, Real-time event 32.
0xb7ef0175 in sigsuspend ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libc.so.0
(gdb) bt
#0  0xb7ef0175 in sigsuspend ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libc.so.0
#1  0xb7faf6a4 in __pthread_wait_for_restart_signal ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libpthread.so.0
#2  0xb7faf6cc in ?? ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libpthread.so.0
#3  0xb7fb6040 in ?? ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libpthread.so.0
#4  0xb7fb1de8 in ?? ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libpthread.so.0
#5  0xbf871718 in ?? ()
#6  0xb7fafda8 in pthread_create ()
    from
/home/willw/buildroot/project_build_i686/uclibc/root/lib/libpthread.so.0
Backtrace stopped: frame did not save the PC


Can anyone tell me what step I am missing to get thread debugging 
working? From searching on the net it seems the libthread_db is needed 
but it doesn't seem to be loaded by gdb.

Many thanks,

Will.

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner at carallon.com
Senior Project Engineer                  Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Buildroot] debugging threads
@ 2011-04-05 16:13 Heyendal, Carl
  0 siblings, 0 replies; 3+ messages in thread
From: Heyendal, Carl @ 2011-04-05 16:13 UTC (permalink / raw)
  To: buildroot

Hi,

Please indulge me asking this question here. I know my question is out of the scope for this group but I know of no other group that could probably help me more as this one, as everyone here likely uses remote debugging. I'm frustrated because I'm getting nowhere with other groups in regard to my problem(s).

My question regards remote debugging of threads using Eclipse. I have a little app that prints "Hello World' from main() and again from a thread. That's it.

As a local app on my workstation, I can place a breakpoint in the thread and GDB will stop at the break point, refresh the Debug window with all the new thread information, and show the breakpoint in the source window...all automatically. 

But when I do this with the same app running remotely on my target I have to watch the debug window and when the I notice that the original thread is suspended I have to click the refresh button to get the debug window to update the new thread information, open the new thread that is marked as 'hit breakpoint', and click the last function in the stack indicating the breakpoint before I can see it in the source.

The remote app works perfectly when run from GDB stand-alone so it must be an Eclipse issue. I'm using GDB (DSF) Remote System Process Launcher in my debug configuration.

Shouldn't this be as automatic as debugging a local app? Do other people bother debugging from Eclipse because of quirks like this?

Correspond off-line if you wish.

Appreciate any help.

thanx
/carl

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-05 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-03 14:12 [Buildroot] debugging threads Will Wagner
2007-09-04 10:55 ` Will Wagner
  -- strict thread matches above, loose matches on Subject: below --
2011-04-05 16:13 Heyendal, Carl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox