Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Change ada_catchpoint::excep_string to be a std::string
Date: Mon, 21 May 2018 01:12:00 -0000	[thread overview]
Message-ID: <f9d45c1b-4738-2220-6690-8b80ae10da98@simark.ca> (raw)
In-Reply-To: <20180519160606.19969-4-tom@tromey.com>

On 2018-05-19 12:06 PM, Tom Tromey wrote:
> This changes ada_catchpoint::excep_string to be a std::string and then
> fixes up all t he users.
> 
> This found a memory leak in catch_ada_exception_command_split, where
> "cond" was copied but never freed.
> 
> I changed the type of the "cond_string" argument to
> catch_ada_exception_command_split to follow the rule that out
> parameters should be pointers and not references.

It wasn't a rule yet (AFAIK), but it is now.

https://sourceware.org/ml/gdb-patches/2018-05/msg00450.html

The patch LGTM, with some nits.

> 
> This patch enables the removal of some cleanups and also the function
> ada_get_next_arg.

You can remove the ada_catchpoint destructor I think.

> @@ -13333,13 +13286,11 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex, char *excep_string,
>  
>     EX_KIND is the kind of exception catchpoint to be created.
>  
> -   If EXCEPT_STRING is NULL, this catchpoint is expected to trigger
> +   If EXCEPT_STRING is empty, this catchpoint is expected to trigger
>     for all exceptions.  Otherwise, EXCEPT_STRING indicates the name
> -   of the exception to which this catchpoint applies.  When not NULL,
> -   the string must be allocated on the heap, and its deallocation
> -   is no longer the responsibility of the caller.
> +   of the exception to which this catchpoint applies.
>  
> -   COND_STRING, if not NULL, is the catchpoint condition.  This string
> +   COND_STRING, if not empty, is the catchpoint condition.  This string
>     must be allocated on the heap, and its deallocation is no longer
>     the responsibility of the caller.

The last part of this paragraph is probably no longer valid.

Simon


  reply	other threads:[~2018-05-21  0:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19 20:37 [RFA 0/3] More Ada cleanup removal Tom Tromey
2018-05-19 16:06 ` [RFA 2/3] Remove cleanup from ada_collect_symbol_completion_matches Tom Tromey
2018-05-21  0:09   ` Simon Marchi
2018-05-19 16:06 ` [RFA 3/3] Change ada_catchpoint::excep_string to be a std::string Tom Tromey
2018-05-21  1:12   ` Simon Marchi [this message]
2018-05-22 14:49     ` [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning Joel Brobecker
2018-05-22 14:50       ` [pushed/Ada] fix "stale cleanup" internal-warning when using "catch assert" command Joel Brobecker
2018-05-22 14:58       ` [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning Tom Tromey
2018-05-22 15:48         ` Joel Brobecker
2018-05-19 20:37 ` [RFA 1/3] Remove cleanup from ada-lang.c Tom Tromey
2018-05-21  0:06   ` 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=f9d45c1b-4738-2220-6690-8b80ae10da98@simark.ca \
    --to=simark@simark.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