This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Small memattr fix
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Don Howard <dhoward at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 31 May 2002 13:21:16 -0400
- Subject: Re: [RFA] Small memattr fix
- References: <Pine.LNX.4.33.0205301759350.8589-100000@theotherone>
> The following patch fixes gdb's bogus complaint that
>
> mem 0x0 0x04 ...
>
> overlaps with
>
> mem 0x4 0x08 ...
Hmm, checking:
http://sources.redhat.com/gdb/current/onlinedocs/gdb_9.html#IDX375
it indicates that the upper bound is exclusive (see under `info mem') so
yes definitly, good catch.
Perhaphs [separate problem] the doco should mention this earlier and
more clearly?
enjoy,
Andrew
> 2002-05-30 Don Howard <dhoward@redhat.com>
>
> * memattr.c (create_mem_region): Don't include upper address in
> test for overlapping mem regions.
>
> Index: memattr.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/memattr.c,v
> retrieving revision 2.5.22.1
> diff -p -u -w -r2.5.22.1 memattr.c
> --- memattr.c 2002/02/05 00:31:36 2.5.22.1
> +++ memattr.c 2002/05/31 00:55:20
> @@ -55,8 +55,8 @@ create_mem_region (CORE_ADDR lo, CORE_AD
> while (n)
> {
> /* overlapping node */
> - if ((lo >= n->lo && lo <= n->hi) ||
> - (hi >= n->lo && hi <= n->hi))
> + if ((lo >= n->lo && lo < n->hi) ||
> + (hi > n->lo && hi <= n->hi))
> {
> printf_unfiltered ("overlapping memory region\n");
> return NULL;