/* Memory attributes support, for GDB.
- Copyright 2001 Free Software Foundation, Inc.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
{
MEM_RW, /* mode */
MEM_WIDTH_UNSPECIFIED,
- false, /* hwbreak */
- false, /* cache */
- false /* verify */
+ 0, /* hwbreak */
+ 0, /* cache */
+ 0 /* verify */
};
static struct mem_region *mem_region_chain = NULL;
{
struct mem_region *n, *new;
- if (lo > hi)
+ /* lo == hi is a useless empty region */
+ if (lo >= hi)
{
- printf_unfiltered ("invalid memory region\n");
+ printf_unfiltered ("invalid memory region: low >= high\n");
return NULL;
}
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;
#if 0
else if (strcmp (tok, "hwbreak") == 0)
- attrib.hwbreak = true;
+ attrib.hwbreak = 1;
else if (strcmp (tok, "swbreak") == 0)
- attrib.hwbreak = false;
+ attrib.hwbreak = 0;
#endif
else if (strcmp (tok, "cache") == 0)
- attrib.cache = true;
+ attrib.cache = 1;
else if (strcmp (tok, "nocache") == 0)
- attrib.cache = false;
+ attrib.cache = 0;
#if 0
else if (strcmp (tok, "verify") == 0)
- attrib.verify = true;
+ attrib.verify = 1;
else if (strcmp (tok, "noverify") == 0)
- attrib.verify = false;
+ attrib.verify = 0;
#endif
else
m->number,
m->enabled_p ? 'y' : 'n');
if (TARGET_ADDR_BIT <= 32)
- tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "08l");
+ tmp = local_hex_string_custom ((unsigned long) m->lo, "08l");
else
- tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "016l");
+ tmp = local_hex_string_custom ((unsigned long) m->lo, "016l");
printf_filtered ("%s ", tmp);
if (TARGET_ADDR_BIT <= 32)
- tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "08l");
+ tmp = local_hex_string_custom ((unsigned long) m->hi, "08l");
else
- tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "016l");
+ tmp = local_hex_string_custom ((unsigned long) m->hi, "016l");
printf_filtered ("%s ", tmp);