diff options
author | Andy Wingo <wingo@pobox.com> | 2009-02-10 11:53:23 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-02-10 11:53:23 +0100 |
commit | 028e3d06665d4eb50b5d0f0d0101acc039c2ae68 (patch) | |
tree | e101393d98ca1fc67b724822bf0fb2e0d531aaf9 /libguile/backtrace.c | |
parent | dae318a63140ac7b1f396440bc341fea901be9b9 (diff) | |
download | guile-028e3d06665d4eb50b5d0f0d0101acc039c2ae68.tar.gz |
propagate much more source info through compilation
* module/language/ghil/compile-glil.scm (codegen): Record source location
for offset 0 into a lambda, if we can.
* module/language/scheme/compile-ghil.scm (translate-1)
(define-scheme-translator): In the retrans procedures, propagate the
location information from the enclosing expression if the subexpression
has no location information. Gives source information to many more
expressions.
(location): Just propagate the source properties as they are, the
glil->assembly compiler will interpret them.
* module/language/glil.scm (<glil>): Change glil-source to take "props"
and not "loc", as it's the source properties that we're interested in.
* module/language/glil/compile-assembly.scm (limn-sources): New function,
takes a list of addr-source property pairs and "compresses" them for
serialization to disk.
(glil->assembly): Limn the sources before writing them to disk. Avoid
non-tail recursion when determining total byte length of code.
* module/system/vm/program.scm (source:file, source:line, source:column):
Update for new source representation.
(program-source): Export.
(write-program): Nicer pretty-printing of anonymous procedures.
* libguile/backtrace.c (display_backtrace_get_file_line): Update for the
new VM source representation.
* libguile/programs.h:
* libguile/programs.c (scm_program_sources): Update for the new
serialized source representation, where the filename is not in the
stream unless it changes.
(scm_program_source): New exported function, looks up the source for a
given ip offset.
(scm_c_program_source): Update to return the last source information
that was <= the given IP, because we only serialize source info when it
changes.
Diffstat (limited to 'libguile/backtrace.c')
-rw-r--r-- | libguile/backtrace.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 418b6d777..a8afcdf34 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -473,14 +473,14 @@ display_backtrace_get_file_line (SCM frame, SCM *file, SCM *line) *file = scm_source_property (source, scm_sym_filename); *line = scm_source_property (source, scm_sym_line); } - else if (scm_is_vector (source)) + else if (scm_is_pair (source) + && scm_is_pair (scm_cdr (source)) + && scm_is_pair (scm_cddr (source)) + && !scm_is_pair (scm_cdddr (source))) { - /* #(line column file), from VM compilation */ - size_t len = scm_c_vector_length (source); - if (len >= 3) - *file = scm_c_vector_ref (source, 2); - if (len >= 1) - *line = scm_c_vector_ref (source, 0); + /* (addr . (filename . (line . column))), from vm compilation */ + *file = scm_cadr (source); + *line = scm_caddr (source); } } |