This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM
- From: Pedro Alves <palves at redhat dot com>
- To: Omair Javaid <omair dot javaid at linaro dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 19 Sep 2013 16:53:02 +0100
- Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM
- Authentication-results: sourceware.org; auth=none
- References: <CANW4E-3h4UODqrXEjP2Z8AmZa+eYtXnTY337EosXTSE6016uGQ at mail dot gmail dot com> <CANW4E-3LDYi6_N7Ko--=CK4pxbmi0rOd238a2FSbQO2XsaWw2A at mail dot gmail dot com> <51F7DDF0 dot 8090605 at redhat dot com> <CANW4E-3OS0ghsOJim3g=EgZU1sLdcoX8yR1gW0MdTbK20Fsrgw at mail dot gmail dot com>
Please don't top post.
On 09/19/2013 04:23 PM, Omair Javaid wrote:
> 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?
Breakpoint instructions on ARM are 4-byte wide. It sounds like
GDB is trying to read the memory at the breakpoint's address, and
that fails (that error message comes from GDB, not the program).
AFAICS, the test doesn't execute the compiled object's code, so
GDB will try to read memory from the binary's sections. As the
section is only 1 byte long, and probably no other section is allocated
contiguously, that'll fail... To confirm, debug GDB under GDB,
and put a break on throw_it or some such. Then work up the stack
to see where that is thrown, and why.
--
Pedro Alves