From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17228 invoked by alias); 1 Mar 2016 17:00:47 -0000 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 Received: (qmail 17174 invoked by uid 89); 1 Mar 2016 17:00:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 01 Mar 2016 17:00:45 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id E3.EE.32102.F9AC5D65; Tue, 1 Mar 2016 18:00:15 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Tue, 1 Mar 2016 12:00:42 -0500 Subject: Re: [PATCH 1/2] Fix PR gdb/19676: Disable displaced stepping if /proc not mounted To: Pedro Alves , References: <1456850713-5745-1-git-send-email-palves@redhat.com> <1456850713-5745-2-git-send-email-palves@redhat.com> From: Simon Marchi Message-ID: <56D5CABA.9030704@ericsson.com> Date: Tue, 01 Mar 2016 17:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1456850713-5745-2-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00015.txt.bz2 On 16-03-01 11:45 AM, Pedro Alves wrote: > On GNU/Linux archs that support displaced stepping, if /proc is not > mounted, GDB gets stuck not able to step past breakpoints: > > (gdb) c > Continuing. > dl_main (phdr=, phnum=, user_entry=, auxv=) at rtld.c:2163 > 2163 LIBC_PROBE (init_complete, 2, LM_ID_BASE, r); > Cannot find AT_ENTRY auxiliary vector entry. > (gdb) c > Continuing. > dl_main (phdr=, phnum=, user_entry=, auxv=) at rtld.c:2163 > 2163 LIBC_PROBE (init_complete, 2, LM_ID_BASE, r); > Cannot find AT_ENTRY auxiliary vector entry. > (gdb) > > That's because GDB can't figure out where the scratch pad is. > > This is a regression introduced by the earlier changes to make the > Linux native target always work in non-stop mode. > > This commit makes GDB detect the case and fallback to stepping over > breakpoints in-line. > > gdb/ChangeLog: > 2016-03-01 Pedro Alves > > PR gdb/19676 > * infrun.c (displaced_step_prepare): Also disable displaced > stepping on NOT_SUPPORTED_ERROR. > * linux-tdep.c (linux_displaced_step_location): If reading auxv > fails, throw NOT_SUPPORTED_ERROR instead of generic error. > --- > gdb/infrun.c | 3 ++- > gdb/linux-tdep.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gdb/infrun.c b/gdb/infrun.c > index 3e8c9e0..696105d 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -1894,7 +1894,8 @@ displaced_step_prepare (ptid_t ptid) > { > struct displaced_step_inferior_state *displaced_state; > > - if (ex.error != MEMORY_ERROR) > + if (ex.error != MEMORY_ERROR > + && ex.error != NOT_SUPPORTED_ERROR) > throw_exception (ex); > > if (debug_infrun) > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 555c302..f197aa7 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -2426,7 +2426,8 @@ linux_displaced_step_location (struct gdbarch *gdbarch) > location. The auxiliary vector gets us the PowerPC-side entry > point address instead. */ > if (target_auxv_search (¤t_target, AT_ENTRY, &addr) <= 0) > - error (_("Cannot find AT_ENTRY auxiliary vector entry.")); > + throw_error (NOT_SUPPORTED_ERROR, > + _("Cannot find AT_ENTRY auxiliary vector entry.")); > > /* Make certain that the address points at real code, and not a > function descriptor. */ > Whoa, I didn't even know you could run without proc. You would probably have seen it anyway, but the email address in your ChangeLog entries has a local host name. Simon