}
+static void print_unknown(lispobj obj)
+{
+ printf("unknown object: %p", (void *)obj);
+}
+
static void brief_fixnum(lispobj obj)
{
+ /* KLUDGE: Rather than update the tables in print_obj(), we
+ declare all fixnum-or-unknown tags to be fixnums and sort it
+ out here with a guard clause. */
+ if (!fixnump(obj)) return print_unknown(obj);
+
#ifndef LISP_FEATURE_ALPHA
printf("%ld", ((long)obj)>>2);
#else
static void print_fixnum(lispobj obj)
{
+ /* KLUDGE: Rather than update the tables in print_obj(), we
+ declare all fixnum-or-unknown tags to be fixnums and sort it
+ out here with a guard clause. */
+ if (!fixnump(obj)) return print_unknown(obj);
+
#ifndef LISP_FEATURE_ALPHA
printf(": %ld", ((long)obj)>>2);
#else
}
}
-#ifdef LISP_FEATURE_X86_64
-static void print_unknown(lispobj obj)
-{
- printf("unknown object: %p", (void *)obj);
-}
-#endif
-
static void print_list(lispobj obj)
{
if (!is_valid_lisp_addr((os_vm_address_t)native_pointer(obj))) {
static void brief_struct(lispobj obj)
{
- printf("#<ptr to 0x%08lx instance>",
- (unsigned long) ((struct instance *)native_pointer(obj))->slots[0]);
+ struct instance *instance = (struct instance *)native_pointer(obj);
+ if (!is_valid_lisp_addr((os_vm_address_t)instance)) {
+ printf("(invalid address)");
+ } else {
+ printf("#<ptr to 0x%08lx instance>",
+ (unsigned long) instance->slots[0]);
+ }
}
static void print_struct(lispobj obj)
struct instance *instance = (struct instance *)native_pointer(obj);
unsigned int i;
char buffer[16];
- print_obj("type: ", ((struct instance *)native_pointer(obj))->slots[0]);
- for (i = 1; i < HeaderValue(instance->header); i++) {
- sprintf(buffer, "slot %d: ", i);
- print_obj(buffer, instance->slots[i]);
+ if (!is_valid_lisp_addr((os_vm_address_t)instance)) {
+ printf("(invalid address)");
+ } else {
+ print_obj("type: ", ((struct instance *)native_pointer(obj))->slots[0]);
+ for (i = 1; i < HeaderValue(instance->header); i++) {
+ sprintf(buffer, "slot %d: ", i);
+ print_obj(buffer, instance->slots[i]);
+ }
}
}
case SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG:
case SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG:
case SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG:
-#ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG
- case SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG:
-#endif
+
+ case SIMPLE_ARRAY_UNSIGNED_FIXNUM_WIDETAG:
+
case SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG:
case SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG:
-#ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG
- case SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG:
-#endif
#ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG
case SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG:
#endif
#ifdef SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG
case SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG:
#endif
-#ifdef SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG
- case SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG:
-#endif
+
+ case SIMPLE_ARRAY_FIXNUM_WIDETAG:
+
#ifdef SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG
case SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG:
#endif
-#ifdef SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG
- case SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG:
-#endif
#ifdef SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG
case SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG:
#endif
{
#ifdef LISP_FEATURE_X86_64
static void (*verbose_fns[])(lispobj obj)
- = {print_fixnum, print_struct, print_otherimm, print_unknown,
- print_unknown, print_unknown, print_otherimm, print_list,
- print_fixnum, print_otherptr, print_otherimm, print_unknown,
- print_unknown, print_unknown, print_otherimm, print_otherptr};
+ = {print_fixnum, print_otherimm, print_fixnum, print_struct,
+ print_fixnum, print_otherimm, print_fixnum, print_list,
+ print_fixnum, print_otherimm, print_fixnum, print_otherptr,
+ print_fixnum, print_otherimm, print_fixnum, print_otherptr};
static void (*brief_fns[])(lispobj obj)
- = {brief_fixnum, brief_struct, brief_otherimm, print_unknown,
- print_unknown, print_unknown, brief_otherimm, brief_list,
- brief_fixnum, brief_otherptr, brief_otherimm, print_unknown,
- print_unknown, print_unknown,brief_otherimm, brief_otherptr};
+ = {brief_fixnum, brief_otherimm, brief_fixnum, brief_struct,
+ brief_fixnum, brief_otherimm, brief_fixnum, brief_list,
+ brief_fixnum, brief_otherimm, brief_fixnum, brief_otherptr,
+ brief_fixnum, brief_otherimm, brief_fixnum, brief_otherptr};
#else
static void (*verbose_fns[])(lispobj obj)
= {print_fixnum, print_struct, print_otherimm, print_list,
if (var != NULL && var_clock(var) == cur_clock)
dont_descend = 1;
- if (var == NULL &&
- ((obj & LOWTAG_MASK) == FUN_POINTER_LOWTAG ||
- (obj & LOWTAG_MASK) == LIST_POINTER_LOWTAG ||
- (obj & LOWTAG_MASK) == INSTANCE_POINTER_LOWTAG ||
- (obj & LOWTAG_MASK) == OTHER_POINTER_LOWTAG))
+ if (var == NULL && is_lisp_pointer(obj))
var = define_var(NULL, obj, 0);
if (var != NULL)