Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: George Barrett <bob@bob131.so>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Fix scripted probe breakpoints
Date: Mon, 09 Dec 2019 21:37:00 -0000	[thread overview]
Message-ID: <a2980e3e-1d58-3fe3-8dd3-62b6c642cde1@simark.ca> (raw)
In-Reply-To: <gnmd5kmbvxo1_fu&9qbl8vh7shke4a&_pmietcvge3.1031yx5uw@mail.bob131.so>

On 2019-12-09 4:28 p.m., George Barrett wrote:
> The documentation for make-breakpoint from the Guile API and the `spec'
> variant of the gdb.Breakpoint constructor from the Python API state that
> the format acceptable for location strings is the same as that accepted
> by the break command. However, using the -probe qualifier at the
> beginning of the location string causes a GDB internal error as it
> attempts to decode a probe location in the wrong code path. Without this
> functionality, there doesn't appear to be another way to set breakpoints
> on probe points from Python or Guile scripts.
> 
> This patch introduces a new helper function that returns a
> breakpoint_ops instance appropriate for a parsed location and updates
> the Guile and Python bindings to use said function, rather than the
> current hard-coded use of bkpt_breakpoint_ops. Since this logic is
> duplicated in the handling of the `break' and `trace' commands, those
> are also updated to call into the new helper function.

Thanks, that LGTM.  I presume you don't have push access, so would you like
me to push the patch on your behalf?

I found some other really small nits, I'll fix them before pushing if I end up
pushing for you.

> +/* See breakpoint.h.  */
> +
> +const struct breakpoint_ops *
> +breakpoint_ops_for_event_location (const struct event_location *location,
> +				   bool is_tracepoint)
> +{
> +  if (location)

I missed this last time, but also in GNU style we compare pointers and integers explicitly,
so either one of these would be good:

  if (location != NULL)
  if (location != nullptr)

> diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
> index a9d689d02a..071ae79d68 100644
> --- a/gdb/breakpoint.h
> +++ b/gdb/breakpoint.h
> @@ -1352,6 +1352,15 @@ extern void init_catchpoint (struct breakpoint *b,
>  extern void install_breakpoint (int internal, std::unique_ptr<breakpoint> &&b,
>  				int update_gll);
>  
> +/* Returns the breakpoint ops appropriate for use with with LOCATION and
> +   according to IS_TRACEPOINT.  Use this to ensure, for example, that you pass
> +   the correct ops to create_breakpoint for probe locations.  If LOCATION is
> +   null, returns bkpt_breakpoint_ops (or tracepoint_breakpoint_ops, if

I would change null to NULL or nullptr to match the language nomenclature.

> +   IS_TRACEPOINT is non-zero).  */

non-zero -> true

Simon


  reply	other threads:[~2019-12-09 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 21:28 George Barrett
2019-12-09 21:37 ` Simon Marchi [this message]
2019-12-09 21:43   ` George Barrett
2019-12-09 21:54     ` Simon Marchi

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=a2980e3e-1d58-3fe3-8dd3-62b6c642cde1@simark.ca \
    --to=simark@simark.ca \
    --cc=bob@bob131.so \
    --cc=gdb-patches@sourceware.org \
    /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