From: Thomas Schwinge <tschwinge@gnu.org>
To: Pedro Alves <pedro@codesourcery.com>, uweigand@de.ibm.com
Cc: gdb@sourceware.org, "Alfred M. Szmidt" <ams@gnu.org>, bug-hurd@gnu.org
Subject: [PATCH?] GDB HEAD (partly) broken for GNU/Hurd
Date: Sat, 11 Oct 2008 17:43:00 -0000 [thread overview]
Message-ID: <20081011174040.GI21737@fencepost.gnu.org> (raw)
In-Reply-To: <20081011172611.GH21737@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]
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
===================================================================
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. */
+ /* TODO. How to keep this synchronized with gnu-nat.c's own counting? */
if (exec_wrapper)
pending_execs++;
@@ -439,6 +440,8 @@ startup_inferior (int ntraps)
memset (&ws, 0, sizeof (ws));
resume_ptid = target_wait (pid_to_ptid (-1), &ws);
+ switch_to_thread (resume_ptid);
+
/* Mark all threads non-executing. */
set_executing (pid_to_ptid (-1), 0);
(gdb) r
Starting program: /media/data/home/tschwinge/tmp/n1/hurd/ext2fs.static
[New Thread 27194.5]
Program received signal SIGSEGV, Segmentation fault.
convert_options (argp=0x813f0bc, parent=0x0, parent_index=0, group=0x81712e8, cvt=0x101fad0) at argp.h:579
579 argp.h: No such file or directory.
in argp.h
(gdb) bt
#0 convert_options (argp=0x813f0bc, parent=0x0, parent_index=0, group=0x81712e8, cvt=0x101fad0) at argp.h:579
#1 0x080b4675 in convert_options (argp=0x101f980, parent=0x0, parent_index=0, group=0x81712e8, cvt=0x101fad0) at argp-parse.c:407
#2 0x080b4834 in __argp_parse (argp=0x101f980, argc=1, argv=0x101fc14, flags=<value optimized out>, end_index=0x0, input=0x101fb3c) at argp-parse.c:435
#3 0x08056dad in diskfs_init_main (startup_argp=0x0, argc=1, argv=0x101fc14, store_parsed=0x8153284, bootstrap=0x101fb8c) at ../../hurd.work/libdiskfs/init-main.c:37
#4 0x0804bd9b in main (argc=1, argv=0x101fc14) at ../../hurd.work/ext2fs/ext2fs.c:172
(gdb) info threads
5 Thread 27194.5 0x080b5a8c in mach_msg_trap ()
* 4 Thread 27194.4 convert_options (argp=0x813f0bc, parent=0x0, parent_index=0, group=0x81712e8, cvt=0x101fad0) at argp.h:579
As it should be! :-)
Regards,
Thomas
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2008-10-11 17:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 9:37 Thomas Schwinge
2008-10-09 11:47 ` Alfred M. Szmidt
2008-10-09 12:46 ` Commit access for me? (was: GDB HEAD (partly) broken for GNU/Hurd) Thomas Schwinge
2008-10-09 13:21 ` Joel Brobecker
2008-10-09 11:55 ` GDB HEAD (partly) broken for GNU/Hurd Pedro Alves
2008-10-11 2:49 ` Thomas Schwinge
2008-10-11 2:50 ` Pedro Alves
2008-10-11 17:29 ` Thomas Schwinge
2008-10-11 17:43 ` Thomas Schwinge [this message]
2008-10-13 16:41 ` [PATCH?] " Ulrich Weigand
2008-10-13 18:35 ` Pedro Alves
2008-10-14 15:49 ` Thomas Schwinge
2008-10-11 17:47 ` Pedro Alves
2008-10-11 17:49 ` Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081011174040.GI21737@fencepost.gnu.org \
--to=tschwinge@gnu.org \
--cc=ams@gnu.org \
--cc=bug-hurd@gnu.org \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox