This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix generic address check in gdb.base/dump.exp


Moves the check until after the inferior has been started such that we
get the right result for PIEs (position independent executables).  The
addresses of the unrelocated executable tend to be small, but
relocation is likely to move them above the 4GB boundary.

ok?


2014-02-05  Mark Kettenis  <kettenis@gnu.org>

	* gdb.base/dump.exp: Move the generic data address to set
	is64bitonly after starting the inferior to get the correct outcome
	for PIEs.

diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 6592354..0eadd8f 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -52,15 +52,6 @@ gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \
 
 gdb_load ${binfile}
 
-# Check the address of a variable.  If it is bigger than 32-bit,
-# assume our target has 64-bit addresses that are not supported by SREC,
-# IHEX and TEKHEX.  We skip those tests then.
-set max_32bit_address "0xffffffff"
-set data_address [get_hexadecimal_valueof "&intarray" 0x100000000]
-if {${data_address} > ${max_32bit_address}} then {
-    set is64bitonly "yes"
-}
-
 # Clean up any stale output files from previous test runs
 
 set filenames {}
@@ -95,6 +86,15 @@ if { ! [ runto checkpoint1 ] } then {
     return -1
 }
 
+# Check the address of a variable.  If it is bigger than 32-bit,
+# assume our target has 64-bit addresses that are not supported by SREC,
+# IHEX and TEKHEX.  We skip those tests then.
+set max_32bit_address "0xffffffff"
+set data_address [get_hexadecimal_valueof "&intarray" 0x100000000]
+if {${data_address} > ${max_32bit_address}} then {
+    set is64bitonly "yes"
+}
+
 # Get the endianness for the later use with endianless formats.
 
 gdb_test_multiple "show endian" "show endian" {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]