Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro_alves@portugalmail.pt>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [gdbserver] Fix attaching notices
Date: Mon, 07 Jul 2008 23:52:00 -0000	[thread overview]
Message-ID: <200807080051.46088.pedro@codesourcery.com> (raw)
In-Reply-To: <20080707175510.GB1778@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

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

[-- Attachment #2: stopped_due_to_library_event.diff --]
[-- Type: text/x-diff, Size: 934 bytes --]

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;
     }

  reply	other threads:[~2008-07-07 23:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 23:26 Pedro Alves
2008-07-07 17:55 ` Daniel Jacobowitz
2008-07-07 23:52   ` Pedro Alves [this message]
2008-07-08  1:59     ` Pedro Alves
2008-07-11 14:13       ` Daniel Jacobowitz
2008-07-11 17:12         ` Pedro Alves
2008-07-11 17:37           ` Daniel Jacobowitz

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=200807080051.46088.pedro@codesourcery.com \
    --to=pedro_alves@portugalmail.pt \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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