Linux tool for reading stack values
I would like to know if there is a Linux tool that allows you to read the values ββof the program stack? For example, when you run a binary program file containing the line:
foo(parameter);
the parameter will be pushed onto the stack and I would like to know if it has a tool to access it.
thank.
+2
source to share
3 answers
Gdb?
Glibc also has some backtrace functions. http://www.gnu.org/s/libc/manual/html_node/Backtraces.html
+5
source to share
Yes, it looks like you just want to start the debugger. If you compile your program with the -g option, you can use gdb like:
gdb myprogram
Now set a breakpoint in your function and you can view the values ββof the variables in the current scope.
If you are a C newbie, you should take the time to learn gdb (the Gnu debugger).
+4
source to share