From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32670 invoked by alias); 7 Jul 2008 23:52:11 -0000 Received: (qmail 32660 invoked by uid 22791); 7 Jul 2008 23:52:10 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 07 Jul 2008 23:51:51 +0000 Received: by nf-out-0910.google.com with SMTP id h3so672442nfh.48 for ; Mon, 07 Jul 2008 16:51:47 -0700 (PDT) Received: by 10.210.92.11 with SMTP id p11mr3539671ebb.175.1215474707470; Mon, 07 Jul 2008 16:51:47 -0700 (PDT) Received: from orlando.local ( [85.240.79.143]) by mx.google.com with ESMTPS id z40sm7477557ikz.7.2008.07.07.16.51.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Jul 2008 16:51:46 -0700 (PDT) To: Daniel Jacobowitz Subject: Re: [gdbserver] Fix attaching notices Date: Mon, 07 Jul 2008 23:52:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sourceware.org References: <200806280011.12868.pedro@codesourcery.com> <20080707175510.GB1778@caradoc.them.org> In-Reply-To: <20080707175510.GB1778@caradoc.them.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_SwqcIa282k7fYp3" Message-Id: <200807080051.46088.pedro@codesourcery.com> From: Pedro Alves X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00103.txt.bz2 --Boundary-00=_SwqcIa282k7fYp3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1150 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 --Boundary-00=_SwqcIa282k7fYp3 Content-Type: text/x-diff; charset="iso-8859-1"; name="stopped_due_to_library_event.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stopped_due_to_library_event.diff" Content-length: 934 2008-07-07 Pedro Alves * 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; } --Boundary-00=_SwqcIa282k7fYp3--