[Git][cmucl/cmucl][issue-192-disassemble-prints-radix-marker] Add *disassemble-print-radix* as the default for :radix

Raymond Toy (@rtoy) gitlab at common-lisp.net
Fri Apr 28 14:23:06 UTC 2023



Raymond Toy pushed to branch issue-192-disassemble-prints-radix-marker at cmucl / cmucl


Commits:
c662da73 by Raymond Toy at 2023-04-28T07:20:34-07:00
Add *disassemble-print-radix* as the default for :radix

Export this symbol too to make it clear that this is the API and
we're allowing users to modify this.

Update `disassemble` docstring to mention `disassem:disasemble`.

- - - - -


4 changed files:

- src/code/exports.lisp
- src/code/misc.lisp
- src/compiler/disassem.lisp
- src/i18n/locale/cmucl.pot


Changes:

=====================================
src/code/exports.lisp
=====================================
@@ -1368,7 +1368,9 @@
   (:export "*NOTE-COLUMN*" "*OPCODE-COLUMN-WIDTH*" "ADD-COMMENT-HOOK"
 	   "ADD-HOOK" "ADD-NOTE-HOOK" "ARG-VALUE" "CREATE-DSTATE"
 	   "DISASSEM-STATE" "DISASSEMBLE" "DISASSEMBLE-CODE-COMPONENT"
-	   "DISASSEMBLE-FUNCTION" "DISASSEMBLE-MEMORY" "DISASSEMBLE-SEGMENT"
+	   "DISASSEMBLE-FUNCTION" "DISASSEMBLE-MEMORY"
+	   "*DISASSEMBLE-PRINT-RADIX*"
+	   "DISASSEMBLE-SEGMENT"
 	   "DISASSEMBLE-SEGMENTS" "DSTATE-CODE" "DSTATE-CURPOS"
 	   "DSTATE-GET-PROP" "DSTATE-NEXTPOS" "DSTATE-SEGMENT-LENGTH"
 	   "DSTATE-SEGMENT-SAP" "DSTATE-SEGMENT-START" "FIELD-TYPE"


=====================================
src/code/misc.lisp
=====================================
@@ -181,5 +181,7 @@
   "Disassemble the machine code associated with OBJECT, which can be a
   function, a lambda expression, or a symbol with a function definition.  If
   it is not already compiled, the compiler is called to produce something to
-  disassemble."
+  disassemble.
+
+  Also see disassem:disassemble for finer control of disassembly."
   (disassem:disassemble object))


=====================================
src/compiler/disassem.lisp
=====================================
@@ -3318,12 +3318,16 @@
 		:format-control (intl:gettext "Can't make a compiled function from ~S")
 		:format-arguments (list name)))))
 
+(defvar *disassemble-print-radix*
+  t
+  "Default value for :radix argument for disassem:disassemble")
+
 (defun disassemble (object &key (stream *standard-output*)
 			     (use-labels t)
 			     (backend c:*native-backend*)
 			     (base 16)
 			     (case :downcase)
-			     (radix t))
+			     (radix *disassemble-print-radix*))
   "Disassemble the machine code associated with OBJECT, which can be a
   function, a lambda expression, or a symbol with a function definition.  If
   it is not already compiled, the compiler is called to produce something to
@@ -3338,7 +3342,7 @@
   :Radix
       The disassembler uses the specified base, case, and radix when
       printing the disassembled code.  The default values are 16,
-      :downcase, and T, respectively."
+      :downcase, and *disassemble-print-radix*, respectively."
   (declare (type (or function symbol cons) object)
 	   (type (or (member t) stream) stream)
 	   (type (member t nil) use-labels)


=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -5694,7 +5694,9 @@ msgid ""
 "If\n"
 "  it is not already compiled, the compiler is called to produce something "
 "to\n"
-"  disassemble."
+"  disassemble.\n"
+"\n"
+"  Also see disassem:disassemble for finer control of disassembly."
 msgstr ""
 
 #: src/code/misc-doc.lisp
@@ -17387,6 +17389,10 @@ msgstr ""
 msgid "Can't make a compiled function from ~S"
 msgstr ""
 
+#: src/compiler/disassem.lisp
+msgid "Default value for :radix argument for disassem:disassemble"
+msgstr ""
+
 #: src/compiler/disassem.lisp
 msgid ""
 "Disassemble the machine code associated with OBJECT, which can be a\n"
@@ -17405,7 +17411,7 @@ msgid ""
 "  :Radix\n"
 "      The disassembler uses the specified base, case, and radix when\n"
 "      printing the disassembled code.  The default values are 16,\n"
-"      :downcase, and T, respectively."
+"      :downcase, and *disassemble-print-radix*, respectively."
 msgstr ""
 
 #: src/compiler/disassem.lisp



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c662da73c4ea1e29e947b92f3f2db5729f506d95

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c662da73c4ea1e29e947b92f3f2db5729f506d95
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20230428/a7acf9d9/attachment-0001.html>


More information about the cmucl-cvs mailing list