1.0.32.12: Fix slot-value on specialized parameters in SVUC methods
[sbcl.git] / src / runtime / print.c
1 /* code for low-level debugging/diagnostic output */
2
3 /*
4  * This software is part of the SBCL system. See the README file for
5  * more information.
6  *
7  * This software is derived from the CMU CL system, which was
8  * written at Carnegie Mellon University and released into the
9  * public domain. The software is in the public domain and is
10  * provided with absolutely no warranty. See the COPYING and CREDITS
11  * files for more information.
12  */
13
14 /*
15  * FIXME:
16  *   Some of the code in here (the various
17  *   foo_slots[], at least) is deeply broken, depending on guessing
18  *   already out-of-date values instead of getting them from sbcl.h.
19  */
20
21 #include <stdio.h>
22 #include <string.h>
23
24 #include "sbcl.h"
25 #include "print.h"
26 #include "runtime.h"
27
28 /* This file can be skipped if we're not supporting LDB. */
29 #if defined(LISP_FEATURE_SB_LDB)
30
31 #include "monitor.h"
32 #include "vars.h"
33 #include "os.h"
34 #include "gencgc-alloc-region.h" /* genesis/thread.h needs this */
35 #include "genesis/static-symbols.h"
36 #include "genesis/primitive-objects.h"
37 #include "genesis/static-symbols.h"
38 #include "genesis/tagnames.h"
39
40 static int max_lines = 20, cur_lines = 0;
41 static int max_depth = 5, brief_depth = 2, cur_depth = 0;
42 static int max_length = 5;
43 static boolean dont_descend = 0, skip_newline = 0;
44 static int cur_clock = 0;
45
46 static void print_obj(char *prefix, lispobj obj);
47
48 #define NEWLINE_OR_RETURN if (continue_p(1)) newline(NULL); else return;
49
50 static void indent(int in)
51 {
52     static char *spaces = "                                                                ";
53
54     while (in > 64) {
55         fputs(spaces, stdout);
56         in -= 64;
57     }
58     if (in != 0)
59         fputs(spaces + 64 - in, stdout);
60 }
61
62 static boolean continue_p(boolean newline)
63 {
64     char buffer[256];
65
66     if (cur_depth >= max_depth || dont_descend)
67         return 0;
68
69     if (newline) {
70         if (skip_newline)
71             skip_newline = 0;
72         else
73             putchar('\n');
74
75         if (cur_lines >= max_lines) {
76             printf("More? [y] ");
77             fflush(stdout);
78
79             if (fgets(buffer, sizeof(buffer), stdin)) {
80                 if (buffer[0] == 'n' || buffer[0] == 'N')
81                     throw_to_monitor();
82                 else
83                     cur_lines = 0;
84             } else {
85                 printf("\nUnable to read response, assuming y.\n");
86                 cur_lines = 0;
87             }
88         }
89     }
90
91     return 1;
92 }
93
94 static void newline(char *label)
95 {
96     cur_lines++;
97     if (label != NULL)
98         fputs(label, stdout);
99     putchar('\t');
100     indent(cur_depth * 2);
101 }
102
103
104 static void brief_fixnum(lispobj obj)
105 {
106 #ifndef LISP_FEATURE_ALPHA
107     printf("%ld", ((long)obj)>>2);
108 #else
109     printf("%d", ((s32)obj)>>2);
110 #endif
111 }
112
113 static void print_fixnum(lispobj obj)
114 {
115 #ifndef LISP_FEATURE_ALPHA
116     printf(": %ld", ((long)obj)>>2);
117 #else
118     printf(": %d", ((s32)obj)>>2);
119 #endif
120 }
121
122 static void brief_otherimm(lispobj obj)
123 {
124     int type, c;
125     char buffer[10];
126
127     type = widetag_of(obj);
128     switch (type) {
129         case CHARACTER_WIDETAG:
130             c = (obj>>8)&0xff;
131             switch (c) {
132                 case '\0':
133                     printf("#\\Null");
134                     break;
135                 case '\n':
136                     printf("#\\Newline");
137                     break;
138                 case '\b':
139                     printf("#\\Backspace");
140                     break;
141                 case '\177':
142                     printf("#\\Delete");
143                     break;
144                 default:
145                     strcpy(buffer, "#\\");
146                     if (c >= 128) {
147                         strcat(buffer, "m-");
148                         c -= 128;
149                     }
150                     if (c < 32) {
151                         strcat(buffer, "c-");
152                         c += '@';
153                     }
154                     printf("%s%c", buffer, c);
155                     break;
156             }
157             break;
158
159         case UNBOUND_MARKER_WIDETAG:
160             printf("<unbound marker>");
161             break;
162
163         default:
164             printf("%s", widetag_names[type >> 2]);
165             break;
166     }
167 }
168
169 static void print_otherimm(lispobj obj)
170 {
171     printf(", %s", widetag_names[widetag_of(obj) >> 2]);
172
173     switch (widetag_of(obj)) {
174         case CHARACTER_WIDETAG:
175             printf(": ");
176             brief_otherimm(obj);
177             break;
178
179         case SAP_WIDETAG:
180         case UNBOUND_MARKER_WIDETAG:
181             break;
182
183         default:
184             printf(": data=%ld", (long) (obj>>8)&0xffffff);
185             break;
186     }
187 }
188
189 static void brief_list(lispobj obj)
190 {
191     int space = 0;
192     int length = 0;
193
194     if (!is_valid_lisp_addr((os_vm_address_t)native_pointer(obj)))
195         printf("(invalid Lisp-level address)");
196     else if (obj == NIL)
197         printf("NIL");
198     else {
199         putchar('(');
200         while (lowtag_of(obj) == LIST_POINTER_LOWTAG) {
201             struct cons *cons = (struct cons *)native_pointer(obj);
202
203             if (space)
204                 putchar(' ');
205             if (++length >= max_length) {
206                 printf("...");
207                 obj = NIL;
208                 break;
209             }
210             print_obj("", cons->car);
211             obj = cons->cdr;
212             space = 1;
213             if (obj == NIL)
214                 break;
215         }
216         if (obj != NIL) {
217             printf(" . ");
218             print_obj("", obj);
219         }
220         putchar(')');
221     }
222 }
223
224 #ifdef LISP_FEATURE_X86_64
225 static void print_unknown(lispobj obj)
226 {
227   printf("unknown object: %p", (void *)obj);
228 }
229 #endif
230
231 static void print_list(lispobj obj)
232 {
233     if (!is_valid_lisp_addr((os_vm_address_t)native_pointer(obj))) {
234         printf("(invalid address)");
235     } else if (obj == NIL) {
236         printf(" (NIL)");
237     } else {
238         struct cons *cons = (struct cons *)native_pointer(obj);
239
240         print_obj("car: ", cons->car);
241         print_obj("cdr: ", cons->cdr);
242     }
243 }
244
245 static void brief_struct(lispobj obj)
246 {
247     printf("#<ptr to 0x%08lx instance>",
248            (unsigned long) ((struct instance *)native_pointer(obj))->slots[0]);
249 }
250
251 static void print_struct(lispobj obj)
252 {
253     struct instance *instance = (struct instance *)native_pointer(obj);
254     unsigned int i;
255     char buffer[16];
256     print_obj("type: ", ((struct instance *)native_pointer(obj))->slots[0]);
257     for (i = 1; i < HeaderValue(instance->header); i++) {
258         sprintf(buffer, "slot %d: ", i);
259         print_obj(buffer, instance->slots[i]);
260     }
261 }
262
263 static void brief_otherptr(lispobj obj)
264 {
265     lispobj *ptr, header;
266     int type;
267     struct symbol *symbol;
268     struct vector *vector;
269     char *charptr;
270
271     ptr = (lispobj *) native_pointer(obj);
272
273     if (!is_valid_lisp_addr((os_vm_address_t)obj)) {
274             printf("(invalid address)");
275             return;
276     }
277
278     header = *ptr;
279     type = widetag_of(header);
280     switch (type) {
281         case SYMBOL_HEADER_WIDETAG:
282             symbol = (struct symbol *)ptr;
283             vector = (struct vector *)native_pointer(symbol->name);
284             for (charptr = (char *)vector->data; *charptr != '\0'; charptr++) {
285                 if (*charptr == '"')
286                     putchar('\\');
287                 putchar(*charptr);
288             }
289             break;
290
291         case SIMPLE_BASE_STRING_WIDETAG:
292             vector = (struct vector *)ptr;
293             putchar('"');
294             for (charptr = (char *)vector->data; *charptr != '\0'; charptr++) {
295                 if (*charptr == '"')
296                     putchar('\\');
297                 putchar(*charptr);
298             }
299             putchar('"');
300             break;
301
302         default:
303             printf("#<ptr to ");
304             brief_otherimm(header);
305             putchar('>');
306     }
307 }
308
309 static void print_slots(char **slots, int count, lispobj *ptr)
310 {
311     while (count-- > 0) {
312         if (*slots) {
313             print_obj(*slots++, *ptr++);
314         } else {
315             print_obj("???: ", *ptr++);
316         }
317     }
318 }
319
320 /* FIXME: Yikes! This needs to depend on the values in sbcl.h (or
321  * perhaps be generated automatically by GENESIS as part of
322  * sbcl.h). */
323 static char *symbol_slots[] = {"value: ", "hash: ",
324     "plist: ", "name: ", "package: ",
325 #ifdef LISP_FEATURE_SB_THREAD
326     "tls-index: " ,
327 #endif
328     NULL};
329 static char *ratio_slots[] = {"numer: ", "denom: ", NULL};
330 static char *complex_slots[] = {"real: ", "imag: ", NULL};
331 static char *code_slots[] = {"words: ", "entry: ", "debug: ", NULL};
332 static char *fn_slots[] = {
333     "self: ", "next: ", "name: ", "arglist: ", "type: ", NULL};
334 static char *closure_slots[] = {"fn: ", NULL};
335 static char *funcallable_instance_slots[] = {"fn: ", "lexenv: ", "layout: ", NULL};
336 static char *weak_pointer_slots[] = {"value: ", NULL};
337 static char *fdefn_slots[] = {"name: ", "function: ", "raw_addr: ", NULL};
338 static char *value_cell_slots[] = {"value: ", NULL};
339
340 static void print_otherptr(lispobj obj)
341 {
342     if (!is_valid_lisp_addr((os_vm_address_t)obj)) {
343         printf("(invalid address)");
344     } else {
345 #ifndef LISP_FEATURE_ALPHA
346         lispobj *ptr;
347         unsigned long header;
348         unsigned long length;
349 #else
350         u32 *ptr;
351         u32 header;
352         u32 length;
353 #endif
354         int count, type, index;
355         char *cptr, buffer[16];
356
357         ptr = (lispobj*) native_pointer(obj);
358         if (ptr == NULL) {
359                 printf(" (NULL Pointer)");
360                 return;
361         }
362
363         header = *ptr++;
364         length = fixnum_value(*ptr);
365         count = HeaderValue(header);
366         type = widetag_of(header);
367
368         print_obj("header: ", header);
369         if (!other_immediate_lowtag_p(header)) {
370             NEWLINE_OR_RETURN;
371             printf("(invalid header object)");
372             return;
373         }
374
375         switch (type) {
376             case BIGNUM_WIDETAG:
377                 ptr += count;
378                 NEWLINE_OR_RETURN;
379                 printf("0x");
380                 while (count-- > 0)
381                     printf("%08lx", (unsigned long) *--ptr);
382                 break;
383
384             case RATIO_WIDETAG:
385                 print_slots(ratio_slots, count, ptr);
386                 break;
387
388             case COMPLEX_WIDETAG:
389                 print_slots(complex_slots, count, ptr);
390                 break;
391
392             case SYMBOL_HEADER_WIDETAG:
393                 print_slots(symbol_slots, count, ptr);
394                 break;
395
396 #if N_WORD_BITS == 32
397             case SINGLE_FLOAT_WIDETAG:
398                 NEWLINE_OR_RETURN;
399                 printf("%g", ((struct single_float *)native_pointer(obj))->value);
400                 break;
401 #endif
402             case DOUBLE_FLOAT_WIDETAG:
403                 NEWLINE_OR_RETURN;
404                 printf("%g", ((struct double_float *)native_pointer(obj))->value);
405                 break;
406
407 #ifdef LONG_FLOAT_WIDETAG
408             case LONG_FLOAT_WIDETAG:
409                 NEWLINE_OR_RETURN;
410                 printf("%Lg", ((struct long_float *)native_pointer(obj))->value);
411                 break;
412 #endif
413
414 #ifdef COMPLEX_SINGLE_FLOAT_WIDETAG
415             case COMPLEX_SINGLE_FLOAT_WIDETAG:
416                 NEWLINE_OR_RETURN;
417 #ifdef LISP_FEATURE_X86_64
418                 printf("%g", ((struct complex_single_float *)native_pointer(obj))->data.data[0]);
419 #else
420                 printf("%g", ((struct complex_single_float *)native_pointer(obj))->real);
421 #endif
422                 NEWLINE_OR_RETURN;
423 #ifdef LISP_FEATURE_X86_64
424                 printf("%g", ((struct complex_single_float *)native_pointer(obj))->data.data[1]);
425 #else
426                 printf("%g", ((struct complex_single_float *)native_pointer(obj))->imag);
427 #endif
428                 break;
429 #endif
430
431 #ifdef COMPLEX_DOUBLE_FLOAT_WIDETAG
432             case COMPLEX_DOUBLE_FLOAT_WIDETAG:
433                 NEWLINE_OR_RETURN;
434                 printf("%g", ((struct complex_double_float *)native_pointer(obj))->real);
435                 NEWLINE_OR_RETURN;
436                 printf("%g", ((struct complex_double_float *)native_pointer(obj))->imag);
437                 break;
438 #endif
439
440 #ifdef COMPLEX_LONG_FLOAT_WIDETAG
441             case COMPLEX_LONG_FLOAT_WIDETAG:
442                 NEWLINE_OR_RETURN;
443                 printf("%Lg", ((struct complex_long_float *)native_pointer(obj))->real);
444                 NEWLINE_OR_RETURN;
445                 printf("%Lg", ((struct complex_long_float *)native_pointer(obj))->imag);
446                 break;
447 #endif
448
449             case SIMPLE_BASE_STRING_WIDETAG:
450 #ifdef SIMPLE_CHARACTER_STRING_WIDETAG
451         case SIMPLE_CHARACTER_STRING_WIDETAG: /* FIXME */
452 #endif
453                 NEWLINE_OR_RETURN;
454                 cptr = (char *)(ptr+1);
455                 putchar('"');
456                 while (length-- > 0)
457                     putchar(*cptr++);
458                 putchar('"');
459                 break;
460
461             case SIMPLE_VECTOR_WIDETAG:
462                 NEWLINE_OR_RETURN;
463                 printf("length = %ld", length);
464                 ptr++;
465                 index = 0;
466                 while (length-- > 0) {
467                     sprintf(buffer, "%d: ", index++);
468                     print_obj(buffer, *ptr++);
469                 }
470                 break;
471
472             case INSTANCE_HEADER_WIDETAG:
473                 NEWLINE_OR_RETURN;
474                 printf("length = %ld", (long) count);
475                 index = 0;
476                 while (count-- > 0) {
477                     sprintf(buffer, "%d: ", index++);
478                     print_obj(buffer, *ptr++);
479                 }
480                 break;
481
482             case SIMPLE_ARRAY_WIDETAG:
483             case SIMPLE_BIT_VECTOR_WIDETAG:
484             case SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG:
485             case SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG:
486             case SIMPLE_ARRAY_UNSIGNED_BYTE_7_WIDETAG:
487             case SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG:
488             case SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG:
489             case SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG:
490 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG
491             case SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG:
492 #endif
493             case SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG:
494             case SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG:
495 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG
496             case SIMPLE_ARRAY_UNSIGNED_BYTE_60_WIDETAG:
497 #endif
498 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG
499             case SIMPLE_ARRAY_UNSIGNED_BYTE_63_WIDETAG:
500 #endif
501 #ifdef SIMPLE_ARRAY_UNSIGNED_BYTE_64_WIDETAG
502             case SIMPLE_ARRAY_UNSIGNED_BYTE_64_WIDETAG:
503 #endif
504 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG
505             case SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG:
506 #endif
507 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG
508             case SIMPLE_ARRAY_SIGNED_BYTE_16_WIDETAG:
509 #endif
510 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG
511             case SIMPLE_ARRAY_SIGNED_BYTE_30_WIDETAG:
512 #endif
513 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG
514             case SIMPLE_ARRAY_SIGNED_BYTE_32_WIDETAG:
515 #endif
516 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG
517             case SIMPLE_ARRAY_SIGNED_BYTE_61_WIDETAG:
518 #endif
519 #ifdef SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG
520             case SIMPLE_ARRAY_SIGNED_BYTE_64_WIDETAG:
521 #endif
522             case SIMPLE_ARRAY_SINGLE_FLOAT_WIDETAG:
523             case SIMPLE_ARRAY_DOUBLE_FLOAT_WIDETAG:
524 #ifdef SIMPLE_ARRAY_LONG_FLOAT_WIDETAG
525             case SIMPLE_ARRAY_LONG_FLOAT_WIDETAG:
526 #endif
527 #ifdef SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG
528             case SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG:
529 #endif
530 #ifdef SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG
531             case SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG:
532 #endif
533 #ifdef SIMPLE_ARRAY_COMPLEX_LONG_FLOAT_WIDETAG
534             case SIMPLE_ARRAY_COMPLEX_LONG_FLOAT_WIDETAG:
535 #endif
536             case COMPLEX_BASE_STRING_WIDETAG:
537 #ifdef COMPLEX_CHARACTER_STRING_WIDETAG
538         case COMPLEX_CHARACTER_STRING_WIDETAG:
539 #endif
540             case COMPLEX_VECTOR_NIL_WIDETAG:
541             case COMPLEX_BIT_VECTOR_WIDETAG:
542             case COMPLEX_VECTOR_WIDETAG:
543             case COMPLEX_ARRAY_WIDETAG:
544                 break;
545
546             case CODE_HEADER_WIDETAG:
547                 print_slots(code_slots, count-1, ptr);
548                 break;
549
550             case SIMPLE_FUN_HEADER_WIDETAG:
551                 print_slots(fn_slots, 5, ptr);
552                 break;
553
554             case RETURN_PC_HEADER_WIDETAG:
555                 print_obj("code: ", obj - (count * 4));
556                 break;
557
558             case CLOSURE_HEADER_WIDETAG:
559                 print_slots(closure_slots, count, ptr);
560                 break;
561
562             case FUNCALLABLE_INSTANCE_HEADER_WIDETAG:
563                 print_slots(funcallable_instance_slots, count, ptr);
564                 break;
565
566             case VALUE_CELL_HEADER_WIDETAG:
567                 print_slots(value_cell_slots, 1, ptr);
568                 break;
569
570             case SAP_WIDETAG:
571                 NEWLINE_OR_RETURN;
572 #ifndef LISP_FEATURE_ALPHA
573                 printf("0x%08lx", (unsigned long) *ptr);
574 #else
575                 printf("0x%016lx", *(lispobj*)(ptr+1));
576 #endif
577                 break;
578
579             case WEAK_POINTER_WIDETAG:
580                 print_slots(weak_pointer_slots, 1, ptr);
581                 break;
582
583             case CHARACTER_WIDETAG:
584             case UNBOUND_MARKER_WIDETAG:
585                 NEWLINE_OR_RETURN;
586                 printf("pointer to an immediate?");
587                 break;
588
589             case FDEFN_WIDETAG:
590                 print_slots(fdefn_slots, count, ptr);
591                 break;
592
593             default:
594                 NEWLINE_OR_RETURN;
595                 printf("Unknown header object?");
596                 break;
597         }
598     }
599 }
600
601 static void print_obj(char *prefix, lispobj obj)
602 {
603 #ifdef LISP_FEATURE_X86_64
604     static void (*verbose_fns[])(lispobj obj)
605         = {print_fixnum, print_struct, print_otherimm, print_unknown,
606            print_unknown, print_unknown, print_otherimm, print_list,
607            print_fixnum, print_otherptr, print_otherimm, print_unknown,
608            print_unknown, print_unknown, print_otherimm, print_otherptr};
609     static void (*brief_fns[])(lispobj obj)
610         = {brief_fixnum, brief_struct, brief_otherimm, print_unknown,
611            print_unknown,  print_unknown, brief_otherimm, brief_list,
612            brief_fixnum, brief_otherptr, brief_otherimm, print_unknown,
613            print_unknown,  print_unknown,brief_otherimm, brief_otherptr};
614 #else
615     static void (*verbose_fns[])(lispobj obj)
616         = {print_fixnum, print_struct, print_otherimm, print_list,
617            print_fixnum, print_otherptr, print_otherimm, print_otherptr};
618     static void (*brief_fns[])(lispobj obj)
619         = {brief_fixnum, brief_struct, brief_otherimm, brief_list,
620            brief_fixnum, brief_otherptr, brief_otherimm, brief_otherptr};
621 #endif
622     int type = lowtag_of(obj);
623     struct var *var = lookup_by_obj(obj);
624     char buffer[256];
625     boolean verbose = cur_depth < brief_depth;
626
627     if (!continue_p(verbose))
628         return;
629
630     if (var != NULL && var_clock(var) == cur_clock)
631         dont_descend = 1;
632
633     if (var == NULL &&
634         ((obj & LOWTAG_MASK) == FUN_POINTER_LOWTAG ||
635          (obj & LOWTAG_MASK) == LIST_POINTER_LOWTAG ||
636          (obj & LOWTAG_MASK) == INSTANCE_POINTER_LOWTAG ||
637          (obj & LOWTAG_MASK) == OTHER_POINTER_LOWTAG))
638         var = define_var(NULL, obj, 0);
639
640     if (var != NULL)
641         var_setclock(var, cur_clock);
642
643     cur_depth++;
644     if (verbose) {
645         if (var != NULL) {
646             sprintf(buffer, "$%s=", var_name(var));
647             newline(buffer);
648         }
649         else
650             newline(NULL);
651         printf("%s0x%08lx: ", prefix, (unsigned long) obj);
652         if (cur_depth < brief_depth) {
653             fputs(lowtag_names[type], stdout);
654             (*verbose_fns[type])(obj);
655         }
656         else
657             (*brief_fns[type])(obj);
658     }
659     else {
660         if (dont_descend)
661             printf("$%s", var_name(var));
662         else {
663             if (var != NULL)
664                 printf("$%s=", var_name(var));
665             (*brief_fns[type])(obj);
666         }
667     }
668     cur_depth--;
669     dont_descend = 0;
670 }
671
672 void reset_printer()
673 {
674     cur_clock++;
675     cur_lines = 0;
676     dont_descend = 0;
677 }
678
679 void print(lispobj obj)
680 {
681     skip_newline = 1;
682     cur_depth = 0;
683     max_depth = 5;
684     max_lines = 20;
685
686     print_obj("", obj);
687
688     putchar('\n');
689 }
690
691 void brief_print(lispobj obj)
692 {
693     skip_newline = 1;
694     cur_depth = 0;
695     max_depth = 1;
696     max_lines = 5000;
697
698     print_obj("", obj);
699     putchar('\n');
700 }
701
702 #else
703
704 void
705 brief_print(lispobj obj)
706 {
707     printf("lispobj 0x%lx\n", (unsigned long)obj);
708 }
709
710 #endif /* defined(LISP_FEATURE_SB_LDB) */