aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-catch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi/mi-cmd-catch.c')
-rw-r--r--gdb/mi/mi-cmd-catch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/mi/mi-cmd-catch.c b/gdb/mi/mi-cmd-catch.c
index 23e30d0..bcfc1ba 100644
--- a/gdb/mi/mi-cmd-catch.c
+++ b/gdb/mi/mi-cmd-catch.c
@@ -81,6 +81,10 @@ mi_cmd_catch_assert (char *cmd, char *argv[], int argc)
error (_("Invalid argument: %s"), argv[oind]);
setup_breakpoint_reporting ();
+ /* create_ada_exception_catchpoint needs CONDITION to be xstrdup'ed,
+ and will assume control of its lifetime. */
+ if (condition != NULL)
+ condition = xstrdup (condition);
create_ada_exception_catchpoint (gdbarch, ada_catch_assert,
NULL, condition, temp, enabled, 0);
}
@@ -154,6 +158,12 @@ mi_cmd_catch_exception (char *cmd, char *argv[], int argc)
error (_("\"-e\" and \"-u\" are mutually exclusive"));
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);