# HG changeset patch # User Karl Heuer # Date 790549790 0 # Node ID a15a058ec779e67d660bfc9b9d454027970bde98 # Parent 24756aef26e37caa40086db7ffcc2f074ce61dd9 (print): Print internal types too, for debugging. Print appropriate message for invalid pseudovector or misc type. diff -r 24756aef26e3 -r a15a058ec779 src/print.c --- a/src/print.c Thu Jan 19 18:56:43 1995 +0000 +++ b/src/print.c Thu Jan 19 21:09:50 1995 +0000 @@ -977,6 +977,8 @@ PRINTCHAR ('#'); size &= PSEUDOVECTOR_SIZE_MASK; } + if (size & PSEUDOVECTOR_FLAG) + goto badtype; PRINTCHAR ('['); { @@ -995,8 +997,9 @@ #ifndef standalone case Lisp_Misc: - if (MARKERP (obj)) + switch (XMISC (obj)->type) { + case Lisp_Misc_Marker: strout ("#buffer)) strout ("in no buffer", -1, printcharfun); @@ -1009,9 +1012,8 @@ } PRINTCHAR ('>'); break; - } - else if (OVERLAYP (obj)) - { + + case Lisp_Misc_Overlay: strout ("#buffer)) strout ("in no buffer", -1, printcharfun); @@ -1026,16 +1028,76 @@ } PRINTCHAR ('>'); break; + + /* Remaining cases shouldn't happen in normal usage, but let's print + them anyway for the benefit of the debugger. */ + case Lisp_Misc_Free: + strout ("#", -1, printcharfun); + break; + + case Lisp_Misc_Intfwd: + sprintf (buf, "#", *XINTFWD (obj)->intvar); + strout (buf, -1, printcharfun); + break; + + case Lisp_Misc_Boolfwd: + sprintf (buf, "#", + (*XBOOLFWD (obj)->boolvar ? "t" : "nil")); + strout (buf, -1, printcharfun); + break; + + case Lisp_Misc_Objfwd: + strout (buf, "#objvar, printcharfun, escapeflag); + PRINTCHAR ('>'); + break; + + case Lisp_Misc_Buffer_Objfwd: + strout (buf, "#offset), + printcharfun, escapeflag); + PRINTCHAR ('>'); + break; + + case Lisp_Misc_Buffer_Local_Value: + strout ("#car, printcharfun, escapeflag); + strout ("[buffer] ", -1, printcharfun); + print (XCONS (XBUFFER_LOCAL_VALUE (obj)->cdr)->car, + printcharfun, escapeflag); + strout ("[alist-elt] ", -1, printcharfun); + print (XCONS (XCONS (XBUFFER_LOCAL_VALUE (obj)->cdr)->cdr)->car, + printcharfun, escapeflag); + strout ("[default-value] ", -1, printcharfun); + print (XCONS (XCONS (XBUFFER_LOCAL_VALUE (obj)->cdr)->cdr)->cdr, + printcharfun, escapeflag); + PRINTCHAR ('>'); + break; + + default: + goto badtype; } - /* Other cases fall through to get an error. */ + break; #endif /* standalone */ default: + badtype: { /* We're in trouble if this happens! Probably should just abort () */ strout ("#type); + else if (VECTORLIKEP (obj)) + sprintf (buf, "(PVEC 0x%08x)", (int) XVECTOR (obj)->size); + else + sprintf (buf, "(0x%02x)", (int) XTYPE (obj)); strout (buf, -1, printcharfun); strout (" Save your buffers immediately and please report this bug>", -1, printcharfun);