在 Windows 98 上调试:从 EIP 获取代码行
我在 Windows 98(DOS 模式)下编码,我的程序严重崩溃。我可以很好地重现崩溃,但是我的正常调试技巧(堆栈跟踪、printf 来隔离崩溃的整个过程)失败了,因为图形模式(VBE)、DOS 模式和中断处理的组合显然不是 GDB 的样子为.
我尝试注释部分代码来隔离问题,但无法准确跟踪崩溃的代码位置。
所以我能得到的只是一堆寄存器。有没有办法从寄存器(如EIP)中检索一行代码?我正在用 C 编码。
I am coding in Windows 98(DOS mode) and my program is crashing badly. I can reproduce the crash just fine, but my normal debugging tricks(stack trace, printf the whole thing to isolate the crash) are failing, because the combination of graphics mode(VBE), DOS mode and interrupt handling is apparently not what GDB was made for.
I've tried commenting parts of my code to isolate the problem but I can not trace the code location of the crash exactly.
So all I can get is a bunch of registers. Is there any way to retrieve a line of code from registers(like EIP)? I am coding in C.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番谷歌搜索后,我发现了一些 GDB 文档 与此:
使用此命令似乎是我能找到的从地址获取函数名称的最接近的命令。它不会给出确切的代码行,但总比没有好。
After some googling, I found some GDB documentation with this:
Using this command seems to be the closest thing I could find to get a function name from an address. It won't give the exact line of code, but it's better than nothing.