From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20767 invoked by alias); 16 Jan 2014 10:35:58 -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 20754 invoked by uid 89); 16 Jan 2014 10:35:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_WEB,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-bk0-f41.google.com Received: from mail-bk0-f41.google.com (HELO mail-bk0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 16 Jan 2014 10:35:56 +0000 Received: by mail-bk0-f41.google.com with SMTP id u12so979186bkz.28 for ; Thu, 16 Jan 2014 02:35:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Y3vLHIfmsnrB50CxbO5q9J/1JtEnVc9TSMkID5mOwiE=; b=HHL3VXHjsoakZBZYlDyTG3k65RdxEVColBf1gOWVxcQ/Q9uPFc4+nUL2IgtMlAoYa8 XKxdvnJWsTdl4ut/oA5r0uZRUAP2yBQKzO0Tzw8qGxLfHbIs8PfLWLmE0W/lzdE7IKzz UO2LMDaZRrEbl+ilqJrhXYK7IhcxfjH/Lhc/QENtuzh2DAtipTK5LCIz6WIECdJzGEe0 boHv8KcjXv7ZcqOgtHZjScVVXYKzeZ891IVo6SRqAY08heEXDA2I7raICKO3V28I32kZ 6RYBBD+z6e34mD0y3pepQymEagF/s5qd11AOK52KurtW7pM92TfqIk77UonJYdQUYIxI ay5g== X-Gm-Message-State: ALoCoQlKc1AAF3gx/IZFhy3ijQRcOhhN0RcTzhcee7zWS7IdoxIRDuUu4XAG24MiY8/VpaTIqjzf X-Received: by 10.204.51.8 with SMTP id b8mr5297872bkg.19.1389868553107; Thu, 16 Jan 2014 02:35:53 -0800 (PST) Received: from [192.168.1.2] ([182.185.178.235]) by mx.google.com with ESMTPSA id dg4sm6260169bkc.10.2014.01.16.02.35.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 02:35:52 -0800 (PST) Message-ID: <52D7B602.1030109@linaro.org> Date: Thu, 16 Jan 2014 10:35:00 -0000 From: Omair Javaid User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org, Patch Tracking Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM References: <51F7DDF0.8090605@redhat.com> <523B1DDE.2060002@redhat.com> <524AEB9A.8090303@redhat.com> <529CF8B3.60906@linaro.org> <52D7B39E.7080608@redhat.com> In-Reply-To: <52D7B39E.7080608@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00594.txt.bz2 On Thu 16 Jan 2014 03:25:34 PM PKT, Pedro Alves wrote: > On 12/02/2013 09:16 PM, Omair Javaid wrote: >> On 10/01/2013 08:34 PM, Pedro Alves wrote: >>> So, in the end, it'd be fine with me to just go in the >>> direction of your original patch then. But I think it deserves >>> a comment: >>> >>> pc_start: >>> /* Enough space to fit one instruction. */ >>> - .byte 0 >>> + .4byte 0 >>> pc_end: >>> >>> Could you resend your patch, with that change, a fixed commit >>> log description and fixed ChangeLog? > >> Sorry about responding late to this. I have attached the patch along with commit message and a ChangeLog. >> >> Commit Log Message: >> >> Avoid test failure due to error thrown from skip prologue code by >> an illegal memory access in case of single byte text section > > Period at end of sentences. That log if very incomplete though. > See below for what I suggest. (Note I tweaked the subject too) > > The best/easiest is to write that in the git commit log in your > local tree, and send out the commit exactly as you propose > to push. > >> gdb/testsuite/ChangeLog: >> >> 2013-12-02 Omair Javaid >> >> * gdb.dwarf2/dw2-dos-drive.S: Changed text section size to 4 bytes > > Period at end of sentence. > >> >> --- >> gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S >> index 682ba4e..f226912 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S >> @@ -15,7 +15,7 @@ >> >> .text >> pc_start: >> - .byte 0 >> + .4byte 0 > > Still misses comment. The version below adds one similar to > what I suggested before. > > If this looks good to you, I'll push it. > > Thanks. > > -- >8 -- > From: Omair Javaid > Subject: Fix testsuite/gdb.dwarf2/dw2-dos-drive.exp on ARM. > > This test currently fails on ARM: > > (gdb) PASS: gdb.dwarf2/dw2-dos-drive.exp: set breakpoint pending off > break 'z:file.c':func > Cannot access memory at address 0x0 > > The error is GDB trying to read the prologue at the breakpoint's > address, and failing: > > 38 throw_error() exceptions.c:444 0x0016728c > 37 memory_error() corefile.c:204 0x001d1fcc > 36 read_memory() corefile.c:223 0x001d201a > 35 read_memory_unsigned_integer() corefile.c:312 0x001d2166 > 34 arm_skip_prologue() arm-tdep.c:1452 0x00054270 > > static CORE_ADDR > arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) > { > ... > for (skip_pc = pc; skip_pc < limit_pc; skip_pc += 4) > { > inst = read_memory_unsigned_integer (skip_pc, 4, byte_order_for_code); > > > The test doesn't execute the compiled object's code, so GDB will try > to read memory from the binary's sections. Instructions on ARM are > 4-byte wide, and thus ARM's prologue scanner reads in 4-byte chunks. > As the section 'func' is put at is only 1 byte long, and no other > section is allocated contiguously: > > ... > Sections: > Idx Name Size VMA LMA File off Algn > 0 .text 00000001 00000000 00000000 00000034 2**0 > CONTENTS, ALLOC, LOAD, READONLY, CODE > ... > > ... the exec target fails the read the 4 bytes. > > Fix this by increasing the function's size. > > gdb/testsuite/ChangeLog: > 2014-01-16 Omair Javaid > > * gdb.dwarf2/dw2-dos-drive.S: Increase text section size to 4 > bytes. > --- > gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S > index 6e9d360..84006f7 100644 > --- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S > +++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S > @@ -15,7 +15,8 @@ > > .text > pc_start: > - .byte 0 > + /* Enough space to fit at least one instruction. */ > + .4byte 0 > pc_end: > > .section .debug_info Changes look good. Thanks. Kindly go ahead and push.