From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31652 invoked by alias); 26 Oct 2006 09:55:38 -0000 Received: (qmail 31644 invoked by uid 22791); 26 Oct 2006 09:55:37 -0000 X-Spam-Check-By: sourceware.org Received: from metis.extern.pengutronix.de (HELO metis.extern.pengutronix.de) (83.236.181.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Oct 2006 09:55:30 +0000 Received: from mediacenter.ptxnet.pengutronix.de ([10.1.0.65] helo=localhost) by metis.extern.pengutronix.de with esmtp (Exim 3.36 #1 (Debian)) id 1Gd1xL-0000pY-00; Thu, 26 Oct 2006 11:55:23 +0200 Date: Thu, 26 Oct 2006 09:55:00 -0000 From: Luotao Fu To: Daniel Jacobowitz Cc: Franz MEINDL , Manfred Gruber , Marc Kleine-Budde , gdb@sourceware.org, Luotao Fu , Robert Schwebel , Benedikt Spranger , tglx@linutronix.de Subject: Re: thread-debuging with gdbserver on ARM/NPTL Message-ID: <20061026095736.GA19785@localhost.localdomain> References: <20061024202933.1d5129b9.b.spranger@linutronix.de> <20061024183404.GA16931@nevyn.them.org> <20061025144529.GQ18636@pengutronix.de> <20061025150344.GA20038@nevyn.them.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i9LlY+UWpKt15+FH" Content-Disposition: inline In-Reply-To: <20061025150344.GA20038@nevyn.them.org> X-PGP-Key-ID: 0xE5325261 X-URL: http://www.pengutronix.de User-Agent: Mutt/1.5.13 (2006-08-11) 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-10/txt/msg00256.txt.bz2 --i9LlY+UWpKt15+FH Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1637 Hi, On Wed, Oct 25, 2006 at 11:03:44AM -0400, Daniel Jacobowitz wrote: > On Wed, Oct 25, 2006 at 04:45:29PM +0200, Robert Schwebel wrote: > > Here are some more details about the problem. It turned out that it > > works if you link against libpthread dynamically and doesn't with > > -static. >=20 > Oh, right. Thread debugging of static applications using NPTL is > particularly problematic. Take a look at this, for starters: >=20 > http://sourceware.org/bugzilla/show_bug.cgi?id=3D2696 We built a Toolchain with gcc4.1.1+glibc2.5+gdb-6.5.50.20061025 using the patch posted on http://sourceware.org/ml/libc-alpha/2006-03/msg00014.html and did the same test as already described in robert's mail again. Unluckiely the=20 problems with static binary seems to still consist. On the host=20 side gdb would stuck at first continue, while on the target side=20 gdbserver prints something like "Cannot enable thread event reporting=20 for [PID of the testapp]: generic error".=20 I however noticed that the test can be run if there's no symboltable given on the host side. (say gdb is started without any parameter or arguments) In this case I can process between the continues sending=20 SIGINT. I logged the outputs and used commands to a log file and enclose it in the attachment.=20 >=20 > --=20 > Daniel Jacobowitz > CodeSourcery Regards Luotao Fu --=20 Dipl.-Ing. Luotao Fu | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Handelsregister: Amtsgericht Hildesheim, HRA 2686 Hannoversche Str. 2, 31134 Hildesheim, Germany Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9 --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="static_bin.gdb_patched.log" Content-length: 4545 gdb (host): lfu@himalia:/ptx/work/mkl/sprecher/testcases/test_case_3 /opt/OSELAS.Toolchain-trunk/arm-ep93xx-linux-gnueabi/gcc-4.1.1-glibc-2.5-staticfix/bin/arm-ep93xx-linux-gnueabi-gdb gdb_test GNU gdb 6.5.50.20061025 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=i686-host-linux-gnu --target=arm-ep93xx-linux-gnueabi"... Breakpoint 1 at 0x8294: file gdb_test.c, line 32. Breakpoint 2 at 0x8340: file gdb_test.c, line 49. Breakpoint 3 at 0x83ec: file gdb_test.c, line 66. Breakpoint 4 at 0x8498: file gdb_test.c, line 83. Breakpoint 5 at 0x8550: file gdb_test.c, line 101. Breakpoint 6 at 0x8568: file gdb_test.c, line 102. Breakpoint 7 at 0x8580: file gdb_test.c, line 103. Breakpoint 8 at 0x8598: file gdb_test.c, line 104. 0x00008110 in _start () Ignoring packet error, continuing... warning: Invalid remote reply: qSymbol:5f5f6e70746c5f6c6173745f6576656e74 Interrupted while waiting for the program. Give up (and stop debugging it)? (y or n) [answered Y; input not from terminal] gdbserver (testboard): root@testboard:~> gdbserver 192.168.23.1:2345 gdb_test Process gdb_test created; pid = 365 Listening on port 2345 Remote debugging from host 192.168.23.1 Cannot enable thread event reporting for 365: generic error input_interrupt, count = 0 c = 0 ('') readchar: Got EOF putpkt(read): Got EOF thread getmsg err: debugger service failed Segmentation fault ############################################################################################# gdb(host) malia:/ptx/work/mkl/sprecher/testcases/test_case_3 /opt/OSELAS.Toolchain-trunk/arm-ep93xx-linux-gnueabi/gcc-4.1.1-glibc-2.5-staticfix/bin/arm-ep93xx-linux-gnueabi-gdb GNU gdb 6.5.50.20061025 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=i686-host-linux-gnu --target=arm-ep93xx-linux-gnueabi". No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. No symbol table is loaded. Use the "file" command. 0x00008110 in ?? () Program received signal SIGINT, Interrupt. 0x00021774 in ?? () No shared libraries loaded at this time. Program received signal SIGINT, Interrupt. 0xbeeaf9b4 in ?? () Program received signal SIGINT, Interrupt. 0x00021774 in ?? () Program received signal SIGINT, Interrupt. 0xbeeaf9b4 in ?? () 1 Thread 367 0xbeeaf9b4 in ?? () warning: Couldn't restore frame in current thread, at frame 0 0xbeeaf9b4 in ?? () Program received signal SIGINT, Interrupt. 0x00021774 in ?? () Program received signal SIGINT, Interrupt. 0xbeeaf9b4 in ?? () Program received signal SIGINT, Interrupt. 0xbeeaf9a8 in ?? () Program received signal SIGINT, Interrupt. 0xbeeaf99c in ?? () The program is running. Exit anyway? (y or n) [answered Y; input not from terminal] gdbserver (testboard): root@phyCORE-PXA270:~> gdbserver 192.168.23.1:2345 gdb_test Process gdb_test created; pid = 367 Listening on port 2345 Remote debugging from host 192.168.23.1 main My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 main My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 main My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 main My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 My name is 1. thread 1 My name is 2. thread 2 My name is 3. thread 3 My name is 4. thread 4 Killing inferior --sdtB3X0nJg68CQEu-- --i9LlY+UWpKt15+FH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFQIaQiruQY+UyUmERAkvyAJ9oNJl/twCETRSTN1Dg+MuSahf6ngCgqKU1 e/7etkWbQb4xrEaa5dwHK8s= =2PGf -----END PGP SIGNATURE----- --i9LlY+UWpKt15+FH--