When the debugged program stops, gdb is able to analyze its call
stack (see Stack frames). The
represents a frame in the stack. A
<gdb:frame> object is only valid
while its corresponding frame exists in the inferior's stack. If you try
to use an invalid frame object, gdb will throw a
gdb:invalid-object exception (see Guile Exception Handling).
<gdb:frame> objects can be compared for equality with the
equal? function, like:
(gdb) guile (equal? (newest-frame) (selected-frame)) #t
The following frame-related procedures are provided by the
#tif frame is valid,
#fif not. A frame object can become invalid if the frame it refers to doesn't exist anymore in the inferior. All
<gdb:frame>procedures will throw an exception if the frame is invalid at the time the procedure is called.
Return the function name of frame, or
#fif it can't be obtained.
<gdb:architecture>object corresponding to frame's architecture. See Architectures In Guile.
Return the type of frame. The value can be one of:
- An ordinary stack frame.
- A fake stack frame that was created by gdb when performing an inferior function call.
- A frame representing an inlined function. The function was inlined into a
NORMAL_FRAMEthat is older than this one.
- A frame representing a tail call. See Tail Call Frames.
- A signal trampoline frame. This is the frame created by the OS when it calls into a signal handler.
- A fake stack frame representing a cross-architecture call.
- This is like
NORMAL_FRAME, but it is only used for the newest frame.
Return an integer representing the reason why it's not possible to find more frames toward the outermost frame. Use
unwind-stop-reason-stringto convert the value returned by this function to a string. The value can be one of:
- No particular reason (older frames should be available).
- The previous frame's analyzer returns an invalid result.
- This frame is the outermost.
- Cannot unwind further, because that would require knowing the values of registers or memory that have not been collected.
- This frame ID looks like it ought to belong to a NEXT frame, but we got it for a PREV frame. Normally, this is a sign of unwinder failure. It could also indicate stack corruption.
- This frame has the same ID as the previous one. That means that unwinding further would almost certainly give us another frame with exactly the same ID, so break the chain. Normally, this is a sign of unwinder failure. It could also indicate stack corruption.
- The frame unwinder did not find any saved PC, but we needed one to unwind further.
- The frame unwinder caused an error while trying to access memory.
- Any stop reason greater or equal to this value indicates some kind of error. This special value facilitates writing code that tests for errors in unwinding in a way that will work correctly even if the list of the other values is modified in future gdb versions. Using it, you could write:(define reason (frame-unwind-stop-readon (selected-frame))) (define reason-str (unwind-stop-reason-string reason)) (if (>= reason FRAME_UNWIND_FIRST_ERROR) (format #t "An error occured: ~s\n" reason-str))
Return the frame's code block as a
<gdb:block>object. See Blocks In Guile.
Return the symbol for the function corresponding to this frame as a
#fif there isn't one. See Symbols In Guile.
Return the frame's
<gdb:sal>(symtab and line) object. See Symbol Tables In Guile.
Return the value of register in frame. register should be a string, like ‘pc’.
Return the value of variable in frame. If the optional argument block is provided, search for the variable from that block; otherwise start at the frame's current block (which is determined by the frame's current program counter). The variable must be given as a string or a
<gdb:symbol>object, and block must be a
Set frame to be the selected frame. See Examining the Stack.
Return the selected frame object. See Selecting a Frame.