1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

114 commits

Author SHA1 Message Date
Taylan Kammer
242e8698c2 Better REPL behavior on syntax errors in meta commands.
Fixes <https://bugs.gnu.org/30600>.

* module/system/repl/command.scm (define-meta-command): Flush all
remaining input after handling a read error.
* module/system/repl/common.scm (flush-all-input): New public procedure.
* module/system/repl/repl.scm: Remove local flush-all-input definition.
2024-10-25 13:35:31 +02:00
Rob Browning
d99ae68f88 define-meta-command: mention effects of a missing category
module/system/repl/command.scm: add comment.
2024-07-12 17:49:45 -05:00
Michael Käppler
80d4055e42
Fix error messages containing format strings
The builtin primitive procedure `error` takes an optional message and
a list of arguments to include into the error message.
These args are formatted with `~S` and appended to the error message, so
that an example call of

`(error "Wrong argument: " 42)`

results in the output

"Wrong argument: 42"

If format strings occur in the message itself, however, they are
escaped. Thus a call like

`(error "Wrong argument: ~a" 42)`

is rendered as

"Wrong argument: ~a 42"

Some callers did not take this behavior into account, leading to
confusing error messages.
Changing the behavior of `error` to be
both backwards-compatible and accept also format strings inside messages
is not straightforward, because it would have to handle escaped `~`
characters as well. Therefore, fix `error` call sites using format
strings to use `format` before calling out to `error`.

The following files are affected:

* module/ice-9/format.scm (format)
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface)
* module/oop/goops.scm (make)
* module/srfi/srfi-37.scm (Comment at the beginning of file)
* module/system/base/compile.scm (call-once)
* module/system/repl/command.scm (break, tracepoint)
* module/system/repl/common.scm (repl-default-options)
* module/system/vm/traps.scm (arg-check, trap-at-source-location)

There are a couple of further call sites that were left unchanged,
either because they are using their own `error` procedure:

* module/ice-9/read.scm
* module/ice-9/command-line.scm

or are not referenced from other modules:

* module/system/base/lalr.upstream.scm:
* module/sxml/upstream/assert.scm:
* module/sxml/sxml-match.ss:

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-06 11:51:53 +02:00
Morgan Smith
c7d170c5d1
Fix typos throughout codebase.
* NEWS:
* README:
* doc/r5rs/r5rs.texi:
* doc/ref/api-data.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-io.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/libguile-concepts.texi:
* doc/ref/posix.texi:
* doc/ref/srfi-modules.texi:
* doc/ref/vm.texi:
* doc/ref/web.texi:
* examples/box-dynamic-module/box.c:
* examples/box-dynamic/box.c:
* examples/box-module/box.c:
* examples/box/box.c:
* examples/safe/safe:
* examples/scripts/README:
* examples/scripts/hello:
* gc-benchmarks/larceny/twobit-input-long.sch:
* gc-benchmarks/larceny/twobit-smaller.sch:
* gc-benchmarks/larceny/twobit.sch:
* libguile/expand.c:
* libguile/load.c:
* libguile/net_db.c:
* libguile/scmsigs.c:
* libguile/srfi-14.c:
* libguile/threads.c:
* meta/guile.m4:
* module/ice-9/match.upstream.scm:
* module/ice-9/ports.scm:
* module/language/cps/graphs.scm:
* module/scripts/doc-snarf.scm:
* module/srfi/srfi-19.scm:
* module/system/repl/command.scm:
* test-suite/tests/srfi-18.test:
Fix typos.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-07-16 22:09:01 +02:00
Ludovic Courtès
e2ed33ef04
Remove unnecessary module imports.
These were found with:

  make GUILE_WARNINGS='-W1 -Wunused-module'

* module/ice-9/copy-tree.scm:
* module/ice-9/eval-string.scm:
* module/ice-9/getopt-long.scm:
* module/ice-9/poll.scm:
* module/ice-9/popen.scm:
* module/ice-9/sandbox.scm:
* module/ice-9/threads.scm:
* module/sxml/apply-templates.scm:
* module/sxml/simple.scm:
* module/system/base/types.scm:
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/repl/coop-server.scm:
* module/system/repl/debug.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/repl/server.scm:
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* module/system/vm/elf.scm:
* module/system/vm/frame.scm:
* module/system/vm/inspect.scm:
* module/system/vm/linker.scm:
* module/system/vm/program.scm:
* module/system/vm/trace.scm:
* module/system/vm/trap-state.scm:
* module/system/vm/traps.scm:
* module/system/xref.scm:
* module/texinfo/indexing.scm:
* module/texinfo/plain-text.scm:
* module/texinfo/reflection.scm:
* module/texinfo/string-utils.scm:
* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/response.scm: Remove imports of unused modules.
2023-02-24 16:49:00 +01:00
Andy Wingo
c803566a17 Add ,optimize-cps REPL meta-command
* module/system/repl/command.scm (*command-table*): Add optimize-cps /
optx.
(optimize-cps): Define meta-command.
* module/system/repl/common.scm (optimize*): New helper.
(repl-optimize): Use helper.
(repl-optimize-cps): New public function.
2021-10-01 11:33:13 +02:00
Ludovic Courtès
5a389ca728 (system repl command) autoloads the compiler, disassembler, and profiler.
* module/system/repl/command.scm: Autoload (system base compile),
(system vm disassembler), and (statprof).
2021-09-20 17:00:19 +02:00
Ludovic Courtès
5f1ed870ea repl: Add missing bindings in #:autoload spec.
Fixes <https://bugs.gnu.org/39196>.
Reported by Matt Wette <matt.wette@gmail.com>.

* module/system/repl/command.scm: Augment #:autoload set of bindings.
2020-01-20 10:29:52 +01:00
Andy Wingo
aa86ae6bf9 Fix exception when running ",help debug"
* module/system/repl/command.scm (*command-table*): Remove entry for
  ",procedure", a command removed a few months ago.
2016-08-25 16:08:50 +02:00
Andy Wingo
adb2329863 Remove `procedure' repl command
* doc/ref/scheme-using.texi (Debug Commands):
* module/system/repl/command.scm (procedure): Remove REPL command.
  Since there is a closure binding and we have improved the ,registers
  output, this is no longer necessary and by removing it we remove
  another bogus use of frame-procedure.
2015-12-01 11:30:54 +01:00
Andy Wingo
4cbc95f150 Rename objcodes?.{scm,c,h} to loader.{scm,c,h}
* libguile/loader.c:
* libguile/loader.h: Rename from objcodes.[ch].
* module/system/vm/loader.scm: Rename from objcode.scm.

* libguile/Makefile.am:
* libguile/gsubr.c:
* libguile/init.c:
* libguile/procs.c:
* libguile/vm.c:
* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/rtl/spec.scm:
* module/system/base/target.scm:
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/objcode.scm:
* test-suite/tests/compiler.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test: Adapt.
2013-11-19 21:45:07 +01:00
Andy Wingo
d1100525ff rtl-program-code -> program-code
* libguile/programs.h:
* libguile/programs.c (scm_program_code): Rename from
  scm_rtl_program_code.  Also renames rtl-program-code to program-code.

* module/statprof.scm:
* module/system/repl/command.scm:
* module/system/repl/debug.scm:
* module/system/vm/coverage.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/program.scm:
* module/system/vm/traps.scm:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl.test: Adapt callers.
2013-11-19 19:36:27 +01:00
Andy Wingo
0bd1e9c6a0 rtl-program? -> program?
* libguile/programs.c (scm_program_p): Rename from scm_rtl_program_p.
  Changes name also from rtl-program? to program?.

* libguile/programs.h:
* module/ice-9/session.scm:
* module/language/tree-il/analyze.scm:
* module/statprof.scm:
* module/system/repl/command.scm:
* module/system/repl/debug.scm:
* module/system/vm/coverage.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/frame.scm:
* module/system/vm/program.scm:
* module/system/vm/traps.scm:
* module/system/xref.scm: Adapt.
2013-11-19 19:11:40 +01:00
Andy Wingo
84680d2382 Miscellaneous fixups related to objcode removal.
* module/scripts/compile.scm: Fix --help message.

* module/system/repl/command.scm (disassemble): Fix error message.

* module/system/vm/frame.scm: Remove objcode import.

* module/system/vm/objcode.scm: Remove some exports related to the
  objcode type.
2013-11-08 17:42:54 +01:00
Andy Wingo
f3c0b53346 Remove assembly language.
* module/system/repl/command.scm: Remove disassembly cases for stack
  procedures.

* module/system/vm/inspect.scm: Adapt to disassemble RTL programs.

* module/language/assembly.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/assembly/decompile-bytecode.scm:
* module/language/assembly/disassemble.scm:
* module/language/assembly/spec.scm: Remove assembly language.

* module/Makefile.am: Adapt.
2013-11-08 16:45:10 +01:00
Andy Wingo
e15aa02284 Program sources are always pre-retire now
* module/system/repl/debug.scm (<debug>): Remove for-trap?.  Backtraces
  with RTL will always happen pre-retire on the top frame, source info
  is pre-retire, and continuations will always have a source-marked
  receive or receive-values or whatever with the right source marking,
  so we can remove this complication.
  (print-frame): Use frame-source.
  (print-frames): Remove for-trap? kw.

* module/system/repl/command.scm (define-stack-command, backtrace)
  (up, down, frame): Remove for-trap? introduced local, and its uses.
  (repl-pop-continuation-resumer): Adapt to make-debug change.

* module/system/repl/error-handling.scm (call-with-error-handling):
  Adapt to make-debug change.

* module/system/vm/frame.scm (frame-next-source): Remove.  RTL sources
  are pre-retire.

* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Adapt
  to use frame-source.  Still some work to do here.
2013-11-07 18:00:40 +01:00
Andy Wingo
57a5cc9760 Better REPL support for disassembling RTL images
* module/system/repl/command.scm (load-image): New helper.
  (compile, disassemble): Handle bytevectors.
2013-10-31 14:18:25 +01:00
Andy Wingo
93009a7aca ,xx for RTL images
* module/scripts/disassemble.scm (disassemble):
* module/system/vm/disassembler.scm (disassemble-file): Factor
  disassemble-file out.

* module/system/repl/command.scm (disassemble-file): Map ,xx to
  disassemble RTL images.
2013-08-29 20:50:19 +02:00
Andy Wingo
82e299f386 Add RTL disassembler
* module/Makefile.am:
* module/system/vm/disassembler.scm: New module.

* module/system/repl/command.scm (disassemble): Work with RTL programs.
2013-06-09 20:07:57 +02:00
Andy Wingo
c850a0ff4d pop-continuation abort-continuation hooks pass return vals directly
* 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.
2013-05-27 07:13:13 +02:00
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Andy Wingo
8d48877d2c ,option evaluates its right-hand-side
* doc/ref/scheme-using.texi (System Commands): Better documentation for
  ,option.

* module/system/repl/command.scm (option): Evaluate the RHS when setting
  an option.  Fixes bug 13076.
2013-03-07 11:29:01 +01:00
Andy Wingo
747bd5347d merge stable-2.0
There are some bugs with command-line handling that will be sorted out
with the next commit.
2013-01-23 16:12:08 +01:00
Andy Wingo
5745de9172 current-language is a parameter in boot-9
* module/ice-9/boot-9.scm (current-language): New parameter.

* module/system/base/language.scm (*current-language*): Pull fluid from
  parameter.
  (current-language): Now a re-exported parameter.

* doc/ref/compiler.texi: Update reference from *current-language* fluid
  to current-language parameter.

* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
  not to Scheme.

* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
  and parameterize.
2013-01-22 15:38:04 +01:00
Andy Wingo
2aed2667fc Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/expand.c
	libguile/hashtab.c
	libguile/ports.c
	libguile/vectors.c
	libguile/weaks.c
	module/language/ecmascript/compile-tree-il.scm
	module/language/tree-il/effects.scm
	module/language/tree-il/fix-letrec.scm
	module/language/tree-il/peval.scm
	test-suite/tests/peval.test
2012-07-06 16:52:54 +02:00
Daniel Krueger
e1fb0e811b fixed repl command ,describe to also handle syntax 2012-07-06 14:35:10 +02:00
Andy Wingo
b8bc86bce1 instead of our custom .go format, use elf
* libguile/objcodes.c: Change to expect objcode on disk to be embedded
  in ELF instead of having the funky cookie.

  (to_native_order): Use already existing SCM_BYTE_ORDER style byte
  order instead of chars.
  (bytecode_to_objcode): No need for word_size arg.
  (scm_bytecode_to_objcode, scm_objcode_to_bytecode): Take optional
  endianness arg instead of sometimes using target-endianness.
  (scm_load_objcode, scm_write_objcode, scm_bytecode_to_native_objcode):
  Remove.

* libguile/objcodes.h: Adapt.

* libguile/vm.c (scm_load_compiled_with_vm): Use
  scm_load_thunk_from_file.
  (make_boot_program): Adapt to use scm_bytecode_to_objcode with
  endianness arg.

* module/Makefile.am (OBJCODE_LANG_SOURCES): Add (language objcode
  elf).
* module/language/objcode/elf.scm: New module, embeds objcode in ELF.

* module/language/bytecode/spec.scm (compile-objcode):
  (decompile-objcode): Use (target-endianness).

* module/language/objcode/spec.scm: use (language objcode elf) for
  write-objcode.

* module/scripts/disassemble.scm (disassemble):
* module/system/repl/command.scm (disassemble-file): Use
  load-thunk-from-file.

* module/system/vm/objcode.scm: Remove load-objcode and write-objcode.

* test-suite/tests/asm-to-bytecode.test (test-target): Adapt to the new
  ELF world.
2012-06-22 13:40:50 +02:00
Andy Wingo
2aef6c2ba9 ,language at REPL sets current-language
* module/system/repl/command.scm (language): Set the
  *current-language*.
* module/system/repl/repl.scm (start-repl): Create a new dynamic scope
  for *current-language*.
2011-12-04 21:56:13 +01:00
BT Templeton
74e4dd2798 set width for `,trace' command
* module/system/repl/command.scm (trace): Set trace width to terminal
  width by default.
2011-10-22 12:46:56 +02:00
Andy Wingo
d62dd76685 add ,expand and ,optimize
* module/system/repl/command.scm (*command-table*, expand, optimize):
  New meta-commands.
* module/system/repl/common.scm (repl-expand, repl-optimize): New
  helpers.

* doc/ref/scheme-using.texi (Compile Commands): Document.
2011-10-10 17:01:11 +02:00
Andy Wingo
c1e3e9aaff more precision for ,time
* module/system/repl/command.scm (time): Use the high-precision timers
  instead of stime(2).  Changes the output format of `,time' too;
  perhaps there is a better way.
2011-07-07 09:57:19 +02:00
Andy Wingo
fb6df3ea13 fix error message on ,disassemble "non-procedure"
* module/language/objcode/spec.scm (decompile-value): Don't assume that
  `error' will handle format strings appropriately.
* module/system/repl/command.scm (disassemble): A more human error when
  you disassemble a non-procedure.

Bug reported by Andrew Horton.
2011-03-29 12:38:18 +02:00
Andy Wingo
bb455e4f94 allow ,option on-error report instead of debug
* module/system/repl/command.scm:
* module/system/repl/debug.scm (terminal-width): Move terminal-width
  here, make it thread-local, and export it.
  (print-locals, print-frame, print-frames): Default width to
  terminal-width.

* module/system/repl/error-handling.scm (call-with-error-handling): Add
  `report' and `backtrace' on-error handlers.

* module/system/repl/common.scm (repl-default-options): Add on-error
  REPL option, defaulting to `debug', but which may be changed.

* module/system/repl/repl.scm (run-repl): Pass the #:on-error REPL
  option to call-with-error-handling.
2011-03-17 12:39:59 +01:00
Andy Wingo
090f14b890 repl: terminal-width by default
* module/system/repl/command.scm (terminal-width): New parameter that
  will use the true terminal width if unset.
  (backtrace, locals): Default to (terminal-width).
  (width): Simplify.
2011-03-04 11:16:15 +01:00
Michael Gran
47b86dbf4d Add ,width meta-command to set screen width in debug output
This meta-command allows one to set the default number of columns
that output from ,backtrace and ,locals shall occupy.

* doc/ref/scheme-using.texi (Debug Commands): document ,width
* module/system/repl/command.scm (*width*): new var
  (backtrace, locals): use *width* in optarg
  (width): new meta-command
2011-03-04 11:01:48 +01:00
Andy Wingo
c7d6f8b279 fix ,stat
* module/system/repl/command.scm (statistics): Fix for BDW-GC.
  Unfortunately we still don't have mallocation or time taken.
2011-03-04 10:33:51 +01:00
Andreas Rottmann
de9a0f008f Fix `show' REPL meta-command
* module/system/repl/command.scm (warranty, copying, version): Use
  `define-meta-command' to define these procedures, so they are entered
  into the *command-infos* table.
2011-02-01 23:50:09 +01:00
Andy Wingo
cdab9fc625 add ,reload meta-command and document it and reload-module
* module/ice-9/boot-9.scm (reload-module): Add docstring.
* module/system/repl/command.scm (reload): New meta-command.

* doc/ref/scheme-using.texi (Module Commands): Document the ,reload
  meta-command.
* doc/ref/api-modules.texi (Module System Reflection): Document
  reload-module.
2010-12-17 13:27:43 +01:00
Andreas Rottmann
8fdd85f834 Allow user-defined meta-commands
Besides allowing user-defined meta-commands, this change also refactors
the meta-command machinery to split reading a command's arguments from
the procedure actually implementing it, and hence allows nesting
meta-commands.  As an example of such a command, ",in" is added as a new
meta-command.

* module/system/repl/command.scm: Export `define-meta-command'.
  (*command-module*): Replaced by the hash table `*command-infos*'.
  (command-info, make-command-info, command-info-procedure)
  (command-info-arguments-reader): New procedures, encapsulating the
  information about a meta-command.
  (command-procedure): Adapted to use the `command-info' lookup
  procedure.
  (read-command-arguments): New auxiliary procedure invoking a command's
  argument reader procedure.
  (meta-command): Adapted to the split of reading arguments and
  executing a command.
  (add-meta-command!): New auxiliary procedure, registers a meta
  command's procedure and argument reader into `*command-infos* and
  `*command-table*.
  (define-meta-command): Extended to allow specification of the command's
  category; split the argument reader and actual command procedure.
  (guile:apropos, guile:load, guile:compile-file, guile:gc): Remove these
  aliases, they are unnecessary as we now use a hash table instead of the
  module to store the commands.
  (in): New meta-command, which evaluates an expression, or alternatively
  executes another meta-command, in the context of a specific module.
* doc/ref/scheme-using.texi (Module Commands): Document the `in'
  meta-command.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-20 23:55:19 +01:00
Andy Wingo
c372cd74fd repl read/write using current ports, not captured ports
Fixes bug in repl meta-commands after activating readline, which changes
the current input port.

* module/system/repl/common.scm (<repl>): Remove inport and outport
  fields.
  (make-repl): Adapt.
  (repl-read, repl-print): Just read and write to the current ports.

* module/system/repl/repl.scm (meta-reader): Meta-read from the current
  input port.

* module/system/repl/command.scm (read-command, define-meta-command):
  Read from the current input port.
2010-11-18 14:32:53 +01:00
Andy Wingo
5aa12c699c ,frame and related commands handle for-trap? appropriately
* module/system/repl/debug.scm (print-frame): Add #:next-source? arg,
  for when print-frame should use frame-next-source instead of
  frame-source.
  (print-frames): Add #:for-trap? arg. If true, the 0th frame should be
  printed with frame-next-source.

* module/system/repl/command.scm (define-stack-command): Introduce
  for-trap? into the lexical env.
  (backtrace, up, down, frame): Update to do the right thing regarding
  #:for-trap?.
2010-10-12 13:24:46 +02:00
Andy Wingo
5414d33376 don't warn for (format #t fmt) -- format string actually named fmt
* module/language/tree-il/analyze.scm (format-analysis): Don't warn on
  non-literal format string if the format string is a lexical ref to a
  variable named "fmt". A slight hack, but effective :)
* module/system/repl/command.scm (display-stat): Rename the format
  string to "fmt".
2010-10-12 13:11:40 +02:00
Andy Wingo
a36c3a458e debug has for-trap? field
* module/system/repl/debug.scm (<debug>): New field, `for-trap?'. True
  if the stack is for a trap, and thus the top frame should use
  frame-next-source instead of frame-source.

* module/system/repl/command.scm (repl-pop-continuation-resumer)
  (repl-next-resumer):
* module/system/repl/error-handling.scm (call-with-error-handling):
  Update callers.
2010-10-12 13:09:48 +02:00
Ludovic Courtès
08002eae4d Fix typo.
* module/system/repl/command.scm (repl-pop-continuation-resumer): Remove
  extraneous argument to `format'.
2010-10-10 19:10:11 +02:00
Andy Wingo
aee24bac50 fix a bug in `finish'
* module/system/repl/command.scm (repl-pop-continuation-resumer)
  (finish): Fix a bug printing return values.
2010-10-08 12:31:56 +02:00
Andy Wingo
1ecf39a6a7 add repl debugging command docs
* doc/ref/scheme-using.texi (Debug Commands): Add docs for new debugging
  commands (break, step, registers, etc).
2010-10-08 12:31:50 +02:00
Andy Wingo
e7544f39a4 rename vm-trace to call-with-trace
* module/system/vm/trace.scm (print-application, print-return): Change
  to add more whitespace, as (ice-9 debug) did.
  (call-with-trace): Rename from vm-trace, and make the vm a keyword
  argument.

* module/system/repl/command.scm: Don't autoload (system vm profile).
  (trace): Update for call-with-trace name change.
2010-10-07 12:55:37 +02:00
Andy Wingo
439e032b0b add ,step ,stepi ,next and ,nexti
* module/system/vm/traps.scm (trap-matching-instructions): New trap,
  just installs a next hook and runs the handler when a predicate
  succeeds.

* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): New
  procedure, uses trap-matching-instructions with an appropriate
  predicate to handle step, stepi, next, and nexti repl metacommands.

* module/system/repl/command.scm (step, step-instruction, next)
  (next-instruction): New repl debugger commands.
2010-10-06 21:19:08 +02:00
Andy Wingo
e8e4e7310c cleanups to ,finish
* module/system/repl/command.scm (repl-pop-continuation-resumer): Factor
  out of finish.
  (finish): Adapt.

* module/system/vm/trap-state.scm (add-ephemeral-trap-at-frame-finish!):
  Rename to add "ephemeral" to the name.

* module/system/vm/traps.scm (trap-calls-to-procedure): Remove unused
  #:width kwarg.
2010-10-06 21:17:06 +02:00
Andy Wingo
c6025e76ff add ,finish repl meta-command
* module/system/repl/command.scm (finish): New REPL meta command. Uses
  fancy prompt stuff.
2010-10-05 21:53:58 +02:00