2005-11-19 Jim Blandy <jimb@redhat.com>
+ * tracepoint.c (memrange_absolute): New enum constant.
+ (struct memrange, memrange_cmp, add_memrange, collect_symbol,
+ stringify_collection_list, encode_actions): Use it instead of '-1'
+ to indicate an fixed-address memory range.
+ (Suggested by Eli Zaretskii.)
+
* tracepoint.c (stringify_collection_list): Indicate absolute
memory ranges by using "-1" as the memory range's base register
number, not "FFFFFFFF".
return make_cleanup (do_free_actions_cleanup, t);
}
+enum {
+ memrange_absolute = -1
+};
+
struct memrange
{
- int type; /* -1 for absolute memory range, else basereg number */
+ int type; /* memrange_absolute for absolute memory range,
+ else basereg number */
bfd_signed_vma start;
bfd_signed_vma end;
};
return -1;
if (a->type > b->type)
return 1;
- if (a->type == 0)
+ if (a->type == memrange_absolute)
{
if ((bfd_vma) a->start < (bfd_vma) b->start)
return -1;
printf_filtered (",%ld)\n", len);
}
- /* type: -1 == memory, n == basereg */
+ /* type: memrange_absolute == memory, other n == basereg */
memranges->list[memranges->next_memrange].type = type;
/* base: addr if memory, offset if reg relative. */
memranges->list[memranges->next_memrange].start = base;
memranges->listsize);
}
- if (type != -1) /* Better collect the base register! */
+ if (type != memrange_absolute) /* Better collect the base register! */
add_register (memranges, type);
}
DEPRECATED_SYMBOL_NAME (sym), len,
tmp /* address */);
}
- add_memrange (collect, -1, offset, len); /* -1 == memory */
+ add_memrange (collect, memrange_absolute, offset, len);
break;
case LOC_REGISTER:
case LOC_REGPARM:
bfd_signed_vma length = list->list[i].end - list->list[i].start;
/* The "%X" conversion specifier expects an unsigned argument,
- so passing -1 to it directly gives you "FFFFFFFF" (or more,
- depending on sizeof (unsigned)). Special-case it. */
- if (list->list[i].type == -1)
+ so passing -1 (memrange_absolute) to it directly gives you
+ "FFFFFFFF" (or more, depending on sizeof (unsigned)).
+ Special-case it. */
+ if (list->list[i].type == memrange_absolute)
sprintf (end, "M-1,%s,%lX", tmp2, (long) length);
else
sprintf (end, "M%X,%s,%lX", list->list[i].type, tmp2, (long) length);
tempval = evaluate_expression (exp);
addr = VALUE_ADDRESS (tempval) + value_offset (tempval);
len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
- add_memrange (collect, -1, addr, len);
+ add_memrange (collect, memrange_absolute, addr, len);
break;
case OP_VAR_VALUE: