This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v5] Add negative repeat count to 'x' command
- From: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- To: Pedro Alves <palves at redhat dot com>, Toshihito Kikuchi <k dot toshihito at yahoo dot de>, gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Tue, 6 Sep 2016 15:28:30 +0100
- Subject: Re: [PATCH v5] Add negative repeat count to 'x' command
- Authentication-results: sourceware.org; auth=none
- References: <1464857355-29883-1-git-send-email-k.toshihito@yahoo.de> <4e8feff5-935e-668e-6c68-87603173a953@foss.arm.com> <69169a01-7a25-1e72-810d-2971337ce002@redhat.com> <50dbd13a-52a2-9687-ace0-5aa51e1bc1d1@foss.arm.com> <d3d1ec85-edae-ac23-3dd6-236606fb8573@foss.arm.com> <e5b92176-15bc-6181-8f7d-87d3c89c258a@redhat.com> <e6859294-8e8b-35cb-236f-380398414a2c@foss.arm.com> <0690bbdc-995d-5daf-904d-86eb5017d6bd@redhat.com>
Hi Pedro,
Sorry for the delay in answering.
On 19/08/16 19:59, Pedro Alves wrote:
First I think we should assess whether the behavior is correct or
whether there's a qemu or gdb bug. If it's a gdb bug, we should fix
it, of course. If it's a qemu bug, we should report it and maybe XFAIL
it. If it's not a bug but a qemu personality quirk, then we can make
the tests cope, somehow.
I still wonder why does the read from 0 work at all. I've tried
reproducing this, using x86_64 Fedora 23's stock qemu-arm:
$ qemu-arm -version
qemu-arm version 2.4.1 (qemu-2.4.1-11.fc23), Copyright (c) 2003-2008 Fabrice Bellard
... but couldn't. Here's what I get instead:
Terminal 1:
$ cat crash.c
int main ()
{
volatile int *null = 0;
return *null;
}
$ arm-linux-gnueabi -static crash.c
$ qemu-arm -g 9999 a.out
Terminal 2:
$ gdb a.out -ex "tar rem :9999"
(gdb) x 0
Sending packet: $m0,4#fd...Ack
Packet received: E14
0x0: Cannot access memory at address 0x0
IIRC, arm's exception vector is at 0 and that that's
where execution starts. But that shouldn't be applicable
to mmu userspace programs?
I'm getting:
(gdb) x 0
0x0: 0x464c457f
However note that I compiled with arm-none-eabi-gcc so there would be some bits
of the program (ARM's exception vector indeed) at this address.
I wonder what's different between our environments.
We are targetting ARM bare-metal targets.
Note: I had to use -static, because of:
$ qemu-arm -g 9999 ./crash.arm
/lib/ld-linux.so.3: No such file or directory
I suppose I would need to point qemu at an arm sysroot,
somehow to get past that.
Is there a dejagnu board file somewhere handy one could steal
in order to run tests against qemu-user ?
Nothing public that I am aware of I'm afraid. However I can reproduce this issue
easily by compiling examine-backward.c with the GNU ARM embedded toolchain [1]
using the following command line:
arm-none-eabi-gcc -o examine-backward.axf
gdb/testuite/gdb.base/examine-backward.c -specs=rdimon.specs
and then running:
qemu-arm -g 2048 examine-backward.axf &
arm-none-eabi-gdb examine-backward.axf
(gdb) target remote :2048
x/3xb 0x0
x/-6x
[1] https://launchpad.net/gcc-arm-embedded
Thanks for your effort on understanding this Pedro.
Best regards,
Thomas