This is the mail archive of the
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: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
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:
$ cat crash.c
int main ()
volatile int *null = 0;
$ arm-linux-gnueabi -static crash.c
$ qemu-arm -g 9999 a.out
$ 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?
(gdb) x 0
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 
using the following command line:
arm-none-eabi-gcc -o examine-backward.axf
and then running:
qemu-arm -g 2048 examine-backward.axf &
(gdb) target remote :2048
Thanks for your effort on understanding this Pedro.