diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2015-11-19 14:33:41 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2015-11-26 11:24:28 +0100 |
commit | 46a3515b49ce30315e2b621525b29cd8263aed15 (patch) | |
tree | 9fa2e3ccedaf508636a36fad6a98733c202d55a4 /gdb/testsuite/lib | |
parent | 9a4db61fd538c0a0185367661a0ddacffff5d57a (diff) | |
download | gdb-46a3515b49ce30315e2b621525b29cd8263aed15.zip gdb-46a3515b49ce30315e2b621525b29cd8263aed15.tar.gz gdb-46a3515b49ce30315e2b621525b29cd8263aed15.tar.bz2 |
btrace: diagnose "record btrace pt" without libipt
If GDB has been configured without libipt support, i.e. HAVE_LIBIPT is
undefined, and is running on a system that supports Intel(R) Processor Trace,
GDB will run into an internal error when trying to decode the trace.
(gdb) record btrace
(gdb) s
usage (name=0x7fffffffe954 "fib-64")
at src/fib.c:12
12 fprintf(stderr, "usage: %s <num>\n", name);
(gdb) info record
Active record target: record-btrace
Recording format: Intel(R) Processor Trace.
Buffer size: 16kB.
gdb/btrace.c:971: internal-error: Unexpected branch trace format.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
This requires a system with Linux kernel 4.1 or later running on a 5th
Generation Intel Core processor or later.
The issue is documented as PR 19297.
When trying to enable branch tracing, in addition to checking the target
support for the requested branch tracing format, also check whether GDB
supports. it.
gdb/
* btrace.c (btrace_enable): Check whether HAVE_LIBIPT is defined.
testsuite/
* lib/gdb.exp (skip_btrace_pt_tests): Check for a "GDB does not
support" error.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a420181..90e8644 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2826,6 +2826,9 @@ 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 $" { + set skip_btrace_tests 1 + } -re "^record btrace pt\r\n$gdb_prompt $" { set skip_btrace_tests 0 } |