diff options
Diffstat (limited to 'module/system/vm/program.scm')
-rw-r--r-- | module/system/vm/program.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm index 5344d3882..8f19c5468 100644 --- a/module/system/vm/program.scm +++ b/module/system/vm/program.scm @@ -28,6 +28,8 @@ source:line-for-user program-sources program-sources-pre-retire program-source + program-address-range + program-arities program-arity arity:start arity:end arity:nreq arity:nopt arity:rest? arity:kw arity:allow-other-keys? @@ -97,6 +99,15 @@ (lp s sources) source))))) +(define (program-address-range program) + "Return the start and end addresses of @var{program}'s code, as a pair +of integers." + (let ((pdi (find-program-debug-info (program-code program)))) + (and pdi + (cons (program-debug-info-addr pdi) + (+ (program-debug-info-addr pdi) + (program-debug-info-size pdi)))))) + ;; Source information could in theory be correlated with the ip of the ;; instruction, or the ip just after the instruction is retired. Guile ;; does the latter, to make backtraces easy -- an error produced while |