From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109718 invoked by alias); 3 Jul 2019 22:37:59 -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 109709 invoked by uid 89); 3 Jul 2019 22:37:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*f:sk:406d910 X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Jul 2019 22:37:58 +0000 Received: by mail-wr1-f68.google.com with SMTP id n4so4529732wrs.3 for ; Wed, 03 Jul 2019 15:37:57 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id w20sm8953042wra.96.2019.07.03.15.37.54 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jul 2019 15:37:55 -0700 (PDT) Subject: Re: [PROTOTYPE] Make "info breakpoints" show breakpoint's specs (Re: [PATCH] gdb: Don't skip prologue for explicit line breakpoints in assembler) To: Andrew Burgess References: <20190612123403.14348-1-andrew.burgess@embecosm.com> <20190619181147.69974f43@f29-4.lan> <20190620205759.GI23204@embecosm.com> <20190620232314.GJ23204@embecosm.com> <406d910b-8b63-1e93-d340-7e9ab841ad0b@redhat.com> <20190622110558.GK23204@embecosm.com> <20190622112333.GL23204@embecosm.com> <1a421f8d-069b-fbd6-4a56-2464dd3e5a15@redhat.com> <85fe230e-ab67-0552-fe71-81f9f3762dd2@redhat.com> Cc: Kevin Buettner , gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Wed, 03 Jul 2019 22:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <85fe230e-ab67-0552-fe71-81f9f3762dd2@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-07/txt/msg00078.txt.bz2 On 6/24/19 8:54 PM, Pedro Alves wrote: > I did notice that the patch currently crashes with catchpoints that > are implemented via breakpoints, for example, and possibly > other types: > > (top-gdb) catch throw > Catchpoint 5 (throw) > (top-gdb) info breakpoints > 5 breakpoint keep y ../../gdb/breakpoint.c:6387: internal-error: void print_one_breakpoint_location(breakpoint*, bp_location*, int, bp_location**, int): Assertion `b->loc == NULL || b->loc->next == NULL' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > > whoops. :-) I did say this was a prototype, right? :-) Actually, turns out this is a preexisting problem. GDB is not expecting to find more than one location for a catchpoint backed by breakpoints. But it is now finding two locations. The breakpoint is set at "__cxa_begin_catch", and if we do that manually, we see what are those locations: (top-gdb) b __cxa_begin_catch Breakpoint 5 at 0xb126c0 (2 locations) (top-gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 1.1 y 0x0000000000b126c0 <__cxa_begin_catch> 1.2 y 0x00007ffff2f4ddb0 in __cxxabiv1::__cxa_begin_catch(void*) at ../../../../libstdc++-v3/libsupc++/eh_catch.cc:41 Looks like a regression caused by the -qualified stuff. I guess we want a breakpoint at <__cxa_begin_catch> only. Should be easy to fix. But I also suggest that "info breakpoints" shouldn't be showing any address for "catch catch" breakpoints (and catch throw, etc.). It's an implementation detail that these catchpoints are implemented as magic breakpoints. Thanks, Pedro Alves