aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/pending.exp
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2007-08-18 01:21:42 +0000
committerJoel Brobecker <brobecker@gnat.com>2007-08-18 01:21:42 +0000
commitb9c34f673c60f5cea06adef594fb3a8967d50498 (patch)
tree800741cb3229becf2146bc19ebc7627687c3a8ae /gdb/testsuite/gdb.base/pending.exp
parentf91162e1998a368455be2b8fb573ffc0e1322e7f (diff)
downloadbinutils-b9c34f673c60f5cea06adef594fb3a8967d50498.zip
binutils-b9c34f673c60f5cea06adef594fb3a8967d50498.tar.gz
binutils-b9c34f673c60f5cea06adef594fb3a8967d50498.tar.bz2
* gdb.base/gdb1555.exp: Make expected output immune to formatting
changes inside gdb1555.c. * gdb.base/pending.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/pending.exp')
-rw-r--r--gdb/testsuite/gdb.base/pending.exp24
1 files changed, 13 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 2c98f6e..c2363ab 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -146,9 +146,10 @@ gdb_test "info break" \
# Try a pending break for a line in a source file with a condition
#
-gdb_test_multiple "break pendshr.c:26 if x > 3" "Set pending breakpoint 2" {
+set bp2_loc [gdb_get_line_number "y = x + 4" ${libfile}.c]
+gdb_test_multiple "break pendshr.c:$bp2_loc if x > 3" "Set pending breakpoint 2" {
-re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
- gdb_test "y" "Breakpoint.*pendshr.c:26.*pending." \
+ gdb_test "y" "Breakpoint.*pendshr.c:$bp2_loc.*pending." \
"Set pending breakpoint 2"
}
}
@@ -159,7 +160,7 @@ gdb_test "info break" \
\[\t \]+stop only if k == 1.*
\[\t \]+print k.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$mainline.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:26 if x > 3.*" \
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp2_loc if x > 3.*" \
"multiple pending breakpoints"
@@ -167,9 +168,10 @@ gdb_test "info break" \
# Try a pending break for a line in a source file with ignore count:
#
-gdb_test_multiple "break pendshr.c:27" "Set pending breakpoint 3" {
+set bp3_loc [gdb_get_line_number "printf" ${libfile}.c]
+gdb_test_multiple "break pendshr.c:$bp3_loc" "Set pending breakpoint 3" {
-re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
- gdb_test "y" "Breakpoint.*pendshr.c:27.*pending." \
+ gdb_test "y" "Breakpoint.*pendshr.c:$bp3_loc.*pending." \
"Set pending breakpoint 3"
}
}
@@ -183,8 +185,8 @@ gdb_test "info break" \
\[\t \]+stop only if k == 1.*
\[\t \]+print k.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$mainline.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:26 if x > 3.*
-\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:27.*ignore next 2 hits.*" \
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp2_loc if x > 3.*
+\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*pendshr.c:$bp3_loc.*ignore next 2 hits.*" \
"multiple pending breakpoints 2"
#
@@ -194,7 +196,7 @@ gdb_test "info break" \
gdb_run_cmd
gdb_test "" \
"Breakpoint.*at.*
-Pending breakpoint \"pendshr.c:26 if x > 3\" resolved.*
+Pending breakpoint \"pendshr.c:$bp2_loc if x > 3\" resolved.*
Breakpoint.*, main.*$mainline.*" \
"running to main"
@@ -212,11 +214,11 @@ Pending breakpoint \"pendfunc1.* resolved.*" \
#
gdb_test "continue" \
-".*Breakpoint.*pendfunc1.*at.*pendshr.c:26.*4;" \
+".*Breakpoint.*pendfunc1.*at.*pendshr.c:$bp2_loc.*4;" \
"continue to resolved breakpoint 2"
gdb_test "continue" \
-".*Breakpoint.*pendfunc1.*at.*pendshr.c:26.*
+".*Breakpoint.*pendfunc1.*at.*pendshr.c:$bp2_loc.*
\[$\]1 = 1." \
"continue to resolved breakpoint 1"
@@ -230,7 +232,7 @@ gdb_test "disable 7" "" "Disable other breakpoints"
gdb_test "disable 5" "" "Disable other breakpoints"
gdb_test "continue" \
- {.*Breakpoint.*pendfunc1.*\(x=3\) at.*pendshr.c:27.*printf.*;} \
+ ".*Breakpoint.*pendfunc1.*\\\(x=3\\\) at.*pendshr.c:$bp3_loc.*printf.*;" \
"continue to resolved breakpoint 3"
delete_breakpoints