[gdb, c++] Improve error message when using libstdcxx without SDT probes
authorTom de Vries <tdevries@suse.de>
Mon, 26 Aug 2019 17:24:59 +0000 (19:24 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 26 Aug 2019 17:24:59 +0000 (19:24 +0200)
commit5c31b35808e467d39d05ffa95428e22bb10fd72d
treeec11fcba057c299a14f9711cca8ac5748497561c
parentb694989f508a83dd7c1f5d0d08716439d312e1cb
[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  <tdevries@suse.de>

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  <tdevries@suse.de>

PR c++/24852
* gdb.cp/no-libstdcxx-probe.exp: New test.
gdb/ChangeLog
gdb/break-catch-throw.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp [new file with mode: 0644]