* [PATCH] Fix generic address check in gdb.base/dump.exp
@ 2014-02-05 13:24 Mark Kettenis
2014-02-05 15:25 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2014-02-05 13:24 UTC (permalink / raw)
To: gdb-patches
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" {
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Fix generic address check in gdb.base/dump.exp
2014-02-05 13:24 [PATCH] Fix generic address check in gdb.base/dump.exp Mark Kettenis
@ 2014-02-05 15:25 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2014-02-05 15:25 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On 02/05/2014 01:24 PM, Mark Kettenis wrote:
> 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.
Doesn't that mean that the set of ran tests potentially
changes depending on the whim of the loader? A more robust
change would disable PIE, similarly to how we pass -Wl,-taso
on alpha, IMO.
>
> ok?
Fine with me, but ...
> 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.
... I think this "why" remark should be a note in the test itself.
Something like: "Note we check this only after starting the inferior
to get the correct outcome for PIEs.".
Thanks,
--
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-05 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05 13:24 [PATCH] Fix generic address check in gdb.base/dump.exp Mark Kettenis
2014-02-05 15:25 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox