在WinDbg中,可以在没有符号的情况下使用软件断点吗? [英] In WinDbg, can I use software breakpoints without having symbols?

查看:90
本文介绍了在WinDbg中,可以在没有符号的情况下使用软件断点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在WinDbg中使用软件断点来中断给定地址.

I'm having trouble using software breakpoints in WinDbg in order to break in a given address.

这是Visual C ++ 6.0 MFC可执行文件,没有符号(请相信,我只是无法生成符号).

It's a Visual C++ 6.0 MFC executable without symbols (belive me, I just can not generate the symbols).

假设我的可执行映像名为 image00400000 .使用软件断点(bp):

Suppose my executable image is named image00400000. Using Software Breakpoints (bp):

0:000>bp image00400000 + 0x003ba1eb

0:000> bp image00400000 + 0x003ba1eb

0:000>bl

0:000> bl

0 e 007ba1eb 0001(0001)0:**** image00400000 + 0x3ba1eb

0 e 007ba1eb 0001 (0001) 0:**** image00400000+0x3ba1eb

0:000>g

0:000> g

我从.map文件中获得了相对地址(0x003ba1eb)(这是我得到的).我确定可以执行的行,但是完全没有停止 ...

I get the relative address (0x003ba1eb) from the .map file (this one I got it). I pick up a line which I'm sure that will be executed, but there is no stop at all...

有人有什么想法吗?我会很感激他们.谢谢!

Does anyone have any ideas? I'd appreciate them. Thank you!

PD:如果还有什么要解释的或者您需要更多信息,请给我留言:-)

PD: If there's anything left to explain or you need more info, just drop me a comment :-)

推荐答案

对不起,我还不允许创建注释(太新了).

Sorry I'm not allowed to create comments yet (too new) to SO.

要具体说明可用的信息有些棘手.我猜可能是断点地址计算不正确.在这种情况下,我将尝试按以下方式计算断点地址:模块开始+代码开始+映射文件中的代码偏移量.也许这就是你所做的(除非我弄错了;-))

It is a bit tricky to be specific with the information available. I guess it is possible that the breakpoint address isn't calculated correctly. Given the situation I would attempt to calculate the breakpoint address as: Module start + code start + code offset from the map file. Maybe this is what you did (unless I got it wrong ;-) )

还值得注意的是,bp地址需要在指令边界上对齐.如果不正确,则无法正确设置.如果您不得不猜测要在特定功能中使用断点,则可能会发生这种情况.

Also worth noting that the bp address needs to align on an instruction boundary. If it doesn't then it won't be set properly. This could be possible if you are having to guess at trying to get a breakpoint into a particular function.

概述一下您希望程序在调试器中停止的条件可能会有所帮助.

It might be helpful to outline a little more about the condition under which you want the program to stop in the debugger.

这篇关于在WinDbg中,可以在没有符号的情况下使用软件断点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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