Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Omair Javaid <omair.javaid@linaro.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM
Date: Thu, 19 Sep 2013 15:23:00 -0000	[thread overview]
Message-ID: <CANW4E-3OS0ghsOJim3g=EgZU1sLdcoX8yR1gW0MdTbK20Fsrgw@mail.gmail.com> (raw)
In-Reply-To: <51F7DDF0.8090605@redhat.com>

Thanks everyone for the feedback.

I am getting following problem with 1byte text section in the dw2-dos-drive.exp

(gdb) PASS: gdb.dwarf2/dw2-dos-drive.exp: set breakpoint pending off
break 'z:file.c':func
Cannot access memory at address 0x0

When I change this to 4bytes the problem gets fixed. That is why I
thought this could be an unaligned illegal memory access but I accept
that the above comments verify that its not a alignment issue.

Can anyone help me figure out what could be the cause of this problem?

Thanks!


--
Omair.

On 30 July 2013 16:38, Pedro Alves <palves@redhat.com> wrote:
> On 07/15/2013 11:26 AM, Omair Javaid wrote:
>> A test-case in gdb.dwarf2/dw2-dos-drive.exp fails on ARM. Problem occurs
>> due to an unaligned access of text section. This patch correctly aligns
>> text section to 4 bytes. This patch has been tested on armv7 and x86_64.
>
> #1 - What exactly is unaligned?  You're reserving 4 bytes instead
> of 1 for pc_start.  Does that really influence alignment of text ?
> It doesn't for me, with an arm-linux toolchain:
>
> $ arm-linux-gcc dw2-dos-drive.S -o a.out -c
> $ arm-gp2x-linux-objdump -h a.out
> ...
>   Sections:
>   Idx Name          Size      VMA       LMA       File off  Algn
>     0 .text         00000001  00000000  00000000  00000034  2**0
>                     CONTENTS, ALLOC, LOAD, READONLY, CODE
> ...
>
>  vs
>
> ...
>   Sections:
>   Idx Name          Size      VMA       LMA       File off  Algn
>     0 .text         00000004  00000000  00000000  00000034  2**0
>                    CONTENTS, ALLOC, LOAD, READONLY, CODE
> ...
>
> IOW, size increases, but alignment stays the same.
>
> #2 - Where's the actual access/fault?  AFAICS, the test doesn't
> even execute the compiled object's code.
>
> #3 - How come these other tests aren't likewise affected?
>
> $ grep "\.byte 0$" * -B 4
> dw2-canonicalize-type.S-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> dw2-canonicalize-type.S-
> dw2-canonicalize-type.S-        .text
> dw2-canonicalize-type.S-        .globl main
> dw2-canonicalize-type.S:main:   .byte 0
> --
> pr11465.S-      .text
> pr11465.S-text_start:
> pr11465.S-_ZN1N1cE:
> pr11465.S-      /* Valid function must have non-empty PC range.  */
> pr11465.S:      .byte 0
>
>>
>> gdb/testsuite/ChangeLog:
>>
>> 2013-07-15  Omair Javaid  <Omair.Javaid@linaro.org>
>>
>>       * gdb.dwarf2/dw2-dos-drive.S: Corrected text section alignment
>
> Missing period at end of sentence.  That's a "why".  You should say
> a "what" instead:
>
>         * gdb.dwarf2/dw2-dos-drive.S (pc_start): Use .4byte instead of
>         .byte.
>
>>
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S,v
>> retrieving revision 1.1
>> diff -u -p -r1.1 dw2-dos-drive.S
>> --- gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S    17 Jan 2013 20:40:44
>> -0000      1.1
>> +++ gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S    19 Jun 2013 19:43:32 -0000
>> @@ -15,7 +15,7 @@
>>
>>         .text
>>  pc_start:
>> -       .byte   0
>> +       .4byte  0
>>  pc_end:
>>
>>         .section        .debug_info
>>
>
> --
> Pedro Alves


  reply	other threads:[~2013-09-19 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANW4E-3h4UODqrXEjP2Z8AmZa+eYtXnTY337EosXTSE6016uGQ@mail.gmail.com>
2013-07-15 10:27 ` Omair Javaid
2013-07-30 15:38   ` Pedro Alves
2013-09-19 15:23     ` Omair Javaid [this message]
2013-09-19 15:53       ` Pedro Alves
2013-10-01  8:32         ` Omair Javaid
2013-10-01 15:34           ` Pedro Alves
2013-12-02 21:17             ` Omair Javaid
2014-01-15 18:39               ` Omair Javaid
2014-01-16 10:25               ` Pedro Alves
2014-01-16 10:35                 ` Omair Javaid
2014-01-16 10:58                   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANW4E-3OS0ghsOJim3g=EgZU1sLdcoX8yR1gW0MdTbK20Fsrgw@mail.gmail.com' \
    --to=omair.javaid@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox