This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Another memattr tweak


The following patch allows gdb to display upper bounds of memory regions
correctly when the upper bound wraps to zero.  A zero upper bound is a 
special case that indicates that the memory region extends to the top of 
the target's memory space.


2002-07-08  Don Howard  <dhoward@redhat.com>

	* memattr.c (mem_info_command): Print special case of upper bound
	as max CORE_ADDR + 1.

Index: memattr.c
===================================================================
RCS file: /cvs/src/src/gdb/memattr.c,v
retrieving revision 1.12
diff -p -u -w -r1.12 memattr.c
--- memattr.c	24 Jun 2002 22:08:30 -0000	1.12
+++ memattr.c	8 Jul 2002 18:35:30 -0000
@@ -235,7 +235,6 @@ mem_info_command (char *args, int from_t
 
   for (m = mem_region_chain; m; m = m->next)
     {
-      CORE_ADDR hi;
       char *tmp;
       printf_filtered ("%-3d %-3c\t",
 		       m->number,
@@ -246,12 +245,21 @@ mem_info_command (char *args, int from_t
 	tmp = local_hex_string_custom ((unsigned long) m->lo, "016l");
       
       printf_filtered ("%s ", tmp);
-      hi = (m->hi == 0 ? ~0 : m->hi);
 
       if (TARGET_ADDR_BIT <= 32)
-	tmp = local_hex_string_custom ((unsigned long) hi, "08l");
+	{
+	if (m->hi == 0)
+	  tmp = "0x100000000";
       else
-	tmp = local_hex_string_custom ((unsigned long) hi, "016l");
+	  tmp = local_hex_string_custom ((unsigned long) m->hi, "08l");
+	}
+      else
+	{
+	if (m->hi == 0)
+	  tmp = "0x10000000000000000";
+	else
+	  tmp = local_hex_string_custom ((unsigned long) m->hi, "016l");
+	}
       
       printf_filtered ("%s ", tmp);
 
-- 
dhoward@redhat.com
gdb engineering





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]