aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/break-catch-throw.c37
-rw-r--r--gdb/probe.c3
3 files changed, 29 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1db0ee9..1f4e8e7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,11 @@
2014-03-20 Tom Tromey <tromey@redhat.com>
+ Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * probe.c (parse_probes): Turn assert into an ordinary error.
+ * break-catch-throw.c (re_set_exception_catchpoint): Ignore
+ exceptions when parsing probes. Rearrange the code for clarity.
+
+2014-03-20 Tom Tromey <tromey@redhat.com>
PR gdb/14135
* top.c (execute_command): Only dispatch events if the command
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index 7283490..9831d96 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -207,29 +207,32 @@ re_set_exception_catchpoint (struct breakpoint *self)
volatile struct gdb_exception e;
struct cleanup *cleanup;
enum exception_event_kind kind = classify_exception_breakpoint (self);
- int pass;
- for (pass = 0; sals.sals == NULL && pass < 2; ++pass)
+ /* We first try to use the probe interface. */
+ TRY_CATCH (e, RETURN_MASK_ERROR)
{
- TRY_CATCH (e, RETURN_MASK_ERROR)
+ char *spec = ASTRDUP (exception_functions[kind].probe);
+
+ sals = parse_probes (&spec, NULL);
+ }
+
+ if (e.reason < 0)
+ {
+ volatile struct gdb_exception ex;
+
+ /* Using the probe interface failed. Let's fallback to the normal
+ catchpoint mode. */
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
{
- char *spec;
-
- if (pass == 0)
- {
- spec = ASTRDUP (exception_functions[kind].probe);
- sals = parse_probes (&spec, NULL);
- }
- else
- {
- spec = ASTRDUP (exception_functions[kind].function);
- self->ops->decode_linespec (self, &spec, &sals);
- }
+ char *spec = ASTRDUP (exception_functions[kind].function);
+
+ self->ops->decode_linespec (self, &spec, &sals);
}
+
/* NOT_FOUND_ERROR just means the breakpoint will be pending, so
let it through. */
- if (e.reason < 0 && e.error != NOT_FOUND_ERROR)
- throw_exception (e);
+ if (ex.reason < 0 && ex.error != NOT_FOUND_ERROR)
+ throw_exception (ex);
}
cleanup = make_cleanup (xfree, sals.sals);
diff --git a/gdb/probe.c b/gdb/probe.c
index 623f65c..838d9f9 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -59,7 +59,8 @@ parse_probes (char **argptr, struct linespec_result *canonical)
cs = *argptr;
probe_ops = probe_linespec_to_ops (&cs);
- gdb_assert (probe_ops != NULL);
+ if (probe_ops == NULL)
+ error (_("'%s' is not a probe linespec"), arg_start);
arg = (char *) cs;
arg = skip_spaces (arg);