From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31734 invoked by alias); 3 Jul 2013 20:19:55 -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 31723 invoked by uid 89); 3 Jul 2013 20:19:54 -0000 X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 03 Jul 2013 20:19:54 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UuTWo-000103-T0 from Luis_Gustavo@mentor.com ; Wed, 03 Jul 2013 13:19:50 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 3 Jul 2013 13:19:50 -0700 Received: from [172.30.14.191] ([172.30.14.191]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Jul 2013 13:19:49 -0700 Message-ID: <51D48763.7020703@codesourcery.com> Date: Wed, 03 Jul 2013 20:19:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pedro Alves CC: Tom Tromey , Stan Shebs , GDB Patches , Ulrich Weigand Subject: Re: [PATCH, testsuite] Don't run SREC, IHEX and TEKHEX tests for MIPS N64. References: <51D1AD43.3060904@codesourcery.com> <8761wsgb8i.fsf@fleche.redhat.com> <51D3050C.4070309@codesourcery.com> <51D30BB0.3050906@earthlink.net> <87wqp8estz.fsf@fleche.redhat.com> <51D32100.4000901@codesourcery.com> <51D43DBB.5090803@redhat.com> <51D47A05.9020404@codesourcery.com> <51D47AC4.1020208@redhat.com> In-Reply-To: <51D47AC4.1020208@redhat.com> Content-Type: multipart/mixed; boundary="------------060206070704010204020500" X-Virus-Found: No X-SW-Source: 2013-07/txt/msg00159.txt.bz2 This is a multi-part message in MIME format. --------------060206070704010204020500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2661 On 07/03/2013 04:25 PM, Pedro Alves wrote: > On 07/03/2013 08:22 PM, Luis Machado wrote: >> On 07/03/2013 12:05 PM, Pedro Alves wrote: >>> On 07/02/2013 07:50 PM, Luis Machado wrote: >>>> - >>>> -if {[istarget "spu*-*-*"]} then { >>>> - # The internal address format used for the combined Cell/B.E. >>>> - # debugger requires 64-bit. >>>> - set is64bitonly "yes" >>>> -} >>>> - >>> >>> I'm not sure this equates to sizeof pointer == 64-bit. >>> This bit may need to be retained. [Adding Ulrich]. >> >> Fair enough. Ulrich, let me know if the pointer check in the attached >> patch doesn't make sense for Cell BE. >> >>> >>>> + >>>> + set sizeof_function_ptr [get_sizeof "void (*)(void)" 8] >>>> + set sizeof_data_ptr [get_sizeof "void *" 8] >>>> + if {${sizeof_function_ptr} != 4 && ${sizeof_data_ptr} != 4} then { >>>> + set is64bitonly "yes" >>>> + } >>>> +} >>>> + >>> >>> srec (etc.) is most used in small embedded targets (e.g., those >>> that include dsrec.o in the configure.tgt), consequently >>> that's where the test is most useful. Such targets >>> are the most likely to have 16-bit pointers (< 4 bytes). >>> E.g., h8300, etc. Looks like this ends up causing the tests to >>> be skipped there too. IOW, a better check would be: >>> >>> if {${sizeof_function_ptr} > 4 || ${sizeof_data_ptr} > 4} then { >>> >> >> Ah, yes. This check is indeed better. Follows an updated patch that does >> this. >> >>> But, this change also means we have reduced routine-checking, >>> as most people test on x86_64. I think we can do better. The test >>> works fine on e.g., x86_64, because programs get linked to low (< 32-bit) >>> addresses by default. That's the point of: >>> >>> if [istarget "alpha*-*-*"] then { >>> # SREC etc cannot handle 64-bit addresses. Force the test >>> # program into the low 31 bits of the address space. >>> lappend options "additional_flags=-Wl,-taso" >>> } >>> >>> (For MIPS N64, if you wanted, I guess you could do similarly >>> to Alpha, and rebuild with: >>> >>> lappend options "ldflags=-Wl,-Tdata=0x600000" >>> >>> to force use of low addresses.) >>> >>> IOW, instead of checking for ABI pointer sizes, I think it'd >>> be better to test for the actual address size of one the >>> variables dumped. That is, check that &intarray is < 32-bit. >>> >> >> If lack of coverage for x86_64 running things on low addresses is a >> problem, we can add an exception for x86_64, what do you think? Adding >> these exceptions usually polute the testcases though. > > But do you see a problem with checking whether "&intarray is < 32-bit" instead? > Not really. Like so? Luis --------------060206070704010204020500 Content-Type: text/x-patch; name="dump.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dump.diff" Content-length: 1643 2013-07-03 Luis Machado * gdb.base/dump.exp: Remove arch-specific tests and do a generic data address check to set is64bitonly correctly. Index: gdb/testsuite/gdb.base/dump.exp =================================================================== --- gdb/testsuite/gdb.base/dump.exp (revision 415997) +++ gdb/testsuite/gdb.base/dump.exp (working copy) @@ -32,16 +32,6 @@ lappend options "additional_flags=-Wl,-taso" } -if {[istarget "ia64*-*-*"] || [istarget "hppa64-*-*"]} then { - set is64bitonly "yes" -} - -if {[istarget "spu*-*-*"]} then { - # The internal address format used for the combined Cell/B.E. - # debugger requires 64-bit. - set is64bitonly "yes" -} - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } { untested dump.exp return -1 @@ -58,6 +48,15 @@ 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 remote_exec build "rm -f intarr1.bin intarr1b.bin intarr1.ihex intarr1.srec intarr1.tekhex intarr2.bin intarr2b.bin intarr2.ihex intarr2.srec intarr2.tekhex intstr1.bin intstr1b.bin intstr1.ihex intstr1.srec intstr1.tekhex intstr2.bin intstr2b.bin intstr2.ihex intstr2.srec intstr2.tekhex intarr3.srec" --------------060206070704010204020500--