Chapter 8. Examining the Stack 55the backtrace, to avoid tracing into highly system-specific (and generally uninteresting) code. If youneed to examine the startup code, then you can change this behavior.set backtrace-below-main offBacktraces will stop when they encounter the user entry point. This is the default.set backtrace-below-mainset backtrace-below-main onBacktraces will continue past the user entry point to the top of the stack.show backtrace-below-mainDisplay the current backtrace policy.8.3. Selecting a frameMost commands for examining the stack and other data in your program work on whichever stackframe is selected at the moment. Here are the commands for selecting a stack frame; all of them finishby printing a brief description of the stack frame just selected.frame nf nSelect frame number n. Recall that frame zero is the innermost (currently executing) frame, frameone is the frame that called the innermost one, and so on. The highest-numbered frame is the onefor main.frame addrf addrSelect the frame at address addr. This is useful mainly if the chaining of stack frames has beendamaged by a bug, making it impossible for gdb to assign numbers properly to all frames. Inaddition, this can be useful when your program has multiple stacks and switches between them.On the SPARC architecture, frame needs two addresses to select an arbitrary frame: a framepointer and a stack pointer.On the MIPS and Alpha architecture, it needs two addresses: a stack pointer and a programcounter.On the 29k architecture, it needs three addresses: a register stack pointer, a program counter, anda memory stack pointer.up nMove n frames up the stack. For positive numbers n, this advances toward the outermost frame,to higher frame numbers, to frames that have existed longer. n defaults to one.down nMove n frames down the stack. For positive numbers n, this advances toward the innermostframe, to lower frame numbers, to frames that were created more recently. n defaults to one. Youmay abbreviate down as do.All of these commands end by printing two lines of output describing the frame. The first line showsthe frame number, the function name, the arguments, and the source file and line number of executionin that frame. The second line shows the text of that source line.