diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2020-12-04 10:29:06 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2020-12-21 09:00:28 +0100 |
commit | 0fe69a94d4c4793d7247442e0611e5d3b8f542f5 (patch) | |
tree | b449a9c7c20dddeb8ea461bd66b6c1155bcdc9fb /gdb/testsuite | |
parent | 806e7575e232f854ce7fc88c2a55c63265d57e5e (diff) | |
download | gdb-0fe69a94d4c4793d7247442e0611e5d3b8f542f5.zip gdb-0fe69a94d4c4793d7247442e0611e5d3b8f542f5.tar.gz gdb-0fe69a94d4c4793d7247442e0611e5d3b8f542f5.tar.bz2 |
testsuite, gdb.btrace: fix 32-bit PIE false positives
For 32-bit position independent executables, GCC generates an extra call to
__x86.get_pc_thunk.<reg>
which appears in the function call history. It is correct to appear there
but this confuses the tests, which check for an expected sequence of
functions.
Build with nopie to avoid this complication.
gdb/testsuite/ChangeLog:
2020-12-04 Markus Metzger <markus.t.metzger@intel.com>
* gdb.btrace/exception.exp: Build with nopie.
* gdb.btrace/function_call_history.exp: Likewise.
* gdb.btrace/unknown_functions.exp: Likewise.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rwxr-xr-x | gdb/testsuite/gdb.btrace/exception.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.btrace/function_call_history.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.btrace/unknown_functions.exp | 9 |
4 files changed, 19 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4a6d48e..2c0633d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2020-12-21 Markus Metzger <markus.t.metzger@intel.com> + * gdb.btrace/exception.exp: Build with nopie. + * gdb.btrace/function_call_history.exp: Likewise. + * gdb.btrace/unknown_functions.exp: Likewise. + +2020-12-21 Markus Metzger <markus.t.metzger@intel.com> + * gdb.btrace/multi-inferior.exp: Skip if use_gdb_stub. 2020-12-21 Markus Metzger <markus.t.metzger@intel.com> diff --git a/gdb/testsuite/gdb.btrace/exception.exp b/gdb/testsuite/gdb.btrace/exception.exp index 0d24222..dc1a68c 100755 --- a/gdb/testsuite/gdb.btrace/exception.exp +++ b/gdb/testsuite/gdb.btrace/exception.exp @@ -22,8 +22,11 @@ if { [skip_btrace_tests] } { return -1 } +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. standard_testfile exception.cc -if [prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}] { +if [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {nopie c++ debug}] { return -1 } diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp index 51536ff..871d37b 100644 --- a/gdb/testsuite/gdb.btrace/function_call_history.exp +++ b/gdb/testsuite/gdb.btrace/function_call_history.exp @@ -22,8 +22,10 @@ if { [skip_btrace_tests] } { return -1 } +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. standard_testfile -if [prepare_for_testing "failed to prepare" $testfile {} {debug}] { +if [prepare_for_testing "failed to prepare" $testfile {} {nopie debug}] { return -1 } diff --git a/gdb/testsuite/gdb.btrace/unknown_functions.exp b/gdb/testsuite/gdb.btrace/unknown_functions.exp index 4db9c70..beb1aca 100644 --- a/gdb/testsuite/gdb.btrace/unknown_functions.exp +++ b/gdb/testsuite/gdb.btrace/unknown_functions.exp @@ -24,9 +24,12 @@ if { [skip_btrace_tests] } { standard_testfile -# discard local symbols -set ldflags "additional_flags=-Wl,-x" -if [prepare_for_testing "failed to prepare" $testfile $srcfile $ldflags] { +# We expect a specific function call history. This gets messed up with +# PIE on 32-bit. +# +# Also discard local symbols. +if [prepare_for_testing "failed to prepare" $testfile $srcfile \ + {additional_flags=-Wl,-x nopie}] { return -1 } |