This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V3] Add negative repeat count to 'x' command
- From: Pedro Alves <palves at redhat dot com>
- To: Toshihito Kikuchi <k dot toshihito at yahoo dot de>, gdb-patches at sourceware dot org, Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Tue, 24 May 2016 12:16:36 +0100
- Subject: Re: [PATCH V3] Add negative repeat count to 'x' command
- Authentication-results: sourceware.org; auth=none
- References: <1461866539-24965-1-git-send-email-k dot toshihito at yahoo dot de> <c2d74e3a-d818-2af2-613e-57ce6bec97f9 at redhat dot com> <57433C3B dot 7000300 at yahoo dot de>
On 05/23/2016 06:22 PM, Toshihito Kikuchi wrote:
> Hi Pedro,
>
> Thank you for your kind comments. Most of them are addressed in next
> iteration.
Great, looking forward.
>> Also, we should probably be taking into account the addressable
>> unit size here.
>
> Do you mean adding a new parameter like unit_size to pass it to
> target_read_memory?
>
For instance, seems like read_memory_backward assumes that 1 target
byte fits in 1 host byte, which is not true on e.g., 16-bit byte
architectures. But probably easiest is to ignore it for now, and
then let the tests drive the fixing on such archs as follow ups.
Simon, what do you think?
>> So in the last test, the address wraps around. On a non-MMU this will
>> actually read memory from a high address. Is this what we want? Or do
>> we want to have GDB to never try to go before 0? Likewise end of addr space.
>
> This was my misunderstanding about non-MMU. I change the expected
> result, expecting a line starts with '0x\[0-9a-f\]+fd'.
Similar question with MMU targets though. Should "x/-1 0" wrap around
to a high address? If it does, it should wrap around taking into account
target address width. Say, on 32-bit, "0-1" is 0x0..0ffffffff not
0xffffffffffffffff, even if gdb to use 64-bits for CORE_ADDR internally.
Does that work correctly?
Thanks,
Pedro Alves