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

19 commits

Author SHA1 Message Date
Andy Wingo
9b78275eb0 stepping traps use frame-next-source, not frame-source
* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Use
  frame-next-source in stepping traps.
2010-10-08 12:31:56 +02:00
Andy Wingo
de03880abe document trap states
* module/system/vm/trap-state.scm: Export add-trap!.

* doc/ref/api-debug.texi (Trap States): Document.
2010-10-07 22:50:33 +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
df067433a5 (system vm trap-state): add-trap-at-frame-finish!
* module/system/vm/traps.scm: Fix a comment.

* module/system/vm/trap-state.scm (<trap-state>): Add next-ephemeral-idx
  slot.
  (wrapper-at-index): Use eqv? instead of = to avoid type errors in user
  inputs.
  (next-ephemeral-index!, ephemeral-handler-for-index): New functions,
  allocate ephemeral trap ids for functions to be called only once.
  (add-trap-at-frame-finish!): New export, traps when a frame finishes.
2010-10-05 21:53:29 +02:00
Andy Wingo
2c04cf390b fix embarrassing error preventing ,del from working
* module/system/vm/trap-state.scm (remove-trap-wrapper!): Oops, fix
  newbie error regarding delq and mutation.
2010-10-05 21:48:27 +02:00
Andy Wingo
2c5fc8d034 source breakpoints accept user line numbers
* module/system/vm/trap-state.scm (add-trap-at-source-location!):
* module/system/vm/traps.scm (trap-at-source-location): Rename "line"
  argument to "user-line", indicating that the line is one-based instead
  of zero-based. Decrement the line before handing off to
  source-closures-or-procedures and source->ip-range.
2010-10-01 18:25:44 +02:00
Andy Wingo
fb5c4dc523 add ,break-at-source
* module/system/vm/trap-state.scm (add-trap-at-source-location!): New
  proc.
* module/system/repl/command.scm (break-at-source): New repl
  meta-command. Doesn't work as well as it could now because it doesn't
  know about nested functions, but that's coming.
2010-09-23 17:49:55 +02:00
Andy Wingo
3db15dce00 another trap printing tweak
* module/system/vm/trap-state.scm (add-trap-at-procedure-call!):
  (add-trace-at-procedure-call!): Breakpoint / tracepoint name tweaks.
2010-09-23 17:28:15 +02:00
Andy Wingo
665196884f list-traps just returns trap identifiers, not names
* module/system/vm/trap-state.scm (list-traps): Just return the integers
  identifying the traps; people can use trap-name to get the names.

* module/system/repl/command.scm (traps): Adapt.
2010-09-23 17:26:12 +02:00
Andy Wingo
1241f6944b trace printing tweak
* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Tweak
  to the #:prefix string.
2010-09-23 17:25:30 +02:00
Andy Wingo
6263b8722e add trap-name procedure
* module/system/vm/trap-state.scm (trap-name): New proc.
2010-09-23 17:20:05 +02:00
Andy Wingo
abb4b5cbbd tracepoints print their trap number
* module/system/vm/trace.scm (print-application, print-return): Add a
  prefix before the printout.
  (trace-calls-to-procedure, trace-calls-in-procedure): Add prefix
  keyword args.

* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Give a
  useful prefix for tracepoint printouts.
2010-09-23 17:17:16 +02:00
Andy Wingo
25361a80fe add repl ,tracepoint command
* module/system/vm/trace.scm (print-return, print-application)
  (frame-return-values): Factored out of other things.
  (trace-calls-to-procedure): New proc, installs a trap tracing only
  calls to the given proc.
  (trace-calls-in-procedure): Refactor a bit.

* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): New
  proc.

* module/system/repl/command.scm (tracepoint): New command, installs a
  tracepoint on a procedure.
2010-09-23 13:47:03 +02:00
Andy Wingo
b0e556d4d0 avoid traps in repl except when evaluating the expression
* module/system/vm/trap-state.scm (with-default-trap-handler): Don't
  enable traps if we are setting a handler of #f.

* module/system/repl/error-handling.scm (call-with-error-handling): Add
  #:trap-handler arg.

* module/system/repl/repl.scm (run-repl): Only have traps enabled while
  running the thunk. Otherwise we trace on procedures called as part of
  the repl.
2010-09-23 13:45:23 +02:00
Andy Wingo
1bc1800ffa tracing in terms of traps
* module/system/vm/traps.scm (trap-frame-finish)
  (trap-in-dynamic-extent, trap-calls-in-dynamic-extent)
  (trap-instructions-in-dynamic-extent): New traps, for implementing
  tracing, and the `finish' command.

* module/system/vm/trace.scm (trace-calls-in-procedure)
  (trace-instructions-in-procedure): New tracing traps.
  (vm-trace): Reimplement in terms of the new traps.

* module/system/vm/trap-state.scm (add-trap!): New helper; not used in
  this commit, though.
2010-09-23 11:56:21 +02:00
Andy Wingo
65bce23759 breakpoints from recursive prompts work
* module/system/vm/traps.scm (new-disabled-trap): Don't manipulate the
  VM trace level in the enable and disable handlers. Unfortunately, this
  makes traps not work unless you enable hooks, but given that
  vm_dispatch_hook has to set trace-level to 0, there needs to be an
  object with a broader view of what traps are enabled. That object is
  the hook state.

* module/system/vm/trap-state.scm (trap-state->trace-level): New
  procedure.
  (with-default-trap-handler): Add an optional trap-state argument. Now
  makes sure that the vm-trace-level is set appropriately during the
  execution of the thunk, allowing for breakpoints from recursive
  prompts.
2010-09-21 21:37:11 +02:00
Andy Wingo
e366757659 default-trap-handler bugfix
* module/system/vm/trap-state.scm (default-trap-handler): Fix thinko.
2010-09-19 12:20:58 +02:00
Andy Wingo
b9badc35ab implement breakpoints in the repl
* module/system/vm/trap-state.scm: New file, tracks a VM-specific set of
  traps.
* module/Makefile.am: Add trap-state.scm.

* module/system/repl/error-handling.scm: While in a with-error-handling
  block, bind a default trap handler that invokes a recursive prompt.

* module/system/repl/command.scm: Add a `break' repl meta-command.
2010-09-19 11:32:11 +02:00