From df54cca124aa142fd222be24824b4e5320fa455e Mon Sep 17 00:00:00 2001 From: Alexey Dejneka Date: Sun, 8 Jun 2003 09:30:01 +0000 Subject: [PATCH] 0.8.0.49: Added support of disassembling of closures and funcallable instances. --- NEWS | 1 + src/compiler/target-disassem.lisp | 12 +++++++++--- version.lisp-expr | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 8db8676..e808be2 100644 --- a/NEWS +++ b/NEWS @@ -1822,6 +1822,7 @@ changes in sbcl-0.8.1 relative to sbcl-0.8.0: values of the arguments, even in the presence of assignment. ** functions [N]SUBST*, LAST, NRECONC, [N]SUBLIS may return any object. + ** DISASSEMBLE works with closures and funcallable instances. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/compiler/target-disassem.lisp b/src/compiler/target-disassem.lisp index 6e247fc..c9fdf0f 100644 --- a/src/compiler/target-disassem.lisp +++ b/src/compiler/target-disassem.lisp @@ -290,9 +290,15 @@ (declare (type compiled-function fun)) (sb!kernel:%simple-fun-next fun)) -(defun fun-address (function) - (declare (type compiled-function function)) - (- (sb!kernel:get-lisp-obj-address function) sb!vm:fun-pointer-lowtag)) +(defun fun-address (fun) + (declare (type compiled-function fun)) + (ecase (sb!kernel:widetag-of fun) + (#.sb!vm:simple-fun-header-widetag + (- (sb!kernel:get-lisp-obj-address fun) sb!vm:fun-pointer-lowtag)) + (#.sb!vm:closure-header-widetag + (fun-address (sb!kernel:%closure-fun fun))) + (#.sb!vm:funcallable-instance-header-widetag + (fun-address (sb!kernel:funcallable-instance-fun fun))))) ;;; the offset of FUNCTION from the start of its code-component's ;;; instruction area diff --git a/version.lisp-expr b/version.lisp-expr index bdbafaa..c72f7ab 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.0.48" +"0.8.0.49" -- 1.7.10.4