Re: [RFAv2] Show locno for 'multi location' breakpoint hit msg+conv var $bkptno $locno.

Philippe Waroquiers via Gdb-patches
2022-06-05T19:44:50Z

On Sun, 2022-06-05 at 22:26 +0300, Eli Zaretskii wrote:
> > From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > Cc: gdb-patches@sourceware.org
> > Date: Sun, 05 Jun 2022 21:09:36 +0200
> >
> > > > +For a @samp{breakpoint-hit} stopped reason, when the breakpoint
> > > > +encountered has multiple locations, the field @samp{bkptno} is
> > > > +followed by the field @samp{locno}.
> > >
> > > This is a backward-incompatible change, no? Does it require bumping
> > > the version of the MI protocol?
> > The documentation indicates that adding a new field in the mi output
> > can be done without changing the MI version.
> > I have indicated the below in the commit log:
> >    Note that according to the GDB user manual node 'GDB/MI Development and Front
> >    Ends', it is ok to add new fields without changing the MI version.
>
> Does "M-x gdb" in Emacs still work correctly after this change,
> including the display in the breakpoints buffer?
I do not see behavior changes between GDB master and GDB with this patch.
But the display of multiple code locations in the breakpoint buffer
seems to not work properly, for both the non modified master
and the gdb with this patch.

To test, I have started
emacs -Q # emacs 27.1
M-x gdb
/absolute/path/to/gdb --nh -i=mi ~/gdb/littleprogs/zeoes
b some_func # this adds a breakpoint with 2 code locations
M-x gdb-many-windows

And the breakpoint window shows:
Num Type Disp Enb Addr Hits What
1 breakpoint keep y <MULTIPLE> 1 in unknown

Note that I have the same behavior with GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git

When I create a breakpoint with one code location, this breakpoint is properly shown:
Disp Enb Addr Hits What
1 breakpoint keep y <MULTIPLE> 1 in unknown
2 breakpoint keep y 0x00005555555551c6 0 in main of zeoes.c:24

So, I am not too sure what emacs gdb mode is supposed to do with such multiple
code locations breakpoints.

Philippe