1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +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:
Andy Wingo 2009-01-30 14:12:57 +01:00
parent 7b107cceb9
commit d7236899f5
4 changed files with 201 additions and 7 deletions

View file

@ -181,12 +181,18 @@ time. Useful for supporting some forms of dynamic compilation. Returns
(or (lookup-decompilation-order from to)
(error "no way to decompile" from "to" to))))
(define (decompile-fold passes exp env opts)
(if (null? passes)
(values exp env)
(receive (exp env) ((car passes) exp env opts)
(decompile-fold (cdr passes) exp env opts))))
(define* (decompile x #:key
(env #f)
(from 'value)
(to 'assembly)
(opts '()))
(compile-fold (decompile-passes from to opts)
x
env
opts))
(decompile-fold (decompile-passes from to opts)
x
env
opts))