This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] (Ada) Add gdb-mi support for stopping at start of exception handler.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]