From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7439 invoked by alias); 11 Oct 2008 17:43:54 -0000 Received: (qmail 7428 invoked by uid 22791); 11 Oct 2008 17:43:54 -0000 X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Oct 2008 17:43:11 +0000 Received: from tschwinge by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KoiSG-0007Gs-M3; Sat, 11 Oct 2008 13:40:40 -0400 Date: Sat, 11 Oct 2008 17:43:00 -0000 From: Thomas Schwinge To: Pedro Alves , uweigand@de.ibm.com Cc: gdb@sourceware.org, "Alfred M. Szmidt" , bug-hurd@gnu.org Subject: [PATCH?] GDB HEAD (partly) broken for GNU/Hurd Message-ID: <20081011174040.GI21737@fencepost.gnu.org> References: <20081009093424.GN7127@fencepost.gnu.org> <200810091255.17394.pedro@codesourcery.com> <20081010232706.GG21737@fencepost.gnu.org> <200810110047.39807.pedro@codesourcery.com> <20081011172611.GH21737@fencepost.gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QDIl5R72YNOeCxaP" Content-Disposition: inline In-Reply-To: <20081011172611.GH21737@fencepost.gnu.org> X-Homepage: http://www.thomas.schwinge.homeip.net/ User-Agent: Mutt/1.5.11 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00046.txt.bz2 --QDIl5R72YNOeCxaP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 3185 Hello again! On Sat, Oct 11, 2008 at 07:26:11PM +0200, I wrote: > Unfortunately no luck so far. wait_for_inferior / handle_inferior_event > (which was used in the old code) is too complex as to be quickly > understandable for me. And I guess I'm estimating correctly that it's > ``simply'' some side-effect of these that the old code works, while the > new doesn't? Perhaps having a look at the logs I appended below some of > you GDB gurus is able to spot the obvious? Ha, I, myself, am the GDB guru here ;-)! I had a look at the log again, experimented some more, and finally got it going with the following patch. However, I have absolutely no idea whether that is correct in all cases, etc. Should perhaps target_wait (a.k.a. gnu-nat.c's gnu_wait) be doing that? Index: fork-child.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/fork-child.c,v retrieving revision 1.45 diff -u -p -r1.45 fork-child.c --- fork-child.c 22 Sep 2008 15:16:51 -0000 1.45 +++ fork-child.c 11 Oct 2008 17:34:33 -0000 @@ -427,6 +427,7 @@ startup_inferior (int ntraps) have stopped one instruction after execing the shell. Here we must get it up to actual execution of the real program. */ =20 + /* TODO. How to keep this synchronized with gnu-nat.c's own counting? = */ if (exec_wrapper) pending_execs++; =20 @@ -439,6 +440,8 @@ startup_inferior (int ntraps) memset (&ws, 0, sizeof (ws)); resume_ptid =3D target_wait (pid_to_ptid (-1), &ws); =20 + switch_to_thread (resume_ptid); + /* Mark all threads non-executing. */ set_executing (pid_to_ptid (-1), 0); =20 (gdb) r Starting program: /media/data/home/tschwinge/tmp/n1/hurd/ext2fs.static= =20 [New Thread 27194.5] =20=20=20=20 Program received signal SIGSEGV, Segmentation fault. convert_options (argp=3D0x813f0bc, parent=3D0x0, parent_index=3D0, grou= p=3D0x81712e8, cvt=3D0x101fad0) at argp.h:579 579 argp.h: No such file or directory. in argp.h (gdb) bt #0 convert_options (argp=3D0x813f0bc, parent=3D0x0, parent_index=3D0, = group=3D0x81712e8, cvt=3D0x101fad0) at argp.h:579 #1 0x080b4675 in convert_options (argp=3D0x101f980, parent=3D0x0, pare= nt_index=3D0, group=3D0x81712e8, cvt=3D0x101fad0) at argp-parse.c:407 #2 0x080b4834 in __argp_parse (argp=3D0x101f980, argc=3D1, argv=3D0x10= 1fc14, flags=3D, end_index=3D0x0, input=3D0x101fb3c) a= t argp-parse.c:435 #3 0x08056dad in diskfs_init_main (startup_argp=3D0x0, argc=3D1, argv= =3D0x101fc14, store_parsed=3D0x8153284, bootstrap=3D0x101fb8c) at ../../hur= d.work/libdiskfs/init-main.c:37 #4 0x0804bd9b in main (argc=3D1, argv=3D0x101fc14) at ../../hurd.work/= ext2fs/ext2fs.c:172 (gdb) info threads=20 5 Thread 27194.5 0x080b5a8c in mach_msg_trap () * 4 Thread 27194.4 convert_options (argp=3D0x813f0bc, parent=3D0x0, pa= rent_index=3D0, group=3D0x81712e8, cvt=3D0x101fad0) at argp.h:579 As it should be! :-) Regards, Thomas --QDIl5R72YNOeCxaP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 191 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFI8OUYgfzh735dTTURAmtlAKDEYm0oLDVEV3hoaAf3GJUyo+y8WwCfXEvU O7DDxi3lQyLOg2i30OUqYak= =aPbO -----END PGP SIGNATURE----- --QDIl5R72YNOeCxaP--