This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ob] gnu-nat.c, push target before adding threads
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 9 Sep 2008 13:09:23 +0100
- Subject: [ob] gnu-nat.c, push target before adding threads
gnu_attach calls inf_update_procs, which calls inf_validate_procs,
which calls add_thread, which in turn will end up calling
target_pid_to_str --- this last one will print nicer things if the
gnu target is already pushed on the stack.
Committed as obvious.
--
Pedro Alves
2008-09-09 Pedro Alves <pedro@codesourcery.com>
* gnu-nat.c (gnu_attach): Push target before fetching the list of
threads.
---
gdb/gnu-nat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: src/gdb/gnu-nat.c
===================================================================
--- src.orig/gdb/gnu-nat.c 2008-09-09 03:00:07.000000000 +0100
+++ src/gdb/gnu-nat.c 2008-09-09 12:43:14.000000000 +0100
@@ -2170,12 +2170,14 @@ gnu_attach (char *args, int from_tty)
inf_debug (inf, "attaching to pid: %d", pid);
inf_attach (inf, pid);
+
+ push_target (&gnu_ops);
+
inf_update_procs (inf);
inferior_ptid = ptid_build (pid, 0, inf_pick_first_thread ());
attach_flag = 1;
- push_target (&gnu_ops);
/* We have to initialize the terminal settings now, since the code
below might try to restore them. */