In WinDbg, can I use software breakpoints without having symbols?

六月ゝ 毕业季﹏ 提交于 2019-12-25 11:34:36

问题


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

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

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

0:000> bp image00400000 + 0x003ba1eb

0:000> bl

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

0:000> g

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: If there's anything left to explain or you need more info, just drop me a comment :-)


回答1:


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 ;-) )

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.




回答2:


To add symbols, you need to make a debug build

BUILD menu item

Set Active Configuration

Select the Debug Configuration, instead of the release configuration. Rebuild everything, and your symbols should be there.



来源:https://stackoverflow.com/questions/1503670/in-windbg-can-i-use-software-breakpoints-without-having-symbols

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!