From 5c31b35808e467d39d05ffa95428e22bb10fd72d Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 26 Aug 2019 19:24:59 +0200 Subject: [gdb, c++] Improve error message when using libstdcxx without SDT probes When using catch catch/rethrow/catch, a libstdcxx with SDT probes is required for both the regexp argument, and the convenience variable $_exception ( https://sourceware.org/gdb/current/onlinedocs/gdb/Set-Catchpoints.html ). Currently, when using these features with a libstdcxx without SDT probes, we get the cryptic error message: ... not stopped at a C++ exception catchpoint ... Improve this by instead emitting the more helpful: ... did not find exception probe (does libstdcxx have SDT probes?) ... Tested on x86_64-linux. gdb/ChangeLog: 2019-08-26 Tom de Vries PR c++/24852 * break-catch-throw.c (fetch_probe_arguments): Improve error mesage when pc_probe.prob == NULL. gdb/testsuite/ChangeLog: 2019-08-26 Tom de Vries PR c++/24852 * gdb.cp/no-libstdcxx-probe.exp: New test. --- gdb/break-catch-throw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gdb/break-catch-throw.c') diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 0677a55..2d91285 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -106,8 +106,10 @@ fetch_probe_arguments (struct value **arg0, struct value **arg1) unsigned n_args; pc_probe = find_probe_by_pc (pc); - if (pc_probe.prob == NULL - || pc_probe.prob->get_provider () != "libstdcxx" + if (pc_probe.prob == NULL) + error (_("did not find exception probe (does libstdcxx have SDT probes?)")); + + if (pc_probe.prob->get_provider () != "libstdcxx" || (pc_probe.prob->get_name () != "catch" && pc_probe.prob->get_name () != "throw" && pc_probe.prob->get_name () != "rethrow")) -- cgit v1.1