mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
frame-source available in default environment
* libguile/frames.c (scm_frame_source): Don't call out to (system vm frames), as this routine is used when printing exceptions. Make available in the default environment (ugh). * module/system/vm/frame.scm: Remove frame-source definition and export.
This commit is contained in:
parent
7948811252
commit
423fca76e6
2 changed files with 12 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
|
/* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -92,17 +92,18 @@ SCM_DEFINE (scm_frame_arguments, "frame-arguments", 1, 0, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
SCM
|
SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
|
||||||
scm_frame_source (SCM frame)
|
(SCM frame),
|
||||||
|
"")
|
||||||
|
#define FUNC_NAME s_scm_frame_source
|
||||||
{
|
{
|
||||||
static SCM var = SCM_BOOL_F;
|
SCM_VALIDATE_VM_FRAME (1, frame);
|
||||||
|
|
||||||
if (scm_is_false (var))
|
|
||||||
var = scm_c_module_lookup (scm_c_resolve_module ("system vm frame"),
|
|
||||||
"frame-source");
|
|
||||||
|
|
||||||
return scm_call_1 (SCM_VARIABLE_REF (var), frame);
|
return scm_program_source (scm_frame_procedure (frame),
|
||||||
|
scm_frame_instruction_pointer (frame),
|
||||||
|
SCM_UNDEFINED);
|
||||||
}
|
}
|
||||||
|
#undef FUNC_NAME
|
||||||
|
|
||||||
/* The number of locals would be a simple thing to compute, if it weren't for
|
/* The number of locals would be a simple thing to compute, if it weren't for
|
||||||
the presence of not-yet-active frames on the stack. So we have a cheap
|
the presence of not-yet-active frames on the stack. So we have a cheap
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; Guile VM frame functions
|
;;; Guile VM frame functions
|
||||||
|
|
||||||
;;; Copyright (C) 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
|
;;; Copyright (C) 2001, 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
;;;
|
;;;
|
||||||
;;; This library is free software; you can redistribute it and/or
|
;;; This library is free software; you can redistribute it and/or
|
||||||
;;; modify it under the terms of the GNU Lesser General Public
|
;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
#:export (frame-bindings
|
#:export (frame-bindings
|
||||||
frame-lookup-binding
|
frame-lookup-binding
|
||||||
frame-binding-ref frame-binding-set!
|
frame-binding-ref frame-binding-set!
|
||||||
frame-source frame-next-source frame-call-representation
|
frame-next-source frame-call-representation
|
||||||
frame-environment
|
frame-environment
|
||||||
frame-object-binding frame-object-name
|
frame-object-binding frame-object-name
|
||||||
frame-return-values))
|
frame-return-values))
|
||||||
|
@ -70,12 +70,6 @@
|
||||||
;;; Pretty printing
|
;;; Pretty printing
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (frame-source frame)
|
|
||||||
(let ((proc (frame-procedure frame)))
|
|
||||||
(program-source proc
|
|
||||||
(frame-instruction-pointer frame)
|
|
||||||
(program-sources proc))))
|
|
||||||
|
|
||||||
(define (frame-next-source frame)
|
(define (frame-next-source frame)
|
||||||
(let ((proc (frame-procedure frame)))
|
(let ((proc (frame-procedure frame)))
|
||||||
(program-source proc
|
(program-source proc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue