From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20369 invoked by alias); 17 Oct 2014 12:07:15 -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 20360 invoked by uid 89); 17 Oct 2014 12:07:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Oct 2014 12:07:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9HC79cP019784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Oct 2014 08:07:10 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9HC77Qd008884; Fri, 17 Oct 2014 08:07:08 -0400 Message-ID: <5441066B.7000402@redhat.com> Date: Fri, 17 Oct 2014 12:07:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Kwok Cheung Yeung , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix gdb.dwarf2/dw2-dir-file-name.exp test for MIPS architectures References: <54399A91.8000006@mentor.com> In-Reply-To: <54399A91.8000006@mentor.com> Content-Type: text/plain; charset=shift_jis Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00467.txt.bz2 On 10/11/2014 10:01 PM, Kwok Cheung Yeung wrote: > This patch fixes the failures that occur with the > gdb.dwarf2/dw2-dir-file-name.exp test on 64-bit MIPS and compressed MIPS > ISAs (i.e. MIPS16 and microMIPS). > > The failures on 64-bit occur because the generated DWARF address > information is always 32-bit, which causes the upper 32-bits of > addresses to be truncated and causes breakpoints to be set on the wrong > address if any of the upper 32-bits are non-zero. I suspect that other > 64-bit architectures get away with it because they place all their > instructions at a VMA lower than 2^32 by default. This patch causes > 64-bit addresses to be generated if a 64-bit target is detected. > > The failures on MIPS16 and microMIPS occur because the breakpoint > address needs to have the LSB set to 1 (used to indicate that the code > is compressed). However, the function name is interpreted as a data > label, causing GDB to set breakpoints at even addresses. This is fixed > by explicitly adding a '.insn' directive (see > https://sourceware.org/binutils/docs/as/MIPS-insn.html) after the label > on MIPS only. Looks fine to me, but I'd like to hear Maciej's OK on the MIPS specifics too. Please make sure x86_64 still works. I wonder if this test could be simplified using the testsuite's dwarf assembler (Dwarf::assemble). > > Kwok > > 2014-08-14 Kwok Cheung Yeung > > gdb/testsuite/ > * gdb.dwarf2/dw2-dir-file-name.exp (addr_len): New. > (out_cu): Use addr_len for the size of addresses. > (out_line): Likewise. Size DW_LNE_set_address instruction > according to addr_len. > * gdb.dwarf2/dw2-dir-file-name.c (START_INSNS): New. > (FUNC): Add START_INSNS to definition. > Thanks, Pedro Alves