public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Keith Seitz <keiths@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] Show locno for 'multi location' breakpoint hit msg+conv var $bkptno $locno.
Date: Sat, 04 Jun 2022 19:37:02 +0200	[thread overview]
Message-ID: <9aea098aad32c41c887aed717222b1f563ab7c72.camel@skynet.be> (raw)
In-Reply-To: <24da89de-d36f-53c7-fe69-a8c7a1c38caf@redhat.com>

On Fri, 2022-06-03 at 13:40 -0700, Keith Seitz wrote:
> I've really only got some pretty minor questions to ask and a nit or
> two to mention. Nothing serious.
Thanks for the review.
> > > > Also, when a breakpoint is reached, the convenience variables
> > > > $bkptno and $locno are set to the encountered breakpoint number
> > > > and location number.
> 
> We have convenience variables for when we set breakpoints ($bpnum)
> and tracepoints ($tpnum). Should we re-use those or would that lead
> to user confusion? AFAICT, we only use those variables when a
> {break,trace}point is created or modified. This seems like it could
> be a natural extension of the utility of those variables.
> 
> I am not asking for any changes, I'm genuinely curious if reusing
> these existing convenience vars would be desirable in your opinion.
The drawback of re-using $bpnum is that this might break the logic of 
some existing scripts/command sequences, e.g. in the following case:
   add a breakpoint (so setting $bpnum)
   do whatever so that another breakpoint is encountered
   do whatever with $bpnum e.g. delete it or disable it.

If in the second step, $bpnum is changed, then the third step will change of
behaviour: instead of deleting or disabling the last set breakpoint,
it will delete or disable the last encountered breakpoint.

> 
> > > > +static bool
> > > > +has_multiple_locations (int num)
> 
> At one time, we used to append "_p" to these types of predicate-
> style functions. Are we abandoning this practice? [Mind you,
> this is simply a meta-question. Again, I am not asking for
> any changes.]
It looks to me that we now have a mix of functions with or without _p.
Maybe the _p convention was invented when bool functions were in fact returning an int ?

> > > > +	{
> > > > +	  warning (_("location number not found for breakpoint %d address %p."),
> > > > +		   b->number, paddress (bl->gdbarch, bl->address));
> 
> Doesn't paddress require %s (or even nicer: %ps with a styled_string ())?
The other usages of paddress use %s, I will fix this.

> > > >   #
> > > > @@ -699,7 +708,13 @@ proc runto { linespec args } {
> > > >   	    }
> > > >   	    return 1
> > > >   	}
> > > > -	-re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" {
> > > > +	-re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" {
> > > > +	    if { $print_pass } {
> > > > +		pass $test_name
> > > > +	    }
> > > > +	    return 1
> > > > +	}
> > > > +	-re "Breakpoint \[0-9\]*\.\[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" {
> > > >   	    if { $print_pass } {
> > > >   		pass $test_name
> > > >   	    }
> 
> It doesn't seem that we make a distinction here between the "Breakpoint N" vs "Breakpoint N.M"
> cases. Is it possible to merge these two branches into one using bkptno_numopt_re?
> [super super minor nit]
Will look at this.

> 
> Thank you so much for your patience. I hope a global maintainer with approval
> authority will follow-up.
Thanks for the review, I will prepare an RFA v2 handling your comments and the comments of
Eli.

Philippe



      parent reply	other threads:[~2022-06-04 17:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-17 15:53 Philippe Waroquiers
2022-04-17 16:14 ` Eli Zaretskii
2022-04-17 16:27   ` Philippe Waroquiers
2022-04-17 17:55     ` Eli Zaretskii
2022-04-29 16:26 ` Philippe Waroquiers
2022-05-07  5:44   ` Philippe Waroquiers
2022-05-13 16:49   ` Philippe Waroquiers
2022-05-22 18:43   ` Philippe Waroquiers
2022-05-30 19:08   ` Philippe Waroquiers
2022-06-03 20:40     ` Keith Seitz
2022-06-04  6:23       ` Eli Zaretskii
2022-06-04 17:27         ` Matt Rice
2022-06-04 17:45           ` Philippe Waroquiers
2022-06-04 17:37       ` Philippe Waroquiers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aea098aad32c41c887aed717222b1f563ab7c72.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).