public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Xavier Roirand <roirand@adacore.com>, <gdb-patches@sourceware.org>
Cc: <brobecker@adacore.com>
Subject: Re: [RFA] (Ada) Add gdb-mi support for stopping at start of exception handler.
Date: Wed, 03 Jan 2018 16:41:00 -0000	[thread overview]
Message-ID: <5fc8d022-c0d4-3095-8e2f-b68aef579196@ericsson.com> (raw)
In-Reply-To: <1514977774-30677-1-git-send-email-roirand@adacore.com>

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

      parent reply	other threads:[~2018-01-03 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 11:09 Xavier Roirand
2018-01-03 16:30 ` Simon Marchi
2018-01-04  2:59   ` Joel Brobecker
2018-01-03 16:41 ` Simon Marchi [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=5fc8d022-c0d4-3095-8e2f-b68aef579196@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=roirand@adacore.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).