mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
add disassembler that fits in with old compiler tower
* module/language/assembly/Makefile.am: * module/language/assembly/disassemble.scm: Add a disassembler, based on the old one but fitting in with the decompiler tower. * module/language/objcode/spec.scm (decompile-value): When decompiling programs, shove all the metadata that we know about into the "env". * module/system/base/compile.scm (decompile-fold, decompile): Return the env from `decompile' as a second value. Not sure if `compile' should do this too.
This commit is contained in:
parent
7b107cceb9
commit
d7236899f5
4 changed files with 201 additions and 7 deletions
|
@ -46,8 +46,25 @@
|
|||
(define (decompile-value x env opts)
|
||||
(cond
|
||||
((program? x)
|
||||
(values (program-objcode x)
|
||||
(cons (program-objects x) (program-externals x))))
|
||||
(let ((objs (program-objects x))
|
||||
(meta (program-meta x))
|
||||
(exts (program-external x))
|
||||
(binds (program-bindings x))
|
||||
(srcs (program-sources x))
|
||||
(nargs (arity:nargs (program-arity x))))
|
||||
(let ((blocs (and binds
|
||||
(append (list-head binds nargs)
|
||||
(filter (lambda (x) (not (binding:extp x)))
|
||||
(list-tail binds nargs)))))
|
||||
(bexts (and binds
|
||||
(filter binding:extp binds))))
|
||||
(values (program-objcode x)
|
||||
`((objects . ,objs)
|
||||
(meta . ,(and meta (meta)))
|
||||
(exts . ,exts)
|
||||
(blocs . ,blocs)
|
||||
(bexts . ,bexts)
|
||||
(sources . ,srcs))))))
|
||||
((objcode? x)
|
||||
(values x #f))
|
||||
(else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue