This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] async mode, normal_stop


Hi,

This patch fixes the following annoying issue when attaching in async mode,

 >./gdb/gdb
 (gdb) maint set linux-async 1
 (gdb) attach 28704
 Attaching to process 28704
 [Switching to process 28704]
 0x7aeaa796 in ?? ()
 ^^^^^^^^^^^^^^^^^^^

This should not be printed at all.

 Reading symbols from /home/pedro/gdb/tests/threads...done.
 Reading symbols from /lib/libpthread.so.0...done.
 [Thread debugging using libthread_db enabled]
 [New Thread 0x4297e950 (LWP 28706)]
 [New Thread 0x4217d950 (LWP 28705)]
 Loaded symbols for /lib/libpthread.so.0
 Reading symbols from /lib/libc.so.6...done.
 Loaded symbols for /lib/libc.so.6
 Reading symbols from /lib/ld-linux-x86-64.so.2...done.
 Loaded symbols for /lib64/ld-linux-x86-64.so.2
 0x00007f867aeaa796 in pthread_join () from /lib/libpthread.so.0
 (gdb)    

The attached fixes it.

If stop_soon != NO_STOP_QUIETLY, we should defer the normal_stop
(the not quiet stop) call to somewhere else.  In async mode, 
this is in the attach_command_continuation, which only runs after
the call I'm changing.

In sync mode, this is exactly the equilalent attach_command
not going through proceed, but instead calling wait_for_inferior
itself, and then calling normal_stop itself too.

Checked in as obvious.

Well, to be absolutelly sure, I tested on x86_64-unknown-linux-gnu
native and remote, sync and async, compared the async output to the
sync output, and found no regressions.

-- 
Pedro Alves
---
 gdb/infrun.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c	2008-07-24 18:01:19.000000000 +0100
+++ src/gdb/infrun.c	2008-08-16 01:35:36.000000000 +0100
@@ -1577,7 +1577,9 @@ fetch_inferior_event (void *client_data)
     {
       delete_step_resume_breakpoint (&step_resume_breakpoint);
 
-      normal_stop ();
+      if (stop_soon == NO_STOP_QUIETLY)
+	normal_stop ();
+
       if (step_multi && stop_step)
 	inferior_event_handler (INF_EXEC_CONTINUE, NULL);
       else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]