From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21193 invoked by alias); 29 Aug 2006 16:47:45 -0000 Received: (qmail 21184 invoked by uid 22791); 29 Aug 2006 16:47:44 -0000 X-Spam-Check-By: sourceware.org Received: from web26101.mail.ukl.yahoo.com (HELO web26101.mail.ukl.yahoo.com) (217.12.10.225) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 29 Aug 2006 16:47:38 +0000 Received: (qmail 75415 invoked by uid 60001); 29 Aug 2006 16:47:35 -0000 Message-ID: <20060829164735.75413.qmail@web26101.mail.ukl.yahoo.com> Received: from [82.239.117.119] by web26101.mail.ukl.yahoo.com via HTTP; Tue, 29 Aug 2006 16:47:35 GMT Date: Tue, 29 Aug 2006 16:47:00 -0000 From: Matt HAMEAU Reply-To: Matt HAMEAU Subject: Re : Multi-thread debug doesn't work with me :( To: Daniel Jacobowitz Cc: gdb@sourceware.org In-Reply-To: <20060829134939.GA15664@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00219.txt.bz2 Hi Daniel, Thanks for your quick answer! Here is the output of my debug session. I use gdb 6.4.0.20051202-cvs because I use Insight (graphical debugger), an= d the latest version of Insight uses this version. ******************** $ /bin/arm-linux-uclibc-gdb -b 9600 CAM/am.01.00.00.0002.WW00/appman/delive= r/appman.sym GNU gdb 6.4.0.20051202-cvs Copyright 2005 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 condition= s. 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=3Di686-pc-cygwin --target=3Darm-linux-uc= libc"... (gdb) set solib-search-path /cygdrive/d/KitCOBRA/CAM/am.01.00.00.0002.WW00/= deliver/lib:/kitlib (gdb) target remote /dev/com1 Remote debugging using /dev/com1 0x40067a9c in ?? () (gdb) sharedlibrary Symbols already loaded for /lib/libpthread.so.0 Symbols already loaded for /lib/libc.so.0 Symbols already loaded for /lib/libgcc_s.so.1 Symbols already loaded for /lib/libdl.so.0 Symbols already loaded for /cygdrive/d/KitCOBRA/CAM/am.01.00.00.0002.WW00/d= eliver/lib/libecr.so.1 Symbols already loaded for /cygdrive/d/KitCOBRA/CAM/am.01.00.00.0002.WW00/d= eliver/lib/libam.so.1 Symbols already loaded for /kitlib/libcap.so.1 Symbols already loaded for /kitlib/libdbcomp.so.0 Symbols already loaded for /kitlib/libgui.so.0 Symbols already loaded for /kitlib/libgencom.so.0 Symbols already loaded for /kitlib/libos.so.0 Symbols already loaded for /kitlib/libxml.so.0 Symbols already loaded for /kitlib/libtag.so.0 Symbols already loaded for /kitlib/libgdbm.so.2 Symbols already loaded for /kitlib/libsecstd.so.0 Symbols already loaded for /lib/ld-uClibc.so.0 (gdb) b keyb keybGetAmount keybWaitPressed(KEYB_WAIT= _STRUCT*) keybGetAmount(KEY_TYPE*) keybWaitPressed(KEYB_WAIT= _STRUCT*)::__FUNCTION__ keybWaitPressed keybtask.cpp (gdb) b keybtask.cpp:226 Breakpoint 1 at 0x400b4574: file ../core/source/keybtask.cpp, line 226. (gdb) continue Continuing. [New thread 1026] [Switching to thread 1026] Breakpoint 1, KeybExecuteService (f_wService=3D0, f_pMin=3D0x3dba0) at ../c= ore/source/keybtask.cpp:226 226 ../core/source/keybtask.cpp: No such file or directory. in ../core/source/keybtask.cpp (gdb) list 221 in ../core/source/keybtask.cpp (gdb) p f_ f_pMin f_wService (gdb) p f_wService $1 =3D 0 (gdb) n [New thread 3076] ************************ Here, I press n for next, but it is like if the application continues. I stay stucked until I press control-C: ************************ Program received signal SIGINT, Interrupt. [Switching to thread 3076] 0x40068474 in nanosleep () from /lib/libc.so.0 (gdb) Quit (gdb) l 221 in ../core/source/keybtask.cpp (gdb) s Single stepping until exit from function nanosleep, which has no line number information. 0x40018250 in nanosleep () from /lib/libpthread.so.0 ************************ I press multiple times control-C: ************************ (gdb) Single stepping until exit from function nanosleep, which has no line number information. 0x4012ee80 in OS_TaskSuspendSelf () from /kitlib/libos.so.0 (gdb) Quit (gdb) Single stepping until exit from function OS_TaskSuspendSelf, which has no line number information. Program received signal SIGINT, Interrupt. 0x4012ee90 in OS_TaskSuspendSelf () from /kitlib/libos.so.0 (gdb) Quit (gdb) Single stepping until exit from function OS_TaskSuspendSelf, which has no line number information. Program received signal SIGINT, Interrupt. 0x4012ee90 in OS_TaskSuspendSelf () from /kitlib/libos.so.0 (gdb) Quit (gdb) Single stepping until exit from function OS_TaskSuspendSelf, which has no line number information. ManUnblock (fTask=3D4) at ../core/source/taskapi.cpp:346 346 ../core/source/taskapi.cpp: No such file or directory. in ../core/source/taskapi.cpp (gdb) Quit So now, I'm able to print values of variables, and the debugger knows where= it is. But it seems it cannot read the source file containg the code where I put t= he breakpoint: it gaves me the error "../core/source/taskapi.cpp: No such file or directo= ry." This file is a part of a shared library that is linked with my application = (libam.so) I don't understand why it gave me this error, because the symbols are loade= d and I don't move the library from the place it was generated. Anyway, the result is the same: when I step in after my breakpoint, the deb= ugger don't give me back the hand and the application continue its executio= n. When I press continue, the result is the same. Do you have an idea on where it comes? Thanks by advance Matthieu HAMEAU ----- Message d'origine ---- De : Daniel Jacobowitz =C3=80 : Matt HAMEAU Cc : gdb@sourceware.org Envoy=C3=A9 le : Mardi, 29 Ao=C3=BBt 2006, 3h49mn 39s Objet : Re: Multi-thread debug doesn't work with me :( On Tue, Aug 29, 2006 at 01:47:27PM +0000, Matt HAMEAU wrote: > But, when I try to debug a process that create multiple pthreads, I canno= t get into those threads and the debugger crashes: > - I connect to the board > - I set up a breakpoint in a function that will be executed by one of the= thread (created by pthread_create) > - I launch the remote debug > - when the thread reaches the breakpoint, the debugger stops > - debugger is lost, it is impossible to have any information on the curre= nt line of the code or on any variables Please be more specific. What happens? > - I "continue" the debug: the debugger crashes. Ditto. We can only respond to precise bug reports. > $ arm-linux-uclibc-gdb.exe --version > GNU gdb 6.3 > Copyright 2004 Free Software Foundation, Inc. You might want to try GDB 6.5. Also, have you set up a solib prefix? --=20 Daniel Jacobowitz CodeSourcery