Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix memory-region overlapping checking
@ 2012-08-02  6:11 Wei-cheng Wang
  2012-08-02  8:10 ` Yao Qi
  2012-08-03 10:54 ` Yao Qi
  0 siblings, 2 replies; 14+ messages in thread
From: Wei-cheng Wang @ 2012-08-02  6:11 UTC (permalink / raw)
  To: gdb-patches

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"

  For example,

(gdb) mem 0x50 0x80 ro
(gdb) mem 0xffffff00 0x100000000 ro
(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.

Wei-cheng

2012-08-02  Wei-cheng Wang  <cole945@gmail.com>

	* memattr.c (create_mem_region): Fix memory-region overlapping checking
	in special case.

diff --git a/gdb/memattr.c b/gdb/memattr.c
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -207,7 +207,7 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,

       if ((lo >= n->lo && (lo < n->hi || n->hi == 0))
 	  || (hi > n->lo && (hi <= n->hi || n->hi == 0))
-	  || (lo <= n->lo && (hi >= n->hi || hi == 0)))
+	  || (lo <= n->lo && ((hi >= n->hi && n->hi != 0) || hi == 0)))
 	{
 	  printf_unfiltered (_("overlapping memory region\n"));
 	  return;


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-08-27  8:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02  6:11 [PATCH] Fix memory-region overlapping checking Wei-cheng Wang
2012-08-02  8:10 ` Yao Qi
2012-08-02 10:00   ` Wei-cheng Wang
2012-08-03 10:54 ` Yao Qi
2012-08-07  2:35   ` Wei-cheng Wang
2012-08-07  2:48     ` Yao Qi
2012-08-07  6:02       ` Wei-cheng Wang
2012-08-08 10:31         ` Yao Qi
2012-08-16 10:03           ` Wei-cheng Wang
2012-08-24 11:18             ` Pedro Alves
2012-08-24 11:47               ` Wei-cheng Wang
2012-08-24 15:12                 ` Pedro Alves
2012-08-27  2:22                   ` Wei-cheng Wang
2012-08-27  8:58                     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox