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.
+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.
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
}
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
}
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
}