Merge commit 'e20d7001c3f7150400169fecb0bf0eefdf122fe2' into vm-check
authorAndy Wingo <wingo@oblong.net>
Tue, 17 Mar 2009 15:40:52 +0000 (16:40 +0100)
committerAndy Wingo <wingo@oblong.net>
Tue, 17 Mar 2009 15:40:52 +0000 (16:40 +0100)
Conflicts:

libguile/stacks.c

1  2 
libguile/debug.c
libguile/eval.c
libguile/eval.i.c
libguile/gc-mark.c
libguile/goops.c
libguile/procs.c
libguile/stacks.c
test-suite/Makefile.am
test-suite/tests/eval.test
test-suite/tests/goops.test

Simple merge
diff --cc libguile/eval.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -149,37 -148,8 +149,34 @@@ stack_depth (scm_t_debug_frame *dframe
          if ((((info - vect) & 1) == 0)
              && SCM_OVERFLOWP (*dframe)
              && !SCM_UNBNDP (info[1].a.proc))
 -          ++n;
 +            ++n;
        }
-           else if (scm_is_eq (vect[0].a.proc, scm_f_gsubr_apply))
-             /* Skip gsubr apply frames. */
-             continue;
 +      else if (SCM_APPLYFRAMEP (*dframe))
 +        {
 +          scm_t_debug_info *vect = RELOC_INFO (dframe->vect, offset);
 +          if (SCM_PROGRAM_P (vect[0].a.proc))
 +            {
 +              if (!SCM_PROGRAM_IS_BOOT (vect[0].a.proc))
 +                /* Programs can end up in the debug stack via deval; but we just
 +                   ignore those, because we know that the debugging VM engine
 +                   pushes one dframe per invocation, with the boot program as
 +                   the proc, so we only count those. */
 +                continue;
 +              /* count vmframe back to previous boot frame */
 +              for (; scm_is_true (vmframe); vmframe = scm_c_vm_frame_prev (vmframe))
 +                {
 +                  if (!SCM_PROGRAM_IS_BOOT (scm_vm_frame_program (vmframe)))
 +                    ++n;
 +                  else
 +                    { /* skip boot frame, cut out of the vm backtrace */
 +                      vmframe = scm_c_vm_frame_prev (vmframe);
 +                      break;
 +                    }
 +                }
 +            }
 +          else
 +            ++n; /* increment for non-program apply frame */
 +        }
        else
        ++n;
      }
@@@ -321,42 -293,10 +318,39 @@@ read_frames (scm_t_debug_frame *dframe
              NEXT_FRAME (iframe, n, quit);
            }
        }
-       else if (scm_is_eq (iframe->proc, scm_f_gsubr_apply))
-       /* Skip gsubr apply frames. */
-       continue;
 +      else if (SCM_PROGRAM_P (iframe->proc))
 +        {
 +          if (!SCM_PROGRAM_IS_BOOT (iframe->proc))
 +            /* Programs can end up in the debug stack via deval; but we just
 +               ignore those, because we know that the debugging VM engine
 +               pushes one dframe per invocation, with the boot program as
 +               the proc, so we only count those. */
 +            continue;
 +          for (; scm_is_true (vmframe);
 +               vmframe = scm_c_vm_frame_prev (vmframe))
 +            {
 +              if (SCM_PROGRAM_IS_BOOT (scm_vm_frame_program (vmframe)))
 +                { /* skip boot frame, back to interpreted frames */
 +                  vmframe = scm_c_vm_frame_prev (vmframe);
 +                  break;
 +                }
 +              else 
 +                {
 +                  /* Oh dear, oh dear, oh dear. */
 +                  iframe->flags = SCM_UNPACK (SCM_INUM0) | SCM_FRAMEF_PROC;
 +                  iframe->source = scm_vm_frame_source (vmframe);
 +                  iframe->proc = scm_vm_frame_program (vmframe);
 +                  iframe->args = scm_vm_frame_arguments (vmframe);
 +                  ++iframe;
 +                  if (--n == 0)
 +                    goto quit;
 +                }
 +            }
 +        }
        else
 -      {
 -        NEXT_FRAME (iframe, n, quit);
 -      }
 +        {
 +          NEXT_FRAME (iframe, n, quit);
 +        }
      quit:
        if (iframe > iframes)
        (iframe - 1) -> flags |= SCM_FRAMEF_REAL;
Simple merge
Simple merge
Simple merge