+2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be>
+ Tom Tromey <tromey@adacore.com>
+
+ * ada-lang.c (ada_exception_sal): Change addr_string to a
+ std::string.
+ (create_ada_exception_catchpoint): Update.
+
2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Tom Tromey <tromey@adacore.com>
static struct symtab_and_line
ada_exception_sal (enum ada_exception_catchpoint_kind ex,
- const char **addr_string, const struct breakpoint_ops **ops)
+ std::string *addr_string, const struct breakpoint_ops **ops)
{
const char *sym_name;
struct symbol *sym;
error (_("Unable to insert catchpoint. %s is not a function."), sym_name);
/* Set ADDR_STRING. */
- *addr_string = xstrdup (sym_name);
+ *addr_string = sym_name;
/* Set OPS. */
*ops = ada_exception_breakpoint_ops (ex);
int disabled,
int from_tty)
{
- const char *addr_string = NULL;
+ std::string addr_string;
const struct breakpoint_ops *ops = NULL;
struct symtab_and_line sal = ada_exception_sal (ex_kind, &addr_string, &ops);
std::unique_ptr<ada_catchpoint> c (new ada_catchpoint ());
- init_ada_exception_breakpoint (c.get (), gdbarch, sal, addr_string,
+ init_ada_exception_breakpoint (c.get (), gdbarch, sal, addr_string.c_str (),
ops, tempflag, disabled, from_tty);
c->excep_string = excep_string;
create_excep_cond_exprs (c.get (), ex_kind);