summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/define.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/define.exp')
-rw-r--r--gdb/testsuite/gdb.base/define.exp24
1 files changed, 18 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp
index 06ea1c0f4f8..7e948f18e01 100644
--- a/gdb/testsuite/gdb.base/define.exp
+++ b/gdb/testsuite/gdb.base/define.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
@@ -34,10 +34,19 @@ set bug_id 0
set testfile "break"
set srcfile ${testfile}.c
+set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
@@ -45,6 +54,9 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+
if ![runto_main] then { fail "define tests suppressed" }
# Verify that GDB allows a user to define their very own commands.
@@ -68,7 +80,7 @@ gdb_expect {
#
send_gdb "nextwhere\n"
gdb_expect {
- -re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
+ -re ".*$bp_location1\[ \t\]*printf.*#0\[ \t\]*main.*:$bp_location1.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
@@ -224,7 +236,7 @@ gdb_expect {
send_gdb "next\n"
gdb_expect {
- -re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
+ -re "#0\[ \t\]*main.*:$bp_location11.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}