Exploring Stack in GDB
Explore stack in GDB disassembly output.
We'll cover the following...
We'll cover the following...
Simple stack in GDB
To see the call stack in action, we’ll use a project called SimpleStack.
Source code
The source code of the stack is given below:
Simple stack
The code for the simple stack is:
We define three functions func, func2, and func3 as below:
Method func
The code for func is:
Method func2
The code for func2 is:
Method func3
The code for func3 is:
Compilation and execution of code:
We compile the files and load the executable into GDB:
gcc SimpleStack.c func.c func2.c func3.c -o SimpleStack
gdb ./SimpleStack
Note: You can practice all ...