From 581a4eb82b1534970060e3cbd79b9a96d351edf9 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 7 Nov 2013 23:03:45 +0100 Subject: frame-instruction-pointer is absolute; rewrite (system vm coverage) * libguile/frames.c (scm_frame_source): Instead of assuming that scm_frame_procedure is correct, use the IP to get the source. (scm_frame_instruction_pointer): Return an absolute value instead of assuming that slot 0 is correct. (It isn't, when preparing for a tail call.) * libguile/programs.h: * libguile/programs.c (scm_find_source_for_addr): New internal helper. * module/system/repl/debug.scm (print-registers): Readably print absolute instruction pointers. * module/system/vm/coverage.scm: Complete rewrite to use absolute IP's. We can't assume that frame-procedure is cheap if it is correct, or correct if it is cheap. Anyway using the address is better anyway. (coverage-data->lcov): Disable per-function info temporarily. (loaded-modules, module-procedures, closest-source-line) (closed-over-procedures): Remove these. Instead of going from procedures to source info, now we go from ELF image to source info. * module/system/vm/debug.scm (debug-context-length): New interface. * module/system/vm/program.scm (source-for-addr): New internal helper. --- libguile/programs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libguile/programs.h') diff --git a/libguile/programs.h b/libguile/programs.h index f2518ca34..0d33957a5 100644 --- a/libguile/programs.h +++ b/libguile/programs.h @@ -51,6 +51,8 @@ SCM_INTERNAL SCM scm_i_rtl_program_name (SCM program); SCM_INTERNAL SCM scm_i_rtl_program_documentation (SCM program); SCM_INTERNAL SCM scm_i_rtl_program_properties (SCM program); +SCM_INTERNAL SCM scm_find_source_for_addr (SCM ip); + /* * Programs */ -- cgit v1.2.3