From: Daniel Jacobowitz <drow@false.org>
To: Andreas Schwab <schwab@suse.de>
Cc: gdb@sourceware.org
Subject: Re: Race condition in attach command
Date: Tue, 13 Dec 2005 22:58:00 -0000 [thread overview]
Message-ID: <20051213225802.GA14796@nevyn.them.org> (raw)
In-Reply-To: <je64psfw2q.fsf@sykes.suse.de>
On Tue, Dec 13, 2005 at 11:53:17PM +0100, Andreas Schwab wrote:
> It seems like the attach command a timing bug. The problem is that when I
> attach to a process I often see that gdb cannot read the vDSO image from
> the process. When enabling infrun debugging I see that gdb tries to read
> the image before the process has actually stopped. I'm observing that
> both on ppc64-linux and ia64-linux, with gdb 6.4 and current trunk.
Yes, I know exactly what causes this - it was a recent (ish) reorganization
of the observers, I believe. I have this queued up to submit; does it
help for you?
--
Daniel Jacobowitz
CodeSourcery, LLC
Index: gdb-6.4/gdb/inf-ptrace.c
===================================================================
--- gdb-6.4.orig/gdb/inf-ptrace.c 2005-11-21 04:16:07.000000000 -0500
+++ gdb-6.4/gdb/inf-ptrace.c 2005-12-11 13:08:51.000000000 -0500
@@ -228,10 +228,6 @@ inf_ptrace_attach (char *args, int from_
inferior_ptid = pid_to_ptid (pid);
push_target (ptrace_ops_hack);
-
- /* Do this first, before anything has had a chance to query the
- inferior's symbol table or similar. */
- observer_notify_inferior_created (¤t_target, from_tty);
}
#ifdef PT_GET_PROCESS_STATE
Index: gdb-6.4/gdb/inf-ttrace.c
===================================================================
--- gdb-6.4.orig/gdb/inf-ttrace.c 2005-10-29 17:22:39.000000000 -0400
+++ gdb-6.4/gdb/inf-ttrace.c 2005-12-11 13:10:29.000000000 -0500
@@ -727,10 +727,6 @@ inf_ttrace_attach (char *args, int from_
inferior_ptid = pid_to_ptid (pid);
push_target (ttrace_ops_hack);
-
- /* Do this first, before anything has had a chance to query the
- inferior's symbol table or similar. */
- observer_notify_inferior_created (¤t_target, from_tty);
}
static void
Index: gdb-6.4/gdb/infcmd.c
===================================================================
--- gdb-6.4.orig/gdb/infcmd.c 2005-12-07 20:37:42.000000000 -0500
+++ gdb-6.4/gdb/infcmd.c 2005-12-11 13:09:33.000000000 -0500
@@ -1878,6 +1878,10 @@ attach_command (char *args, int from_tty
reread_symbols ();
}
+ /* Do this first, before anything has had a chance to query the
+ inferior's symbol table or similar. */
+ observer_notify_inferior_created (¤t_target, from_tty);
+
#ifdef SOLIB_ADD
/* Add shared library symbols from the newly attached process, if any. */
SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add);
Index: gdb-6.4/gdb/inftarg.c
===================================================================
--- gdb-6.4.orig/gdb/inftarg.c 2005-09-04 12:18:19.000000000 -0400
+++ gdb-6.4/gdb/inftarg.c 2005-12-11 13:10:37.000000000 -0500
@@ -211,10 +211,6 @@ child_attach (char *args, int from_tty)
inferior_ptid = pid_to_ptid (pid);
push_target (&deprecated_child_ops);
-
- /* Do this first, before anything has had a chance to query the
- inferior's symbol table or similar. */
- observer_notify_inferior_created (¤t_target, from_tty);
}
#if !defined(CHILD_POST_ATTACH)
next prev parent reply other threads:[~2005-12-13 22:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-13 22:53 Andreas Schwab
2005-12-13 22:58 ` Daniel Jacobowitz [this message]
2005-12-13 23:34 ` Andreas Schwab
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=20051213225802.GA14796@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sourceware.org \
--cc=schwab@suse.de \
/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