Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 01/14] Introduce event_location_up
Date: Mon, 10 Apr 2017 01:33:00 -0000	[thread overview]
Message-ID: <a33eb1328d53fc8a64a1d7f802ab6e24@polymtl.ca> (raw)
In-Reply-To: <20170408201208.2672-2-tom@tromey.com>

On 2017-04-08 16:11, Tom Tromey wrote:
> This removes make_cleanup_delete_event_location and instead changes
> the various location functions to return an event_location_up, a new
> unique_ptr typedef.

Thanks for doing this, the patch looks good to me.  Two suggestions 
below.

> This is largely straightforward, but be sure to examine the
> init_breakpoint_sal change.  I believe the code I deleted there is
> dead, because "location != NULL" can never be true in that branch; but
> you should double-check.

It looks correct.

> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 3925ec6..f3834d5 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -3472,7 +3472,7 @@ create_overlay_event_breakpoint (void)
>  				      &internal_breakpoint_ops);
>        initialize_explicit_location (&explicit_loc);
>        explicit_loc.function_name = ASTRDUP (func_name);
> -      b->location = new_explicit_location (&explicit_loc);
> +      b->location = new_explicit_location (&explicit_loc).release ();

Since the breakpoint structure is new'ed and delete'd, you can also 
change breakpoint's location field to be an event_location_up, instead 
of doing a (bunch of) release.  I think you could do the same with the 
location field in linespec_result as well, since that structure is only 
allocated statically (and therefore its defaults ctor/dtor are called).

> @@ -15278,7 +15241,7 @@ static void
>  strace_command (char *arg, int from_tty)
>  {
>    struct breakpoint_ops *ops;
> -  struct event_location *location;
> +  event_location_up location;
>    struct cleanup *back_to;
> 
>    /* Decide if we are dealing with a static tracepoint marker (`-m'),
> @@ -15294,9 +15257,9 @@ strace_command (char *arg, int from_tty)
>        location = string_to_event_location (&arg, current_language);
>      }
> 
> -  back_to = make_cleanup_delete_event_location (location);
> +

You can delete the extra line here.

Thanks,

Simon


  reply	other threads:[~2017-04-10  1:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 20:12 [RFA 00/14] miscellaneous C++-ificiation Tom Tromey
2017-04-08 20:12 ` [RFA 09/14] Remove some cleanups from location.c Tom Tromey
2017-04-10  4:43   ` Simon Marchi
2017-04-08 20:12 ` [RFA 10/14] C++ify mi_parse Tom Tromey
2017-04-11  1:12   ` Simon Marchi
2017-04-08 20:12 ` [RFA 03/14] Change find_pcs_for_symtab_line to return a std::vector Tom Tromey
2017-04-10  2:49   ` Simon Marchi
2017-04-08 20:12 ` [RFA 02/14] Introduce command_line_up Tom Tromey
2017-04-10  2:36   ` Simon Marchi
2017-04-10 23:21     ` Tom Tromey
2017-04-08 20:12 ` [RFA 14/14] Use std::vector in compile-loc2c.c Tom Tromey
2017-04-08 20:12 ` [RFA 08/14] Remove some cleanups from gnu-v3-abi.c Tom Tromey
2017-04-10  4:09   ` Simon Marchi
2017-04-10 13:57     ` Tom Tromey
2017-04-08 20:12 ` [RFA 11/14] Use scoped_restore in more places Tom Tromey
2017-04-11  1:48   ` Simon Marchi
2017-04-08 20:12 ` [RFA 06/14] Remove cleanup_iconv Tom Tromey
2017-04-10  3:56   ` Simon Marchi
2017-04-10 23:20     ` Tom Tromey
2017-04-08 20:12 ` [RFA 01/14] Introduce event_location_up Tom Tromey
2017-04-10  1:33   ` Simon Marchi [this message]
2017-04-10 23:19     ` Tom Tromey
2017-04-08 20:13 ` [RFA 04/14] Introduce gdb_dlopen_up Tom Tromey
2017-04-10  3:13   ` Simon Marchi
2017-04-10  9:26   ` Pedro Alves
2017-04-10 23:31     ` Tom Tromey
2017-04-08 20:13 ` [RFA 13/14] Use std::vector in find_instruction_backward Tom Tromey
2017-04-08 20:13 ` [RFA 12/14] Use std::vector in reread_symbols Tom Tromey
2017-04-11  1:59   ` Simon Marchi
2017-04-08 20:22 ` [RFA 07/14] Fix up wchar_iterator comment Tom Tromey
2017-04-10  4:05   ` Simon Marchi
2017-04-10 23:29     ` Tom Tromey
2017-04-08 20:23 ` [RFA 05/14] Change increment_reading_symtab to return a scoped_restore Tom Tromey
2017-04-10  3:27   ` 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=a33eb1328d53fc8a64a1d7f802ab6e24@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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