aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.btrace
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2020-12-15 16:18:34 +0100
committerMarkus Metzger <markus.t.metzger@intel.com>2021-03-03 09:16:45 +0100
commitd2c5f24eed249325d4883d6096b5dd3e8bc0ec00 (patch)
treee533c12ab3eb51e28cca27e1c43e18b15a06ac64 /gdb/testsuite/gdb.btrace
parentc7c7253a47891ff052b85708080a12d86e1720bc (diff)
downloadgdb-d2c5f24eed249325d4883d6096b5dd3e8bc0ec00.zip
gdb-d2c5f24eed249325d4883d6096b5dd3e8bc0ec00.tar.gz
gdb-d2c5f24eed249325d4883d6096b5dd3e8bc0ec00.tar.bz2
testsuite, gdb.btrace: adjust expected output to pass with clang
Clang generates slightly different debug information. Adjust the expected output of gdb.btrace/function_call_history.exp to work with both gcc and clang. Also modify gdb.btrace/exception.cc to reliably trace into main and update the corresponding patterns in gdb.btrace/exception.exp.
Diffstat (limited to 'gdb/testsuite/gdb.btrace')
-rw-r--r--gdb/testsuite/gdb.btrace/exception.cc6
-rwxr-xr-xgdb/testsuite/gdb.btrace/exception.exp26
-rw-r--r--gdb/testsuite/gdb.btrace/function_call_history.exp20
3 files changed, 31 insertions, 21 deletions
diff --git a/gdb/testsuite/gdb.btrace/exception.cc b/gdb/testsuite/gdb.btrace/exception.cc
index 6e4f872..0c660bb 100644
--- a/gdb/testsuite/gdb.btrace/exception.cc
+++ b/gdb/testsuite/gdb.btrace/exception.cc
@@ -50,7 +50,11 @@ test (void)
int
main (void)
{
+ int ret;
+
test ();
test (); /* bp.1 */
- return 0; /* bp.2 */
+
+ ret = 0;
+ return ret; /* bp.2 */
}
diff --git a/gdb/testsuite/gdb.btrace/exception.exp b/gdb/testsuite/gdb.btrace/exception.exp
index 33cd0ea..7b840e4 100755
--- a/gdb/testsuite/gdb.btrace/exception.exp
+++ b/gdb/testsuite/gdb.btrace/exception.exp
@@ -60,19 +60,25 @@ gdb_expect_list "flat" "\r\n$gdb_prompt $" [list \
"3\tfoo\\(\\)" \
"4\tbar\\(\\)" \
"5\tbad\\(\\)\r" \
- ] \
- "" \
- "\[0-9\]*\ttest\\(\\)"]
+ ] "" \
+ [multi_line \
+ "\[0-9\]*\ttest\\(\\)" \
+ "\[0-9\]*\tmain\\(\\)" \
+ ] "" \
+ ]
# show the branch trace with calls indented
send_gdb "record function-call-history /c 1\n"
gdb_expect_list "indented" "\r\n$gdb_prompt $" [list \
[multi_line \
"1\tmain\\(\\)" \
- "2\t test\\(\\)" \
- "3\t foo\\(\\)" \
- "4\t bar\\(\\)" \
- "5\t bad\\(\\)\r" \
- ] \
- "" \
- "\[0-9\]*\t test\\(\\)"]
+ "2\t test\\(\\)" \
+ "3\t foo\\(\\)" \
+ "4\t bar\\(\\)" \
+ "5\t bad\\(\\)\r" \
+ ] "" \
+ [multi_line \
+ "\[0-9\]*\t test\\(\\)" \
+ "\[0-9\]*\tmain\\(\\)" \
+ ] "" \
+ ]
diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp
index 568f794..f995016 100644
--- a/gdb/testsuite/gdb.btrace/function_call_history.exp
+++ b/gdb/testsuite/gdb.btrace/function_call_history.exp
@@ -148,29 +148,29 @@ gdb_test_no_output "set filename-display basename"
# moving forward again, but this time with file and line number, expected to see the first 15 entries
gdb_test "record function-call-history /l +" [multi_line \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
] "forward /l - 1"
# moving forward and expect to see the latest 6 entries
gdb_test "record function-call-history /l +" [multi_line \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,41" \
- "\[0-9\]*\tinc\tat $srcfile:22,24" \
+ "\[0-9\]*\tinc\tat $srcfile:22,2\[34\]" \
"\[0-9\]*\tmain\tat $srcfile:40,43" \
] "forward /l - 2"