diff options
author | Andy Wingo <wingo@pobox.com> | 2008-12-26 16:35:43 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-12-26 16:35:43 +0100 |
commit | e052d2964098005a02fcb2b1e1e670e9ff4157c1 (patch) | |
tree | 7d1abed13e14367cd6170f88a4694e1e7a016ac7 | |
parent | eff313ed21ad8722733ec16e079107aea9369215 (diff) | |
download | guile-e052d2964098005a02fcb2b1e1e670e9ff4157c1.tar.gz |
backtrace.c: allow vectors for SCM_FRAME_SOURCE (frame)
* libguile/backtrace.c (display_backtrace_get_file_line): If the source
is a vector, treat it as a #(line column file) vector, as emitted by
the VM. Needs subsequent patches to make sense.
-rw-r--r-- | libguile/backtrace.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 798ade197..418b6d777 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -467,8 +467,21 @@ static void display_backtrace_get_file_line (SCM frame, SCM *file, SCM *line) { SCM source = SCM_FRAME_SOURCE (frame); - *file = SCM_MEMOIZEDP (source) ? scm_source_property (source, scm_sym_filename) : SCM_BOOL_F; - *line = (SCM_MEMOIZEDP (source)) ? scm_source_property (source, scm_sym_line) : SCM_BOOL_F; + *file = *line = SCM_BOOL_F; + if (SCM_MEMOIZEDP (source)) + { + *file = scm_source_property (source, scm_sym_filename); + *line = scm_source_property (source, scm_sym_line); + } + else if (scm_is_vector (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); + } } static void |