This is the mail archive of the
mailing list for the GDB project.
Re: [PROTOTYPE] Make "info breakpoints" show breakpoint's specs (Re: [PATCH] gdb: Don't skip prologue for explicit line breakpoints in assembler)
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: Kevin Buettner <kevinb at redhat dot com>, gdb-patches at sourceware dot org
- Date: Wed, 3 Jul 2019 23:37:54 +0100
- Subject: Re: [PROTOTYPE] Make "info breakpoints" show breakpoint's specs (Re: [PATCH] gdb: Don't skip prologue for explicit line breakpoints in assembler)
- References: <firstname.lastname@example.org> <email@example.com> <20190620205759.GI23204@embecosm.com> <20190620232314.GJ23204@embecosm.com> <firstname.lastname@example.org> <20190622110558.GK23204@embecosm.com> <20190622112333.GL23204@embecosm.com> <email@example.com> <firstname.lastname@example.org>
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 <MULTIPLE>
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.