aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-10-22 15:14:41 +0100
committerPedro Alves <palves@redhat.com>2015-02-27 17:41:44 +0000
commita37bfa30016370992c59105fb4fd97cd3a264149 (patch)
treec6eeac4d85918851c999b94773e20753e3cab7c6 /gdb
parente992c591afd3e4f047ecad5afa49bdbde6c33eac (diff)
downloadgdb-a37bfa30016370992c59105fb4fd97cd3a264149.zip
gdb-a37bfa30016370992c59105fb4fd97cd3a264149.tar.gz
gdb-a37bfa30016370992c59105fb4fd97cd3a264149.tar.bz2
Adjust self tests to cope with GDB built as a C++ program
gdb/testsuite/ 2015-02-27 Pedro Alves <palves@redhat.com> * gdb.gdb/complaints.exp (test_initial_complaints): Also accept "true" for boolean result. * gdb.gdb/selftest.exp (test_with_self): Also accept full prototype of main.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.gdb/complaints.exp6
-rw-r--r--gdb/testsuite/gdb.gdb/selftest.exp6
3 files changed, 16 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index efc74f6..60dbaa8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2015-02-27 Pedro Alves <palves@redhat.com>
+ * gdb.gdb/complaints.exp (test_initial_complaints): Also accept
+ "true" for boolean result.
+ * gdb.gdb/selftest.exp (test_with_self): Also accept full
+ prototype of main.
+
+2015-02-27 Pedro Alves <palves@redhat.com>
+
* lib/unbuffer_output.c: New file.
* gdb.base/interrupt.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
diff --git a/gdb/testsuite/gdb.gdb/complaints.exp b/gdb/testsuite/gdb.gdb/complaints.exp
index 500f414..707b2a5 100644
--- a/gdb/testsuite/gdb.gdb/complaints.exp
+++ b/gdb/testsuite/gdb.gdb/complaints.exp
@@ -43,9 +43,11 @@ proc test_initial_complaints { } {
gdb_test "call complaint (&symfile_complaints, symfile_complaints->root->fmt)" \
"During symbol reading, Register a complaint."
- # Check that there is only one thing in the list
+ # Check that there is only one thing in the list. How the boolean
+ # result is output depends on whether GDB is built as a C or C++
+ # program.
gdb_test "print symfile_complaints->root->next == &complaint_sentinel" \
- ".\[0-9\]+ = 1" "list has one entry"
+ ".\[0-9\]+ = \(1|true\)" "list has one entry"
# Add a second complaint, expect it
gdb_test "call complaint (&symfile_complaints, \"Testing! Testing! Testing!\")" \
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index b32e799..9f25a48 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -288,9 +288,13 @@ proc test_with_self { executable } {
return -1
}
+ # When GDB is built as a C++ program, disassemble shows the full
+ # prototype.
+ set cxx_main_args_re [string_to_regexp "(int, char**)"]
+
# disassemble yourself
gdb_test "x/10i main" \
- "x/10i.*main.*main.$decimal.*main.$decimal.*" \
+ "x/10i.*main.*main($cxx_main_args_re)?.$decimal.*main($cxx_main_args_re)?.$decimal.*" \
"Disassemble main"
# Set a breakpoint at main