From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec213.isp.belgacom.be (mailsec213.isp.belgacom.be [195.238.22.109]) by sourceware.org (Postfix) with ESMTPS id AC6713858C52 for ; Sun, 17 Apr 2022 16:27:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC6713858C52 X-ExtLoop: 1 X-IPAS-Result: =?us-ascii?q?A2BTAQDSPlxi/yFRiNkNTYEJCYZNhFSRFwOeZwsBAQEBA?= =?us-ascii?q?QEBAQEJQwQBAYUDAoR/JjgTAQIEAQEBAQMCAwEBAQEBAQMBAQYBAQEBAQEGB?= =?us-ascii?q?AGBG4UvgnspAYNjAQEBAQIBIw8BRhAJAhQBAwICJgICVwYTGoVgkXWbF3qBM?= =?us-ascii?q?YEBhGyDK4FlgREshzqDDIQRN4FVRIEVgTyBbj6IG4JlBJsxSkMZgUMKTA0OA?= =?us-ascii?q?VuSP60OfDQHg0yBPAYMnjMzg3SMOQOYI5ZepxWBeIF+bVOCaVEojleOG3M4A?= =?us-ascii?q?gYBCgEBAwmMXgEB?= IronPort-PHdr: A9a23:Taqr0x/yzRsu2v9uWa28ngc9DxPPW53KNwIYoqAql6hJOvz6uci4Z gqGtKQm1QeTFazgqNt8w9LMtK7hXWFSqb2gi1slNKJ2ahkelM8NlBYhCsPWQWfyLfrtcjBoV J8aDAwt8H60K1VaF9jjbFPOvHKy8SQSGhLiPgZpO+j5AIHfg9qp2+yo5pHeZwFFiDWgbb9uM hm9sBncuNQRjYZ+MKg61wHHomFPe+RYxGNoIUyckhPh7cqu/5Bt7jpdtes5+8FPTav1caI4T adFDDs9KGA6+NfrtRjYQgSR4HYXT3gbnQBJAwjB6xH6Q4vxvy7nvedzxCWWIcv7Rq0vVD+88 6lkVgPniCYfNz447m7XjNBwjLlGqx6lvhBz3pLYbJ2QOPd4Y6jTf84VRXBZU8hSSiJPAp2yY YUNAOoPIelXoYbyqVQVoBuiBgShHv/jxiNSi3L026AxzuQvERv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c+EH170U46xLZg6mJVqYHR7z2l6 IuaT/L3ZQfNNw5cagr4PIra9XuDFNyr0N8plgRWicJj5TcypFFJZH4rHpxdGlOjKmVi8kFWc M6YpF2x1juxEx7AkbpJmJ6jGqEBaua60QRjFhO6VoD66iWuqBDe3Y45NfMESVhllQ7VltIg4 tlI75bhSwsAa/ikdOQ1C3G0EglNZPwcvuaZcT7m95XC+iUqcVO2mqooVRpoe91BvL0saY1N3 aVwxDQldhCCg+Ou2L/9VeB2gd0+LcTxJ6sEuWBmwC2fB/tOrZXrGf6XvYUDhGpYasZmNsvwe cknODZWbC/GTDBQFXNOWKIwk7L97pX4W3gCwL6PnoI652nB5AN3zf7qKtW9UtOGT4BNl1qTp m/d13/+HwsROcOW0zfD9Wij7tIjhgugA8RCTfjhraAv2gTMgGUfExlTWUq95/iikgi0VtZQI kcT/2wkoMDe6XCWczU0ZDXgyFbsg/LWc4A4/zESgO1G9kYYD8t1yITJov6tpeHKbPMLeAE= IronPort-HdrOrdr: A9a23:kg/DIqDur+NfKC7lHemd55DYdb4zR+YMi2TDsHofdfU1SKKlfq WV98jzuiWE7Qr5NEtApTniAsW9qA3nhP1ICOAqVN/JMTUO01HJEGgN1/qF/xTQXwH46+5Bxe NBXsFFeaTN5IFB/KLHCd+DYrEdKPLrytHLudvj X-IronPort-Anti-Spam-Filtered: true Received: from 33.81-136-217.adsl-dyn.isp.belgacom.be (HELO [192.168.1.19]) ([217.136.81.33]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2022 18:27:54 +0200 Message-ID: Subject: Re: [RFA] Show locno for 'multi location' breakpoint hit msg+conv var $bkptno $locno. From: Philippe Waroquiers To: Eli Zaretskii Cc: gdb-patches@sourceware.org Date: Sun, 17 Apr 2022 18:27:54 +0200 In-Reply-To: <83h76ry9eo.fsf@gnu.org> References: <20220417155311.3487509-1-philippe.waroquiers@skynet.be> <83h76ry9eo.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2022 16:27:57 -0000 Thanks for the feedback. I will handle your comments for the RFA v2. One question below. Philippe On Sun, 2022-04-17 at 19:14 +0300, Eli Zaretskii wrote: > > Date: Sun, 17 Apr 2022 17:53:11 +0200 > > From: Philippe Waroquiers via Gdb-patches > > > > Before this patch, when a breakpoint that has multiple locations is reached, > > GDB printed: > >   Thread 1 "zeoes" hit Breakpoint 1, some_func () at somefunc1.c:5 > > > > This patch changes the message so that bkpt_print_id prints the precise > > encountered breakpoint: > >   Thread 1 "zeoes" hit Breakpoint 1.2, some_func () at somefunc1.c:5 > > > > In mi mode, bkpt_print_id also (optionally) prints a new table field "locno": > >   locno is printed when the breakpoint has more than one location. > > 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. > > Thanks. I think this should be an optional feature. Not everyone is > interested in the particular location that breaks. Having to disable > the breakpoints by locations is definitely an annoyance. For the GDB CLI, when the above message is displayed,  the user can decide to type disable 1 or disable 1.2 or can define aliases such as alias bdisable = disable $bkptno alias ldisable = disable $bkptno.$locno to disable the complete breakpoint or only the specific location. I might submit a later patch to define the above aliases by default, so that disabling the last breakpoint or location will imply only to type 'bd' or 'ld'. Similarly, a front end using MI will (by default) just skip the new locno field. So, I am not sure to understand what is the annoyance. > > > diff --git a/gdb/NEWS b/gdb/NEWS > > index 760cb2b7abc..673607dfbb3 100644 > > --- a/gdb/NEWS > > +++ b/gdb/NEWS > > @@ -14,6 +14,20 @@ > >    emit to indicate where a breakpoint should be placed to break in a function > >    past its prologue. > >   > > +* When a breakpoint with multiple locations is hit, GDB now also prints the location > > + using the syntax . such as in: > > + Thread 1 "zeoes" hit Breakpoint 2.3, some_func () at zeoes.c:8 > > + > > +* When a breakpoint is hit, GDB now sets the convenience variables $bkpno and > > + $locno to the hit breakpoint number and location number. > > + This allows to disable the last hit breakpoint using for example > > + (gdb) disable $bkptno > > + or > > + (gdb) disable $bkptno.$locno > > + These commands can be used inside the command list of a breakpoint to > > + automatically disable the just encountered breakpoint (or breakpoint > > + specific location). > > + > >  * New commands > > [...] > > +* MI changes > > + > > + ** The 'breakpoint-hit' stopped reason async record now contains an optional field > > + locno giving the location number when the breakpoint has multiple locations. > > + > > This part is OK. > > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > > index c1e9b09e833..8408928648e 100644 > > --- a/gdb/doc/gdb.texinfo > > +++ b/gdb/doc/gdb.texinfo > > @@ -4338,9 +4338,15 @@ are operated on. > >  @cindex latest breakpoint > >  Breakpoints are set with the @code{break} command (abbreviated > >  @code{b}). The debugger convenience variable @samp{$bpnum} records the > > -number of the breakpoint you've set most recently; see @ref{Convenience > > -Vars,, Convenience Variables}, for a discussion of what you can do with > > -convenience variables. > > +number of the breakpoint you've set most recently. > > +A breakpoint may be mapped to multiple locations for example with > > +inlined functions, Ada generics, c++ templates or overloaded function names. >                                     ^^^ > I believe we use "C@t{++}" markup for C++ language in the manual. > > > +When your program stops on a breakpoint, the convenience variables > > +@samp{$bpkpno} and @samp{$locno} are respectively set to the number of > > +the encountered breakpoint and the number of the breakpoint location. > > Please add here index entries for these two variables. > > > +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}. > > How about an example here? > > Thanks.