aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog25
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp34
-rw-r--r--gdb/testsuite/gdb.base/ptype.exp3
-rw-r--r--gdb/testsuite/gdb.base/step-test.exp12
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp8
-rw-r--r--gdb/testsuite/gdb.c++/ovldbreak.exp136
-rw-r--r--gdb/testsuite/gdb.c++/templates.exp4
7 files changed, 80 insertions, 142 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b4d5d01..cfc2c90 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2000-02-04 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/templates.exp: ("ptype T5<int>"): Remove extraneous
+ backslash from regexp pattern.
+
+ * gdb.c++/ovldbreak.exp (continue_to_bp_overloaded): New
+ procedure. Use it to run all the "continue to bp overloaded"
+ tests. Note that this changes the names of the tests slightly.
+ If the breakpoint hit message includes a hex PC value, because
+ GCC's Dwarf 2 line info doesn't help us distinguish the prologue
+ from the real source code, still consider that a pass.
+
+ * gdb.base/condbreak.exp ("run until breakpoint at marker2"):
+ XFAIL here if the breakpoint message contains a hex address. Note
+ similar change on 1999-11-02.
+
+ * gdb.base/step-test.exp: Comment Fernando's change of 2000-02-02.
+
+ * gdb.base/ptype.exp: Establish a default source file before
+ calling get_debug_format.
+
+2000-02-03 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/watchpoint.exp: Remove duplication of test messages.
+
2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.base/step-test.exp: Fix the steps to enter a callee by means
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 0d4731f..2d40a0e 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -196,23 +196,21 @@ gdb_expect {
}
}
-#
# run until the breakpoint at marker2
-#
+# Same issues here as above.
setup_xfail hppa2.0w-*-* 11512CLLbs
-gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" \
- "run until breakpoint at marker2"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
+ pass "run until breakpoint at marker2"
+ }
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
+ xfail "run until breakpoint at marker2"
+ }
+ -re "$gdb_prompt $" {
+ fail "run until breakpoint at marker2"
+ }
+ timeout {
+ fail "(timeout) run until breakpoint at marker2"
+ }
+}
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index f5b4503..82bf7df 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -132,6 +132,9 @@ if {!$gcc_compiled && !$hp_aCC_compiler} {
setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
setup_xfail "hppa*-*-*" CLLbs14773
}
+
+# For get_debug_format to do its job, we need to have a current source file.
+gdb_test "list main" ""
get_debug_format
setup_xfail_format "DWARF 1"
gdb_test "whatis v_boolean" "type = (enum |)boolean" \
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index c0acf81..47d4572 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -142,13 +142,17 @@ test_i "stepi to next line" "stepi" \
test_i "stepi into function" "stepi" \
".*${decimal}.*callee.*STEPI" \
".*callee \\(\\) at .*step-test\\.c"
-test_i "stepi to function first line" "stepi" \
- ".*int callee\\(\\) .*\\{" \
- ".*myglob.*"
+
+# Continue to step until we reach the function's body. This makes it
+# more likely that we've actually completed the prologue, so "finish"
+# will work.
+test_i "stepi into function's first source line" "stepi" \
+ ".*${decimal}.*int callee" \
+ ".*${decimal}.*myglob.*; return 0;"
+
# Have to be careful here, if the finish does not work,
# then we may run to the end of the program, which
# will cause erroneous failures in the rest of the tests
-
send_gdb "finish\n"
gdb_expect {
-re ".*(Program received|Program exited).*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 39c388e..3bd3314 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -406,7 +406,7 @@ proc test_stepping {} {
-re "Run.*exit from.*marker1.* at" {
pass "finish from marker1"
}
- default { fail "finish from marker1" ; return }
+ default { fail "finish from marker1 (timeout)" ; return }
}
gdb_expect {
@@ -415,12 +415,12 @@ proc test_stepping {} {
exp_continue
}
-re "func1 \\(\\);.*$gdb_prompt $" {
- pass "finish from marker1"
+ pass "back at main from marker1"
}
-re ".*$gdb_prompt $" {
- fail "finish from marker1"
+ fail "back at main from marker1"
}
- default { fail "finish from marker1 (timeout)" ; return }
+ default { fail "back at main from marker1 (timeout)" ; return }
}
gdb_test "next" "for \\(count = 0.*" "next to `for' in watchpoint.exp"
diff --git a/gdb/testsuite/gdb.c++/ovldbreak.exp b/gdb/testsuite/gdb.c++/ovldbreak.exp
index d7482bd..2513b5f 100644
--- a/gdb/testsuite/gdb.c++/ovldbreak.exp
+++ b/gdb/testsuite/gdb.c++/ovldbreak.exp
@@ -554,122 +554,30 @@ gdb_test "info break" \
"breakpoint info"
+proc continue_to_bp_overloaded {n formals actuals} {
+ global gdb_prompt hex decimal srcfile
send_gdb "cont\n"
gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 25, foo::overload1arg \\(this=$hex\\) at.*$srcfile:110\r\n110\[\t \]+int foo::overload1arg \\(void\\)\[\t \]+\{ return 1; \}\r\n$gdb_prompt $" {
- pass "continue to bp overloaded : void"
+ -re "Continuing.\r\n\r\nBreakpoint $n, (${hex} in )?foo::overload1arg \\(this=${hex}(, )?${actuals}\\) at.*$srcfile:${decimal}\r\n${decimal}\[\t \]+int foo::overload1arg \\(${formals}\\).*\r\n$gdb_prompt $" {
+ pass "continue to bp overloaded : ${formals}"
}
- -re "$gdb_prompt $" { fail "continue to bp overloaded : void" }
- timeout { fail "(timeout) continue to bp overloaded : void" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 24, foo::overload1arg \\(this=$hex, arg=2 \\'\\\\002\\'\\) at.*$srcfile:111\r\n111\[\t \]+int foo::overload1arg \\(char arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : char"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : char" }
- timeout { fail "(timeout) continue to bp overloaded : char" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 23, foo::overload1arg \\(this=$hex, arg=3 \\'\\\\003\\'\\) at.*$srcfile:112\r\n112\[\t \]+int foo::overload1arg \\(signed char arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : signed char"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : signed char" }
- timeout { fail "(timeout) continue to bp overloaded : signed char" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 22, foo::overload1arg \\(this=$hex, arg=4 \\'\\\\004\\'\\) at.*$srcfile:113\r\n113\[\t \]+int foo::overload1arg \\(unsigned char arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : unsigned char"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : unsigned char" }
- timeout { fail "(timeout) continue to bp overloaded : unsigned char" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 21, foo::overload1arg \\(this=$hex, arg=5\\) at.*$srcfile:114\r\n114\[\t \]+int foo::overload1arg \\(short arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : short"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : short" }
- timeout { fail "(timeout) continue to bp overloaded : short" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 20, foo::overload1arg \\(this=$hex, arg=6\\) at.*$srcfile:115\r\n115\[\t \]+int foo::overload1arg \\(unsigned short arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : unsigned short"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : unsigned short" }
- timeout { fail "(timeout) continue to bp overloaded : unsigned short" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 19, foo::overload1arg \\(this=$hex, arg=7\\) at.*$srcfile:116\r\n116\[\t \]+int foo::overload1arg \\(int arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : int"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : int" }
- timeout { fail "(timeout) continue to bp overloaded : int" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 18, foo::overload1arg \\(this=$hex, arg=8\\) at.*$srcfile:117\r\n117\[\t \]+int foo::overload1arg \\(unsigned int arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : unsigned int"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : unsigned int" }
- timeout { fail "(timeout) continue to bp overloaded : unsigned int" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 17, foo::overload1arg \\(this=$hex, arg=9\\) at.*$srcfile:118\r\n118\[\t \]+int foo::overload1arg \\(long arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : long"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : long" }
- timeout { fail "(timeout) continue to bp overloaded : long" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 16, foo::overload1arg \\(this=$hex, arg=10\\) at.*$srcfile:119\r\n119\[\t \]+int foo::overload1arg \\(unsigned long arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : unsigned long"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : unsigned long" }
- timeout { fail "(timeout) continue to bp overloaded : unsigned long" }
- }
-
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 15, foo::overload1arg \\(this=$hex, arg=100\\) at.*$srcfile:120\r\n120\[\t \]+int foo::overload1arg \\(float arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : float"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : float" }
- timeout { fail "(timeout) continue to bp overloaded : float" }
- }
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Continuing.\r\n\r\nBreakpoint 14, foo::overload1arg \\(this=$hex, arg=200\\) at.*$srcfile:121\r\n121\[\t \]+int foo::overload1arg \\(double arg\\).*$gdb_prompt $" {
- pass "continue to bp overloaded : double"
- }
- -re "$gdb_prompt $" { fail "continue to bp overloaded : double" }
- timeout { fail "(timeout) continue to bp overloaded : double" }
+ -re "$gdb_prompt $" { fail "continue to bp overloaded : ${formals}" }
+ timeout { fail "(timeout) continue to bp overloaded : ${formals}" }
}
+}
- gdb_continue_to_end "finish program"
+continue_to_bp_overloaded 25 "void" ""
+continue_to_bp_overloaded 24 "char arg" "arg=2 \\'\\\\002\\'"
+continue_to_bp_overloaded 23 "signed char arg" "arg=3 \\'\\\\003\\'"
+continue_to_bp_overloaded 22 "unsigned char arg" "arg=4 \\'\\\\004\\'"
+continue_to_bp_overloaded 21 "short arg" "arg=5"
+continue_to_bp_overloaded 20 "unsigned short arg" "arg=6"
+continue_to_bp_overloaded 19 "int arg" "arg=7"
+continue_to_bp_overloaded 18 "unsigned int arg" "arg=8"
+continue_to_bp_overloaded 17 "long arg" "arg=9"
+continue_to_bp_overloaded 16 "unsigned long arg" "arg=10"
+continue_to_bp_overloaded 15 "float arg" "arg=100"
+continue_to_bp_overloaded 14 "double arg" "arg=200"
+
+
+gdb_continue_to_end "finish program"
diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp
index 99c2551..5b8875e 100644
--- a/gdb/testsuite/gdb.c++/templates.exp
+++ b/gdb/testsuite/gdb.c++/templates.exp
@@ -52,12 +52,12 @@ proc test_ptype_of_templates {} {
send_gdb "ptype T5<int>\n"
gdb_expect {
- -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\<int> & operator=\\(T5<int> const &\\);${ws}T5\\(int\\);${ws}T5\\(T5<int> const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned (int|long)\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const &\\);${ws}T5\\(int\\);${ws}T5\\(T5<int> const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned (int|long)\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int>"
}
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void \\*\\);${ws}int value \\(void\\);${ws}\\}${ws}$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned int" }
-re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5<int> &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void \\*\\);.*int value \\(void\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned long" }
- -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5\\<int> & operator=\\(T5<int> const &\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const &\\);)|(${ws}~T5\\(void\\);)|(${ws}static void \\* operator new\\(unsigned (int|long)\\);)|(${ws}static void operator delete\\(void \\*\\);)|(${ws}int value\\(void\\);))*${ws}\}\r\n$gdb_prompt $" {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const &\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const &\\);)|(${ws}~T5\\(void\\);)|(${ws}static void \\* operator new\\(unsigned (int|long)\\);)|(${ws}static void operator delete\\(void \\*\\);)|(${ws}int value\\(void\\);))*${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int> (obsolescent gcc or gdb)"
}
-re ".*$gdb_prompt $" {