* doc/ref/api-control.texi (Prompt Primitives): Reference the newer
exception facilities.
(Exceptions): Rewrite to use the new exception primitives.
(Exception Terminology): Remove superfluous section.
(Exception Objects): New section.
(Raising and Handling Exceptions): New section.
(Throw and Catch): New section, coalescing the previous catch,
with-throw-handler, and throw sections.
(Exceptions and C): New section, for miscellaneous procedures.
(Handling Errors): Mention the transitional period regarding exception
handling.
* doc/ref/api-debug.texi (Catching Exceptions): Rewrite to use newer
exception facilities.
(Capturing Stacks): Remove, as it's not really recommendable any
more.
(Pre-Unwind Debugging): Rewrite to use the new primitives.
(Standard Error Handling): Add note about transitional status.
(Stack Overflow): Reference new exception section.
* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
Reference new exception section.
* doc/ref/r6rs.texi (rnrs exceptions, rnrs conditions): Update to
mention compatibility with SRFI-34/35 and to relate to core
exceptions.
* doc/ref/srfi-modules.texi (SRFI-34): Document.
* doc/ref/api-debug.texi (VM Hooks): Update for changes in VM hook API.
* doc/ref/guile.texi: Update copyright years.
* doc/ref/preface.texi (Contributors): Update.
* module/system/repl/debug.scm (print-locals): Adapt to
frame-binding-ref change.
* module/system/vm/frame.scm (<binding>): Add `frame' field.
(available-bindings): Capture the frame.
(binding-ref, binding-set!): New functions, accessing a local variable
value directly from a frame.
(frame-binding-ref, frame-binding-set!): Remove. As these are very
low-level debugging interfaces introduced in 2.0, never documented,
and quite tied to the VM, we feel comfortable making this change.
(frame-call-representation): Adapt to available-bindings change.
(frame-environment, frame-object-binding): Adapt to binding-ref
interface change.
* doc/ref/vm.texi (Stack Layout): Mention that slots can be re-used.
Update disassembly in example.
* doc/ref/api-debug.texi (Frames): Remove documentation for
frame-local-ref, frame-local-set!, and frame-num-locals. Replace with
documentation for frame-bindings, binding accessors, and binding-ref /
binding-set!.
* module/system/vm/traps.scm (frame-matcher): Always match on a
procedure's code, instead of the value in slot 0. Prevents confusion
with closure-optimized procedures, re-use of slot 0, and untagged
values in slot 0.
(trap-at-procedure-call, trap-in-procedure)
(trap-instructions-in-procedure, trap-at-procedure-ip-in-range)
(trap-at-source-location, trap-in-dynamic-extent)
(trap-calls-in-dynamic-extent, trap-instructions-in-dynamic-extent):
Update to adapt to frame-matcher change and remove #:closure?
argument, effectively changing the default behavior to #:closure? #t.
* doc/ref/api-debug.texi (Low-Level Traps): Update documentation.
* doc/ref/api-debug.texi (Stack Capture): Update make-stack docs.
* libguile/programs.h:
* libguile/programs.c (scm_program_address_range): New internal
procedure.
* libguile/stacks.c (narrow_stack): Interpret a pair of integers as an
address range. If a cut is a procedure, attempt to resolve it to an
address range.
(scm_make_stack): Update docstring.
* module/system/vm/program.scm (program-address-range): New exported
procedure.
* module/statprof.scm (statprof, gcprof): Use program-address-range to
get the outer-cut, for efficiency.
* module/system/repl/error-handling.scm (call-with-error-handling): Add
#:report-keys kwarg, so that unwind-only exceptions (stack-overflow in
particular) get reported.
* doc/ref/api-debug.texi (Pre-Unwind Debugging): Add documentation for
#:report-keys kwarg of call-with-error-handling.
(Stack Overflow): New subsubsection.
(Debug Options): Remove discussion of stack overflow.
* libguile/libguile-2.0-gdb.scm: New file.
* libguile/Makefile.am (install-data-local): New target. Based on code
from GNU libstdc++.
(EXTRA_DIST): Add 'libguile-2.0-gdb.scm'.
* doc/ref/api-debug.texi (GDB Support): New section.
* libguile/vm.h:
* libguile/vm.c:
(scm_vm_apply_hook, scm_vm_push_continuation_hook,
scm_vm_pop_continuation_hook, scm_vm_abort_continuation_hook,
scm_vm_restore_continuation_hook, scm_vm_next_hook,
scm_vm_trace_level, scm_set_vm_trace_level_x, scm_vm_engine,
scm_set_vm_engine_x, scm_c_set_vm_engine_x): The VM argument is now
implicit: the VM for the current thread.
* doc/ref/api-debug.texi (VM Hooks): Try to adapt.
* module/ice-9/command-line.scm:
* module/statprof.scm:
* module/system/vm/coverage.scm:
* module/system/vm/trace.scm:
* module/system/vm/trap-state.scm:
* module/system/vm/traps.scm:
* test-suite/tests/control.test:
* test-suite/tests/eval.test: Adapt users that set hooks or ensure that
we have a debug engine.
* doc/ref/api-debug.texi (VM Hooks): Update documentation.
* libguile/vm.c (vm_dispatch_hook):
* libguile/vm-engine.c: Rework the hook machinery so that they can
receive an arbitrary number of arguments. The return and abort
hooks will pass the values that they return to their continuations.
(vm_engine): Adapt to ABORT_CONTINUATION_HOOK change.
* libguile/vm-i-system.c (return, return/values): Adapt to
POP_CONTINUATION_HOOK change.
* module/system/vm/frame.scm (frame-return-values): Remove. The
pop-continuation-hook will pass the values directly.
* module/system/vm/trace.scm (print-return):
(trace-calls-to-procedure):
(trace-calls-in-procedure): Update to receive return values
directly.
* module/system/vm/traps.scm (trap-in-procedure)
(trap-in-dynamic-extent): Ignore return values.
(trap-frame-finish, trap-calls-in-dynamic-extent)
(trap-calls-to-procedure): Pass return values to the handlers.
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-modules.texi:
* doc/ref/compiler.texi:
* doc/ref/web.texi: Make Texinfo function headers more consistent.
Change lesser used keyword notation to the predominant form.
* doc/ref/api-procedures.texi: Fix an argument name in a header that should
use repeated argument notation.
* doc/ref/srfi-modules.texi: Update references in Texinfo function
definition body to match previously updated variable notation in
definition header.
* libguile/read.c (scm_read_number): Set source properties on
non-immediate numbers if the 'positions' reader option is set.
* doc/ref/api-debug.texi (Source Properties): Update manual.
* libguile/read.c (scm_read_array): New internal helper that
calls scm_i_read_array and sets its source property if the
'positions' reader option is set.
(scm_read_string): Set source properties on strings if the 'positions'
reader option is set.
(scm_read_vector, scm_read_srfi4_vector, scm_read_bytevector,
scm_read_guile_bitvector, scm_read_sharp): Add new arguments for the
'line' and 'column' of the first character of the datum being read.
Set source properties if the 'positions' reader option is set.
(scm_read_expression): Pass 'line' and 'column' to scm_read_sharp.
* doc/ref/api-debug.texi (Source Properties): Update manual.
* doc/ref/api-evaluation.texi (Scheme Read): Note that read-set! is
syntax.
(Scheme Write): Likewise for print-set!.
* doc/ref/api-io.texi (Writing): Remove reference to
print-options-interface.
* doc/ref/repl-modules.texi (Readline Options): Update, and add entries
for readline-options, readline-set! et al.
* doc/ref/api-debug.texi (Debugging Examples): Remove section, as the
tracing bits are adequately covered in tracing, and the breakpoints
and such will get covered in the debugging meta-commands section.
* doc/ref/api-debug.texi (Stack Capture): Rename from "Capturing the
Stack or Innermost Stack Frame". Move start-stack docs here.
(Frames): Document accessors for fp, sp, ip, et al.
(Source Properties): Raise to a subsection.
(VM Hooks): Add notes about the VM trace level within hook firing.
(Low-Level Traps): Flesh out.
* doc/ref/Makefile.am:
* doc/ref/guile.texi:
* doc/ref/scheme-debugging.texi: Remove scheme-debugging.texi, which
only described tracing. Tracing documentation is now in
api-debugging.
* doc/ref/scheme-using.texi (Evaluating Scheme Code): Remove reference
to source traps, as that section is going away.
* doc/ref/api-modules.texi (Included Guile Modules): Remove reference to
Tracing. This section is a little silly, anyway...
* doc/ref/api-evaluation.texi (VM Behaviour): Remove section, it is in
api-debugging now.
* doc/ref/api-debug.texi (Stacks, Frames): Rename sections from
"Examining the Stack" and "Examining Stack Frames", respectively.
(Traps): Update for current API. A big and not-quite-finished update.
* doc/ref/api-debug.texi (Programmatic Error Handling): Rename from
"Debug on Error". Reorganize subsections according to when the error
is handled.
* doc/ref/api-options.texi: Adapt xref.
* doc/ref/api-debug.texi (Debug on Error): Move debug options here (for
now). Leave debug-options-interface undocumented.
* doc/ref/api-options.texi (Runtime Options): Remove debug options. Link
to the sections where the options documentation is now. Update the
options example transcript.
* doc/ref/api-evaluation.texi (Scheme Read): Fold all reader options
docs into this section. Undocument read-options-interface.
(Scheme Write): New section for `write' and `display', and the print
options. print-enable/print-disable are not documented, as there are
no boolean print options. print-options-interface is likewise
undocumented.
* doc/ref/api-options.texi: Remove discussion of options in
general. Move read options to Scheme Read, and print options to Scheme
Write.
* doc/ref/api-io.texi (Reading): Link to Scheme Read.
(Writing): Move write and display to Scheme Write, and link there.
* doc/ref/srfi-modules.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-data.texi: Update xrefs.
* doc/ref/api-debug.texi (Debug on Error): Update xref.
* doc/ref/scheme-using.texi (REPL Commands): New subsection.
(Interactive Debugging): Rename from Interactive Debugger, to indicate
that debugging is just part of the REPL. Update docs.
Conflicts:
doc/ref/api-procedures.texi
doc/ref/misc-modules.texi
(Caused by me removing `@page' from a couple of sections that have been modified
by others.)
* libguile/deprecated.h:
* libguile/deprecated.c (scm_internal_lazy_catch, scm_lazy_catch):
Deprecate, and print out a nasty warning that people should change to
with-throw-handler.
* libguile/throw.h:
* libguile/throw.c (scm_c_with_throw_handler): Deprecate the use of the
lazy_catch_p argument, printing out a nasty warning if someone
actually passes 1 as that argument. The combination of the pre-unwind
and post-unwind handlers should be sufficient.
* test-suite/tests/exceptions.test: Remove lazy-catch tests, as they are
deprecated. Two of them fail:
* throw/catch: effect of lazy-catch unwinding on throw to another key
* throw/catch: repeat of previous test but with lazy-catch
Hopefully people are not depending on this behavior, and the warning is
sufficiently nasty for people to switch. We will see.
* test-suite/tests/eval.test ("promises"): Use with-throw-handler
instead of lazy-catch.
* doc/ref/api-debug.texi:
* doc/ref/api-control.texi: Update to remove references to lazy-catch,
folding in the useful bits to with-throw-handler.
i.e. put the extensions where they need to be, and delete
ice-9-debugger-extensions.scm.
* doc/ref/api-debug.texi (Single Stepping through a Procedure's Code):
Change mentions of (ice-9 debugging ice-9-debugger-extensions)
module to whatever is appropriate now (or just remove them).
* module/Makefile.am (NOCOMP_SOURCES): Remove
ice-9-debugger-extensions.scm.
* module/ice-9/debugger.scm (debug-trap): Move here from
ice-9-debugger-extensions.scm.
* module/ice-9/debugger/command-loop.scm ("continue", "finish",
"step", "next"): Move here from ice-9-debugger-extensions.scm.
* module/ice-9/debugger/commands.scm (assert-continuable, continue,
finish, step, next): Move here from ice-9-debugger-extensions.scm.
* module/ice-9/debugging/breakpoints.scm: Don't use
ice-9-debugger-extensions module.
* module/ice-9/debugging/ice-9-debugger-extensions.scm: Removed.
* module/ice-9/debugging/trace.scm, module/ice-9/debugging/traps.scm:
Remove more old version code.
* module/ice-9/debugging/traps.scm (guile-trap-features): Hardcoded as
'(tweaking).
In particular avoid any suggestion that the API uses the
property list format, i.e. (key1 value1 key2 value2 ...),
as opposed to the alist format that it actually does use.