gdb调试的时候会出现esp和ebp这两个指针,而这两个指针为我们查看栈的情况提供了方便。

简单点说,esp指向栈顶,而ebp指向栈底。例如一段程序:

 1 #include <stdio.h>
 2 
 3 int layout(int a){
 4     int b = a + 5;
 5     return b;    
 6 }
 7 
 8 int main(void){
 9     int a = 5;
10     layout(5);
11 
12     return 0;      
13 }
View Code

相关文章:

  • 2021-12-03
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2021-11-13
  • 2021-11-17
相关资源
相似解决方案