如何解释 GDB “信息框架"输出? [英] How to interpret GDB "info frame" output?

查看:18
本文介绍了如何解释 GDB “信息框架"输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我理解这一点:-

Can some please help me to understand this:-

(gdb) info frame
Stack level 0, frame at 0xb75f7390:
 eip = 0x804877f in base::func() (testing.cpp:16); saved eip 0x804869a
 called by frame at 0xb75f73b0
 source language c++.
 Arglist at 0xb75f7388, args: this=0x0
 Locals at 0xb75f7388, Previous frame's sp is 0xb75f7390
 Saved registers:
  ebp at 0xb75f7388, eip at 0xb75f738c

ebp, eip Locals at and Previous Frame's sp"是什么意思?请解释

What is "ebp, eip Locals at and Previous Frame's sp " means? Please explain

推荐答案

(gdb) 信息框

堆栈级别 0

  • 回溯帧数,0为当前执行帧,向下增长,与栈一致.
  • frame num in backtrace, 0 is current executing frame, which grows downwards, in consistence with the stack.

帧在 0xb75f7390

  • 此堆栈帧的起始内存地址

eip = 0x804877f in base::func() (testing.cpp:16);保存的eip 0x804869a

  • eip 是下一条要执行的指令的寄存器(也称为程序计数器).所以此时下一个要执行的是0x804877f",也就是testing.cpp的第16行.

  • eip is the register for next instruction to execute (also called program counter). so at this moment, the next to execute is at "0x804877f", which is line 16 of testing.cpp.

保存的eip0x804869a"就是所谓的返回地址",即从这个被调用栈返回后在调用栈帧中恢复的指令.它在CALL"指令时被压入堆栈(保存以供返回).

saved eip "0x804869a" is so called "return address", i.e., the instruction to resume in caller stack frame after returning from this callee stack. It is pushed into stack upon "CALL" instruction (save it for return).

在 0xb75f73b0 帧调用

  • 调用者栈帧的地址

源语言 c++

  • 使用哪种语言

参数列表位于 0xb75f7388,参数:this=0x0

  • 参数的起始地址

0xb75f7388 的本地人

局部变量的地址.

前一帧的 sp 为 0xb75f7390

这是前一帧的堆栈指针指向的位置(调用者帧),在调用的时刻,它也是被调用堆栈帧的起始内存地址.

this is where the previous frame´s stack pointer point to (the caller frame), at the moment of calling, it is also the starting memory address of called stack frame.

已保存的寄存器:这些是被调用者堆栈上的两个地址,用于两个保存的寄存器.

Saved registers: These are the two addresses on the callee stack, for two saved registers.

  • ebp 在 0xb75f7388这是保存调用者堆栈帧的ebp"寄存器的地址(请注意,它是寄存器,而不是调用者的堆栈地址).即,对应于PUSH %ebp".ebp"是寄存器通常被认为是这个栈帧的locals的起始地址,它使用offset"来寻址.换句话说,局部变量的操作都使用这个ebp",所以你会看到像mov -0x4(%ebp), %eax等等.

eip 在 0xb75f738c如前所述,但这里是堆栈的地址(包含值0x804877f").

eip at 0xb75f738c as mentioned before, but here is the address of the stack (which contains the value "0x804877f").

这篇关于如何解释 GDB “信息框架"输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆