aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/x86-linux-nat.c')
-rw-r--r--gdb/x86-linux-nat.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 46bb6a4..75f68de 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -216,14 +216,17 @@ static struct btrace_target_info *
x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
const struct btrace_config *conf)
{
- struct btrace_target_info *tinfo;
-
- errno = 0;
- tinfo = linux_enable_btrace (ptid, conf);
-
- if (tinfo == NULL)
- error (_("Could not enable branch tracing for %s: %s."),
- target_pid_to_str (ptid), safe_strerror (errno));
+ struct btrace_target_info *tinfo = nullptr;
+ TRY
+ {
+ tinfo = linux_enable_btrace (ptid, conf);
+ }
+ CATCH (exception, RETURN_MASK_ERROR)
+ {
+ error (_("Could not enable branch tracing for %s: %s"),
+ target_pid_to_str (ptid), exception.message);
+ }
+ END_CATCH
return tinfo;
}