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]

Re: [gdbserver] Fix attaching notices


A Monday 07 July 2008 18:55:10, Daniel Jacobowitz wrote:
> On Sat, Jun 28, 2008 at 12:11:12AM +0100, Pedro Alves wrote:
> >  (gdb) tar extended-remote :9999
> >  Remote debugging using :9999
> >  (gdb) attach 32762
> >  Attached to Thread 32762
> >  [New Thread 32762]
> >
> >  Program received signal SIGTRAP, Trace/breakpoint trap.
> >  0x00007fc30f5d0b30 in ?? ()
> >
> >  ... a bogus SIGTRAP.
>
> Did you reproduce this with an unmodified GDB or a patched one?  I
> can't reproduce it - I was curious since I did test vAttach and I
> don't remember seeing these SIGTRAPs.

Unmodified HEAD.

> Actually, wait... trying another GDB I see that this problem has
> appeared on the GDB side between 6.8 and HEAD.  6.8 doesn't print out
> the message about a SIGTRAP.

You're right, I just tried with 6.8 too, and don't see the SIGTRAP
notice...  I'll try to pinpoint what changed this, and see if it
was a spurious change.

>
> >  [Switching to Thread 2232]
> >  Stopped due to shared library event
> >  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> This part looks fine.

In the mean time, I've checked the bit to fix this in, as attached.

-- 
Pedro Alves
2008-07-07  Pedro Alves  <pedro@codesourcery.com>

	* server.c (handle_v_attach): Inhibit reporting dll changes.

---
 gdb/gdbserver/server.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c	2008-07-07 21:17:28.000000000 +0100
+++ src/gdb/gdbserver/server.c	2008-07-07 21:19:07.000000000 +0100
@@ -1024,6 +1024,11 @@ handle_v_attach (char *own_buf, char *st
   pid = strtol (own_buf + 8, NULL, 16);
   if (pid != 0 && attach_inferior (pid, status, signal) == 0)
     {
+      /* Don't report shared library events after attaching, even if
+	 some libraries are preloaded.  GDB will always poll the
+	 library list.  Avoids the "stopped by shared library event"
+	 notice on the GDB side.  */
+      dlls_changed = 0;
       prepare_resume_reply (own_buf, *status, *signal);
       return 1;
     }

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