From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17638 invoked by alias); 5 Feb 2014 13:24:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17625 invoked by uid 89); 5 Feb 2014 13:24:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 05 Feb 2014 13:24:31 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id s15DORRl010320 for ; Wed, 5 Feb 2014 14:24:27 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id s15DOR24007610; Wed, 5 Feb 2014 14:24:27 +0100 (CET) Date: Wed, 05 Feb 2014 13:24:00 -0000 Message-Id: <201402051324.s15DOR24007610@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [PATCH] Fix generic address check in gdb.base/dump.exp X-SW-Source: 2014-02/txt/msg00040.txt.bz2 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 * 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" {