diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 11667aecfd1..37f505d00b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2019-02-15 Philippe Waroquiers + Tom Tromey + + * ada-lang.c (ada_exception_sal): Change addr_string to a + std::string. + (create_ada_exception_catchpoint): Update. + 2019-02-15 Philippe Waroquiers Tom Tromey diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 602facb35e7..c775b09b89e 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13176,7 +13176,7 @@ ada_exception_catchpoint_cond_string (const char *excep_string, 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; @@ -13196,7 +13196,7 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex, 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); @@ -13228,12 +13228,12 @@ create_ada_exception_catchpoint (struct gdbarch *gdbarch, 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 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);