summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-05-16 20:28:19 +0200
committerAndy Wingo <wingo@pobox.com>2013-05-16 20:28:19 +0200
commitf5ff8be932c51aa2350b3aa5f512e8f075abff03 (patch)
tree45fbd443b12c47105f6f17559df0fbdae6920de7
parentb5eb013084c29bc14ac3a8b3eb2d56a5317b7400 (diff)
downloadguile-f5ff8be932c51aa2350b3aa5f512e8f075abff03.tar.gz
Fix circular module dependencies
I don't think this actually caused me problems (how does that work?) but it seems a good thing to fix. * module/system/vm/debug.scm: Don't import (system vm program). Adapt procedures to always expect an addr, not a program. * module/system/vm/program.scm (rtl-program-name): Pass rtl program addr directly.
-rw-r--r--module/system/vm/debug.scm13
-rw-r--r--module/system/vm/program.scm2
2 files changed, 6 insertions, 9 deletions
diff --git a/module/system/vm/debug.scm b/module/system/vm/debug.scm
index 85f1d297d..43527f3af 100644
--- a/module/system/vm/debug.scm
+++ b/module/system/vm/debug.scm
@@ -20,7 +20,6 @@
(define-module (system vm debug)
#:use-module (system vm elf)
- #:use-module (system vm program)
#:use-module (system vm objcode)
#:use-module (system foreign)
#:use-module (rnrs bytevectors)
@@ -97,7 +96,7 @@
(debug-context-text-base (program-debug-info-context pdi)))
4))
-(define* (find-debug-context #:key program (addr (rtl-program-code program)))
+(define (find-debug-context addr)
(let* ((bv (find-mapped-elf-image addr))
(elf (parse-elf bv))
(base (pointer-address (bytevector->pointer (elf-bytes elf))))
@@ -129,9 +128,8 @@
(lp (1+ n)))))))
(or (bisect) (linear-search))))))
-(define* (find-program-debug-info #:key program
- (addr (rtl-program-code program))
- (context (find-debug-context #:addr addr)))
+(define* (find-program-debug-info addr #:optional
+ (context (find-debug-context addr)))
(cond
((find-elf-symbol (debug-context-elf context)
(- addr
@@ -271,9 +269,8 @@
(else
(make-arity context base pos))))))
-(define* (find-program-arities #:key program
- (addr (rtl-program-code program))
- (context (find-debug-context #:addr addr)))
+(define* (find-program-arities addr #:optional
+ (context (find-debug-context addr)))
(and=>
(elf-section-by-name (debug-context-elf context) ".guile.arities")
(lambda (sec)
diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm
index 2fc3b5364..fdfc9a8aa 100644
--- a/module/system/vm/program.scm
+++ b/module/system/vm/program.scm
@@ -58,7 +58,7 @@
(define (rtl-program-name program)
(unless (rtl-program? program)
(error "shouldn't get here"))
- (and=> (find-program-debug-info #:program program)
+ (and=> (find-program-debug-info (rtl-program-code program))
program-debug-info-name))
(define (make-binding name boxed? index start end)