Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I examine the stack frame with GDB?

Tags:

stack

gdb

Right now I've been using GDB to disassemble a binary file and check out different registers and whatnot. Is there an easy command to examine everything on the stack? Can this be limited to everything in a function?

like image 545
GetOffMyLawn Avatar asked May 05 '10 05:05

GetOffMyLawn


People also ask

What GDB command shows the contents of the current stack frame?

info frame displays information about the current stack frame. info locals displays the list of local variables and their values for the current stack frame, and info args displays the list of arguments.

What GDB command verifies and displays the stack frames?

Selects a stack frame or displays the currently selected stack frame.

What are the three commands used in GDB to examine and move within the stack?

Able to view and traverse the function call stack using the where, up, down and frame commands.


1 Answers

You can view the contents of the stack with x/10x $sp

This will print the top 10 elements of the stack.

like image 188
Flow Avatar answered Sep 18 '22 16:09

Flow