This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix memory-region overlapping checking
On Thursday, August 02, 2012 02:10:40 PM Wei-cheng Wang wrote:
> Hi,
>
> After adding a memory-region with <hi addr> as max CORE_ADDR+1,
> no more memory-region can be added. It always complains about
> "overlapping"
Thanks for reporting this problem, and drafting a patch to fix it.
>
> For example,
>
> (gdb) mem 0x50 0x80 ro
> (gdb) mem 0xffffff00 0x100000000 ro
However, the real problem is that we don't do range checking for inputs in
command 'mem'. The expected behavior is, on a 32-bit target, when user types
0x100000000, gdb should emit an error saying that it is out of the range of
CORE_ADDR, or something like that.
> (gdb) info mem
> Using user-defined memory regions.
> Num Enb Low Addr High Addr Attrs
> 1 y 0x00000050 0x00000080 ro nocache
> 2 y 0xffffff00 0x100000000 ro nocache
> (gdb) mem 0x100 0x200 ro
> overlapping memory region
>
> When checking whether the new memory-region includes a previous one,
> it should take care special case, where hi == 0 means max CORE_ADDR+1.
The case you gave works well on my x86_64-linux.
--
Yao (éå)