This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] (Ada) Add gdb-mi support for stopping at start of exception handler.
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Xavier Roirand <roirand at adacore dot com>, <gdb-patches at sourceware dot org>
- Cc: <brobecker at adacore dot com>
- Date: Wed, 3 Jan 2018 11:41:02 -0500
- Subject: Re: [RFA] (Ada) Add gdb-mi support for stopping at start of exception handler.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <1514977774-30677-1-git-send-email-roirand@adacore.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 2018-01-03 06:09 AM, Xavier Roirand wrote:
> + /* This command does not accept any argument. Make sure the user
> + did not provide any. */
> + if (oind != argc)
> + error (_("Invalid argument: %s"), argv[oind]);
> +
> + scoped_restore restore_breakpoint_reporting
> + = setup_breakpoint_reporting ();
> + /* create_ada_exception_catchpoint needs EXCEPTION_NAME and CONDITION
> + to be xstrdup'ed, and will assume control of their lifetime. */
> + if (exception_name != NULL)
> + exception_name = xstrdup (exception_name);
> + if (condition != NULL)
> + condition = xstrdup (condition);
> + create_ada_exception_catchpoint (gdbarch, ex_kind,
> + exception_name, condition,
> + temp, enabled, 0);
> +}
create_ada_exception_catchpoint claims that it takes ownership of the condition
string and will deallocate it, but I don't think that's true. It looks like a
memory leak to me. Could you take a look? Converting it to use std::string
or gdb::unique_xmalloc_ptr<char> instead would probably be the way to go eventually.
Simon