diff options
Diffstat (limited to 'module/system/repl/command.scm')
-rw-r--r-- | module/system/repl/command.scm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm index 1a6f72a66..215451ec7 100644 --- a/module/system/repl/command.scm +++ b/module/system/repl/command.scm @@ -484,14 +484,21 @@ Run the optimizer on a piece of code and print the result." (define (guile:disassemble x) ((@ (language assembly disassemble) disassemble) x)) +(define (disassemble-program x) + ((@ (system vm disassembler) disassemble-program) x)) + (define-meta-command (disassemble repl (form)) "disassemble EXP Disassemble a compiled procedure." (let ((obj (repl-eval repl (repl-parse repl form)))) - (if (or (program? obj) (objcode? obj)) - (guile:disassemble obj) - (format #t "Argument to ,disassemble not a procedure or objcode: ~a~%" - obj)))) + (cond + ((rtl-program? obj) + (disassemble-program obj)) + ((or (program? obj) (objcode? obj)) + (guile:disassemble obj)) + (else + (format #t "Argument to ,disassemble not a procedure or objcode: ~a~%" + obj))))) (define-meta-command (disassemble-file repl file) "disassemble-file FILE |