aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-06-22 18:32:38 +0000
committerDaniel Jacobowitz <drow@false.org>2003-06-22 18:32:38 +0000
commit2f816dda058ffc471cad62e158671418c247bef0 (patch)
treed833dd1a9b6af9693c5b5d55eda62924d209f7ee /gdb
parent261de1663a28d9f2a13f09a8f436d21c62634132 (diff)
downloadfsf-binutils-gdb-2f816dda058ffc471cad62e158671418c247bef0.zip
fsf-binutils-gdb-2f816dda058ffc471cad62e158671418c247bef0.tar.gz
fsf-binutils-gdb-2f816dda058ffc471cad62e158671418c247bef0.tar.bz2
* gdb.base/relocate.exp: Test add-symbol-file with a variable
offset.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/relocate.exp26
2 files changed, 31 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index bc29524..8a1a411 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2003-06-22 Daniel Jacobowitz <drow@mvista.com>
+ * gdb.base/relocate.exp: Test add-symbol-file with a variable
+ offset.
+
+2003-06-22 Daniel Jacobowitz <drow@mvista.com>
+
* gdb.c++/pr-1210.cc: New file.
* gdb.c++/pr-1210.exp: New file.
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index bcaa48a..8d8ff90 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -105,4 +105,30 @@ if { "${function_foo_addr}" == "${function_bar_addr}" } {
pass "functions have different addresses"
}
+# Now use a variable as an offset to add-symbol-file, and check that
+# the functions' addresses change.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set \$offset = 0x10000" ""
+
+# Load the object file.
+gdb_test "add-symbol-file ${binfile} \$offset" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile}.o \$offset" \
+ "add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x10000\[\r\n\]+\\(y or n\\) " \
+ "y"
+
+# Print the addresses of functions.
+set new_function_foo_addr [get_var_address function_foo]
+
+# Make sure they have different addresses.
+if { "${function_foo_addr}" == "${new_function_foo_addr}" } {
+ fail "function foo has a different address"
+} else {
+ pass "function foo has a different address"
+}
+
return 0