From c4e126313219ecde255a644a2c74008831edff5a Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Thu, 8 Feb 2018 14:35:44 +0100 Subject: [PATCH] btrace: reword error messages Reword some btrace error messages to align with the format discussed in https://sourceware.org/ml/gdb-patches/2018-02/msg00135.html. gdb/ * remote.c (remote_btrace_maybe_reopen): Change error message. * btrace.c (btrace_enable): Likewise. (parse_xml_btrace): Likewise. (parse_xml_btrace_conf): Likewise. testsuite/ * lib/gdb.exp (skip_btrace_pt_tests): Update expected error message. Fix test name. --- gdb/ChangeLog | 7 +++++++ gdb/btrace.c | 8 +++++--- gdb/remote.c | 4 ++-- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/gdb.exp | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd8a6249f82..f1d662fa15b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-02-09 Markus Metzger + + * remote.c (remote_btrace_maybe_reopen): Change error message. + * btrace.c (btrace_enable): Likewise. + (parse_xml_btrace): Likewise. + (parse_xml_btrace_conf): Likewise. + 2018-02-09 Markus Metzger * nat/linux-btrace.c (diagnose_perf_event_open_fail): New. diff --git a/gdb/btrace.c b/gdb/btrace.c index 2b031a4b6d0..158d03cbe07 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -1579,7 +1579,7 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf) #if !defined (HAVE_LIBIPT) if (conf->format == BTRACE_FORMAT_PT) - error (_("GDB does not support Intel Processor Trace.")); + error (_("Intel Processor Trace support was disabled at compile time.")); #endif /* !defined (HAVE_LIBIPT) */ DEBUG ("enable thread %s (%s)", print_thread_id (tp), @@ -2218,7 +2218,8 @@ parse_xml_btrace (struct btrace_data *btrace, const char *buffer) #else /* !defined (HAVE_LIBEXPAT) */ - error (_("Cannot process branch trace. XML parsing is not supported.")); + error (_("Cannot process branch trace. XML support was disabled at " + "compile time.")); #endif /* !defined (HAVE_LIBEXPAT) */ } @@ -2312,7 +2313,8 @@ parse_xml_btrace_conf (struct btrace_config *conf, const char *xml) #else /* !defined (HAVE_LIBEXPAT) */ - error (_("XML parsing is not supported.")); + error (_("Cannot process the branch trace configuration. XML support " + "was disabled at compile time.")); #endif /* !defined (HAVE_LIBEXPAT) */ } diff --git a/gdb/remote.c b/gdb/remote.c index e5680f02332..15d6c5bdbf1 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -13193,8 +13193,8 @@ remote_btrace_maybe_reopen (void) if (!warned) { warned = 1; - warning (_("GDB does not support Intel Processor Trace. " - "\"record\" will not work in this session.")); + warning (_("Target is recording using Intel Processor Trace " + "but support was disabled at compile time.")); } continue; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 18512b97245..1a4337cde62 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-09 Markus Metzger + + * lib/gdb.exp (skip_btrace_pt_tests): Update expected error message. + Fix test name. + 2018-02-07 Simon Marchi * gdb.cp/m-static.exp: Check type of optimized out static diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 7ee3a70fd2f..e90c4614032 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2955,7 +2955,7 @@ gdb_caching_proc skip_btrace_pt_tests { file delete $src # In case of an unexpected output, we return 2 as a fail value. set skip_btrace_tests 2 - gdb_test_multiple "record btrace pt" "check btrace support" { + gdb_test_multiple "record btrace pt" "check btrace pt support" { -re "You can't do that when your target is.*\r\n$gdb_prompt $" { set skip_btrace_tests 1 } @@ -2965,7 +2965,7 @@ gdb_caching_proc skip_btrace_pt_tests { -re "Could not enable branch tracing.*\r\n$gdb_prompt $" { set skip_btrace_tests 1 } - -re "GDB does not support.*\r\n$gdb_prompt $" { + -re "support was disabled at compile time.*\r\n$gdb_prompt $" { set skip_btrace_tests 1 } -re "^record btrace pt\r\n$gdb_prompt $" { -- 2.30.2