1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00
guile/doc/ref
Andy Wingo b1b942b74c remove heap links in VM frames, incorporate vm frames into normal backtraces
* doc/ref/vm.texi (Stack Layout): Update to remove references to the
  "heap link".

* gdbinit: Update for "heap link" removal.

* libguile/frames.c:
* libguile/frames.h: Update macros and diagram for removal of "heap
  link". As part of this, we also remove "heap frames", replacing them
  with "vm frames", which are much like the interpreter's debug objects,
  but for VM stacks. That is to say, they don't actually hold the stack
  themselves, just the pointers into stack that's held by a continuation
  (either captured or current).

* libguile/stacks.c (stack_depth, read_frames): Since a "stack" object is
  really a copy of information that comes from somewhere else, it makes
  sense to copy over info from the VM, just as `make-stack' does from the
  evaluator. The tricky bit is to figure out how to interleave VM and
  interpreter frames. We do that by starting in the interpreter, and
  whenever the current frame's procedure is actually a program, we switch
  to the VM stack, switching back when we reach a "bootstrap frame". The
  last bit is hacky, but it does work...
  (is_vm_bootstrap_frame): Hacky predicate to see if a VM frame is a
  bootstrap frame.
  (scm_make_stack): Accept a VM frame in addition to debug frames.
  Probably has some bugs in this case. But in the case that the arg is
  #t (a common case), do the right thing, capturing the top VM frame as
  well, and interleaving those frames appropriately on the stack.

  As an accident, we lost the ability to limit the number of frames in
  the backtrace. We could add that back, but personally I always want
  *all* frames in the trace... Narrowing still works fine, though there
  are some hiccups sometimes -- e.g. an outer cut to a procedure that
  does a tail-call in VM code will never find the cut, as it no longer
  exists in the continuation.

* libguile/vm.h (struct scm_vm): So! Now that we have switched to save
  stacks in the normal make-stack, there's no more need for `this_frame'
  or `last_frame'. On the other hand, we can take this opportunity to fix
  tracing: when we're in a trace hook, we set `trace_frame' on the VM,
  so we know not to fire hooks when we're already in a hook.
  (struct scm_vm_cont): Expose this, as make-stack needs it to make VM
  frames from VM continuations.

* libguile/vm.c (scm_vm_trace_frame): New function, gets the current
  trace frame.
  (vm_mark, make_vm): Hook up the trace frame.
  (vm_dispatch_hook): New hook dispatcher, with a dynwind so it does the
  right thing if the hook exits nonlocally.

* libguile/vm-engine.c (vm_run): No more this_frame in the wind data.

* libguile/vm-engine.h (RUN_HOOK): Run hooks through the dispatcher.
  (ALIGN_AS_NON_IMMEDIATE, POP_LIST_ON_STACK): Remove unused code.
  (NEW_FRAME): Adapt for no HL in the frame.

* libguile/vm-i-system.c (goto/args, mv-call, return, return/values):
  Adapt for no HL in the frame.

* module/system/vm/frame.scm:
* module/system/vm/vm.scm: Beginnings of some reworkings, needs more
  thought.
2008-12-26 18:07:20 +01:00
..
.gitignore More `.gitignore'. 2008-04-07 23:55:58 +02:00
api-binding.texi * scheme-binding.texi: Renamed to api-binding.texi. 2004-08-02 12:29:00 +00:00
api-compound.texi merge from 1.8 branch 2007-03-07 22:46:00 +00:00
api-control.texi Changes from arch/CVS synchronization 2007-06-07 08:36:13 +00:00
api-data.texi Add `scm_c_symbol_length ()'. 2008-07-05 20:16:12 +02:00
api-debug.texi Add NEWS and concept index entries for traps infrastructure and Emacs support. 2008-05-05 22:39:05 +01:00
api-evaluation.texi * api-options.texi (Evaluator trap options): document 2007-01-19 20:05:18 +00:00
api-i18n.texi Changes from arch/CVS synchronization 2007-01-31 20:58:20 +00:00
api-init.texi merge from 1.8 2007-01-15 23:22:36 +00:00
api-io.texi merge from 1.8 branch 2007-03-07 22:46:00 +00:00
api-memory.texi Renamed the "frames" that are related to dynamic-wind to "dynamic 2006-01-29 00:23:28 +00:00
api-modules.texi Fix doc typo regarding `use-syntax' and "syntax transformers". 2008-06-28 20:37:21 +02:00
api-options.texi doc: Correct the default value of `%load-path'. 2008-09-12 11:31:48 +02:00
api-overview.texi * scheme-binding.texi: Renamed to api-binding.texi. 2004-08-02 12:29:00 +00:00
api-procedures.texi merge from 1.8 2007-01-15 23:49:04 +00:00
api-scheduling.texi Delete trailing whitespace. 2008-05-14 23:52:49 +01:00
api-scm.texi * scheme-binding.texi: Renamed to api-binding.texi. 2004-08-02 12:29:00 +00:00
api-smobs.texi (smob mark function): List admissible functions 2004-10-19 13:55:06 +00:00
api-snarf.texi Typos fixed. Use existing functions in explaining symbol and keyword 2004-08-25 19:02:34 +00:00
api-translation.texi * scheme-binding.texi: Renamed to api-binding.texi. 2004-08-02 12:29:00 +00:00
api-undocumented.texi Synchronized docstrings. 2005-03-04 17:56:31 +00:00
api-utility.texi Changes from arch/CVS synchronization 2006-06-16 07:39:59 +00:00
api.txt Changes in doc/ref: 2002-03-01 00:19:20 +00:00
autoconf.texi Fix omissions and typos in previous commit. 2008-05-04 22:42:13 +02:00
ChangeLog-2008 Rename ChangeLog' files to ChangeLog-2008'. 2008-09-12 21:49:58 +02:00
ChangeLog-guile-doc-ref * Organize documentation into per-manual directories (halfway point commit). 2001-08-24 09:40:29 +00:00
compiler.texi merge vm docs into guile reference (as yet unfinished) 2008-11-20 13:44:22 +01:00
data-rep.texi fix doc typo 2008-12-26 16:33:33 +01:00
expect.texi expect.texi (Expect): Removed backslash escapes of regexp 2004-12-20 21:38:23 +00:00
extend.texi Added Copyright notice. 2004-01-21 22:40:39 +00:00
fdl.texi merge from 1.8 branch 2006-04-16 23:18:55 +00:00
guile.texi write history.texi 2008-12-19 11:24:44 +01:00
history.texi write history.texi 2008-12-19 11:24:44 +01:00
indices.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
intro.texi (Reporting Bugs): Note need for subscription to 2006-11-17 15:52:23 +00:00
libguile-concepts.texi merge vm docs into guile reference (as yet unfinished) 2008-11-20 13:44:22 +01:00
libguile-extensions.texi pxref libtool manual. 2006-02-03 23:59:59 +00:00
libguile-linking.texi (A Sample Guile Main Program): Cross reference automake manual for acloal. 2005-06-22 23:55:10 +00:00
libguile-program.texi (Dia Primitives): Cross ref for scm_c_define_gsubr. 2005-06-23 00:09:09 +00:00
libguile-smobs.texi merge vm docs into guile reference (as yet unfinished) 2008-11-20 13:44:22 +01:00
libguile-snarf.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
Makefile.am merge vm docs into guile reference (as yet unfinished) 2008-11-20 13:44:22 +01:00
misc-modules.texi merge from 1.8 branch 2006-10-09 22:47:06 +00:00
mod-getopt-long.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
new-docstrings.texi Synchronized docstrings. 2005-03-04 17:56:31 +00:00
posix.texi Fix strftime' documentation wrt. %Z'. 2008-09-18 23:13:42 +02:00
preface.texi Some index entry capitalization. 2005-01-11 21:46:01 +00:00
repl-modules.texi merge from 1.8 branch 2006-10-09 22:47:06 +00:00
scheme-debugging.texi * api-debug.texi (Low Level Trap Calls): Removed (material 2008-03-19 22:51:24 +00:00
scheme-ideas.texi Tweak tail calls wording. 2005-06-23 23:47:32 +00:00
scheme-indices.texi Added Copyright notice. 2004-01-21 22:40:39 +00:00
scheme-intro.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
scheme-reading.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
scheme-scripts.texi Describe new 1.4 compatability behavior of 2005-01-14 16:24:09 +00:00
scheme-using.texi Single stepping through code from Emacs 2008-07-17 23:05:57 +01:00
script-getopt.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
scsh.texi Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
slib.texi Changes from arch/CVS synchronization 2007-10-02 03:16:28 +00:00
srfi-modules.texi srfi-modules.texi (SRFI-18): New sections. 2008-06-30 19:47:21 +02:00
tcltk.texi Added Copyright notice. 2004-01-21 22:40:39 +00:00
tools.texi Added Copyright notice. 2004-01-21 22:40:39 +00:00
vm.texi remove heap links in VM frames, incorporate vm frames into normal backtraces 2008-12-26 18:07:20 +01:00