mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
fix error message on ,disassemble "non-procedure"
* module/language/objcode/spec.scm (decompile-value): Don't assume that `error' will handle format strings appropriately. * module/system/repl/command.scm (disassemble): A more human error when you disassemble a non-procedure. Bug reported by Andrew Horton.
This commit is contained in:
parent
2460274d36
commit
fb6df3ea13
2 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;; Guile Lowlevel Intermediate Language
|
;;; Guile Lowlevel Intermediate Language
|
||||||
|
|
||||||
;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
|
;; Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
((objcode? x)
|
((objcode? x)
|
||||||
(values x #f))
|
(values x #f))
|
||||||
(else
|
(else
|
||||||
(error "can't decompile ~A: not a program or objcode" x))))
|
(error "Object for disassembly not a program or objcode" x))))
|
||||||
|
|
||||||
(define-language objcode
|
(define-language objcode
|
||||||
#:title "Guile Object Code"
|
#:title "Guile Object Code"
|
||||||
|
|
|
@ -465,7 +465,11 @@ Compile a file."
|
||||||
(define-meta-command (disassemble repl (form))
|
(define-meta-command (disassemble repl (form))
|
||||||
"disassemble EXP
|
"disassemble EXP
|
||||||
Disassemble a compiled procedure."
|
Disassemble a compiled procedure."
|
||||||
(guile:disassemble (repl-eval repl (repl-parse repl form))))
|
(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))))
|
||||||
|
|
||||||
(define-meta-command (disassemble-file repl file)
|
(define-meta-command (disassemble-file repl file)
|
||||||
"disassemble-file FILE
|
"disassemble-file FILE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue