1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Merge remote-tracking branch 'origin/stable-2.0'

This commit is contained in:
Andy Wingo 2012-05-11 14:31:17 +02:00
commit ee6207d6f5
4 changed files with 20 additions and 7 deletions

View file

@ -104,11 +104,18 @@ SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_frame_source #define FUNC_NAME s_scm_frame_source
{ {
SCM proc;
SCM_VALIDATE_VM_FRAME (1, frame); SCM_VALIDATE_VM_FRAME (1, frame);
return scm_program_source (scm_frame_procedure (frame), proc = scm_frame_procedure (frame);
scm_frame_instruction_pointer (frame),
SCM_UNDEFINED); if (SCM_PROGRAM_P (proc))
return scm_program_source (scm_frame_procedure (frame),
scm_frame_instruction_pointer (frame),
SCM_UNDEFINED);
return SCM_BOOL_F;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -296,6 +303,7 @@ SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
#define FUNC_NAME s_scm_frame_previous #define FUNC_NAME s_scm_frame_previous
{ {
SCM *this_fp, *new_fp, *new_sp; SCM *this_fp, *new_fp, *new_sp;
SCM proc;
SCM_VALIDATE_VM_FRAME (1, frame); SCM_VALIDATE_VM_FRAME (1, frame);
@ -303,13 +311,16 @@ SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
this_fp = SCM_VM_FRAME_FP (frame); this_fp = SCM_VM_FRAME_FP (frame);
new_fp = SCM_FRAME_DYNAMIC_LINK (this_fp); new_fp = SCM_FRAME_DYNAMIC_LINK (this_fp);
if (new_fp) if (new_fp)
{ new_fp = RELOC (frame, new_fp); {
new_fp = RELOC (frame, new_fp);
new_sp = SCM_FRAME_LOWER_ADDRESS (this_fp) - 1; new_sp = SCM_FRAME_LOWER_ADDRESS (this_fp) - 1;
frame = scm_c_make_frame (SCM_VM_FRAME_STACK_HOLDER (frame), frame = scm_c_make_frame (SCM_VM_FRAME_STACK_HOLDER (frame),
new_fp, new_sp, new_fp, new_sp,
SCM_FRAME_RETURN_ADDRESS (this_fp), SCM_FRAME_RETURN_ADDRESS (this_fp),
SCM_VM_FRAME_OFFSET (frame)); SCM_VM_FRAME_OFFSET (frame));
if (SCM_PROGRAM_IS_BOOT (scm_frame_procedure (frame))) proc = scm_frame_procedure (frame);
if (SCM_PROGRAM_P (proc) && SCM_PROGRAM_IS_BOOT (proc))
goto again; goto again;
else else
return frame; return frame;

View file

@ -276,6 +276,7 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
/* FIXME: is this even possible? */ /* FIXME: is this even possible? */
if (scm_is_true (frame) if (scm_is_true (frame)
&& SCM_PROGRAM_P (scm_frame_procedure (frame))
&& SCM_PROGRAM_IS_BOOT (scm_frame_procedure (frame))) && SCM_PROGRAM_IS_BOOT (scm_frame_procedure (frame)))
frame = scm_frame_previous (frame); frame = scm_frame_previous (frame);

View file

@ -875,7 +875,8 @@ information is unavailable."
(let ((proc (frame-procedure frame))) (let ((proc (frame-procedure frame)))
(print-location frame port) (print-location frame port)
(format port "In procedure ~a:\n" (format port "In procedure ~a:\n"
(or (procedure-name proc) proc)))) (or (false-if-exception (procedure-name proc))
proc))))
(print-location frame port) (print-location frame port)
(catch #t (catch #t

View file

@ -99,7 +99,7 @@
(define (frame-call-representation frame) (define (frame-call-representation frame)
(let ((p (frame-procedure frame))) (let ((p (frame-procedure frame)))
(cons (cons
(or (procedure-name p) p) (or (false-if-exception (procedure-name p)) p)
(cond (cond
((and (program? p) ((and (program? p)
(program-arguments-alist p (frame-instruction-pointer frame))) (program-arguments-alist p (frame-instruction-pointer frame)))