I don't know why I'm having so much trouble groking the documentation for the elisp debugger.
I see it has a commands to "step-into" (d). But for the life of me, I cannot see a step-out or step-over.
Can anyone help?
If I have this in the Backtrace buffer:
Debugger entered--returning value: 5047
line-beginning-position()
* c-parse-state()
* byte-code("...")
* c-guess-basic-syntax()
c-show-syntactic-information(nil)
call-interactively(c-show-syntactic-information)
...where do I put the cursor, and what key do I type, to step out of the parse-state() fn ? by that I mean, run until that fn returns, and then stop in the debugger again.
If the debugger was entered due to a C-g but you really want to quit, and not debug, use the q command. Return a value from the debugger.
Step Over: "When the next statement to execute reaches a method call, execute the method as a whole and stop" Step Out: "Finish off executing the callee's code and stop when execution returns to the caller" Continue: "Execute up until the next breakpoint"
If the current statement is a function or script call, then the debugger steps into that function or script, otherwise it stops at the next statement. In the Command Pane, type S and press ENTER, or, on the Debug menu, click Step Into. Step Over. Executes the current statement and then stops at the next statement.
If you want to execute the entire function with one keypress, type "next" or "n". This is equivalent to the "step over" command of most debuggers. If you want gdb to resume normal execution, type "continue" or "c". gdb will run until your program ends, your program crashes, or gdb encounters a breakpoint.
When debugging, I press ? and I see:
o edebug-step-out
f edebug-forward-sexp
h edebug-goto-here
I believe o (it is step-out
) and f (like step over) are what you're looking for, though I also find h extremely useful.
'c' and 'j' work kind of like a step-out and step-over. When a flagged frame (indicated by "*") is encountered (the docs say "exited" but this doesn't seem to be how the debugger behaves), the debugger will be re-entered. When the top frame is flagged, they work like step-over; when it isn't, they work like step-out.
In your example backtrace, typing either will step out of line-beginning-position
into c-parse-state
. The frame flag should clear, so typing either a second time should step out of c-parse-state
.
Hm. I, for one, prefer debug
to edebug
, but to each her own...
As to debug
, I use d
, c
, e
, and q
.
If you do use debug
, one thing to keep in mind, which can save time and effort, is that when you see a macro call (starts with#
) you can just hit c
to expand the macro -- there is normally no sense in digging into the macro expansion code (unless you wrote the macro and you are trying to debug it).
In particular, for dolist
, there are two levels of macroexpansion to skip over using c
: one for dolist
and one for block
.
HTH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With