解决断点不工作

原创 2004年08月26日 21:13:00

最近在一个动态库中调试程序,这个动态库是可执行文件在执行过程中动态加载的,所以在动态库代码中设置断点,启动调试的时候总是会出现一个断点无效的警告,并且断点变成灰色,只有当动态库被加载后才能设置断点

在MSDN中找了半天,终于找到解决方案:

Can't Set Breakpoint in Source File When Corresponding Symbolic Info Isn't Loaded into Memory by Debugger

You cannot set a breakpoint in any source file when the corresponding symbolic information will not be loaded into memory by the debugger. Symptoms include messages such as "the breakpoint cannot be set" or a simple, non-informational beep. When setting breakpoints before the debuggee has been started, the debugger uses a breakpoint list to keep track of how and where to set breakpoints. When you actually begin the debugging session, the debugger loads the symbolic information for all designated debuggees and then walks through its breakpoint list, attempting to set the breakpoints.

However, if one or more of the debuggees have not been designated to the debugger, there will be no symbolic information for the debugger to use when walking through its breakpoint list. Situations where this is likely to occur include:

  • Attempts to set breakpoints in a DLL before the call to LoadLibrary.
  • Setting a breakpoint in an OLE server before the container has started the server.
  • Other similar cases.

NOTE: After you receive notification that these breakpoints cannot be set, the breakpoints will usually continue to show up in the breakpoint list, but they will have a dash (-) to their left, indicating that they are disabled (have not been set).

To prevent this behavior in Visual C++, specify all additional DLLs and OLE servers in the Additional DLLs field in the Options.Debug... dialog box. To prevent this behavior in in CodeView, use the /L command line switch to notify CodeView that you want it to Load symbolic debug information for additional .EXE and .DLL files. When this has been done, breakpoints set in code that has not yet been loaded into memory will be "virtual" breakpoints. When the code is actually loaded into memory by the loader, these become physical breakpoints. Ensure that these additional debuggees are not already running when you start your debugging session. Failure to follow this rule will likely cause breakpoints to be missed.

文档中说解决方案是在设置的Additional DLLs中指定需要加载的DLLs.就这么一句没头没脑的话,让我捉摸半天,最后终于发现在project-settings的debug标签中,给category选择Additional DLLs,哈哈,在下面的Modules中输入需要加载的DLLs的名称,就可以了

轻松实现session的mysql处理

      通常,session都是保存在临时文件里的,但是,要是把它保存在数据库里,就会给我们带来很多好处,比如统计在线人数之类的。废话不说了,看程序:include("db_mysql.inc")...
  • tianhaiyise
  • tianhaiyise
  • 2002-01-07 10:13:00
  • 584

eclipse在没有断点的地方中断了

断点调试时会打一些断点,在一步步往下调试过程中 之前的断点就不需要了,去掉之后再次debug时会发现还是停在了去掉断点的地方,这个时候怎么办呢?...
  • u010477502
  • u010477502
  • 2016-07-07 15:25:44
  • 2297

Http 206 文件断点续传下载原理

摘要: Http 206 文件断点续传下载原理 HTTP 304/200(from cache) 静态资源缓存原理 HTTP 204/205状态响应&HEAD请求 header标头说明 ...
  • xiaofei0859
  • xiaofei0859
  • 2016-10-21 15:10:18
  • 4546

问答:Softice下了函数断点,但怎么也拦截不下来?

我在我的Xp上安装了Softice Driver Studio 4.3.1版本,但是奇怪的是竟然什么函数都拦截不下来我下bpx MessageBoxA,我明明看到User32!MessageBoxA就...
  • RockHwnd
  • RockHwnd
  • 2004-08-11 18:43:00
  • 1853

od下断方法总结

1.Ctrl+G:直接断API输入API名称,f2下断即可。2.Ctrl+N:输入表断API3.命令行 bp 函数名 下断4.插件利用apiBreakapi断点设置工具...
  • hercs
  • hercs
  • 2018-03-06 11:15:56
  • 63

断点工作原理

一、 F2断点 OD中的F2断点是int 3中断,也就是机器码0xCC指令。中断对应着中断处理函数,一旦系统执行到int3指令,这个指令将在处理器上产生硬件中断STATUS_BREAKPOINT...
  • CoderAldrich
  • CoderAldrich
  • 2015-01-22 14:14:06
  • 1233

调试断点原理之普通断点

以OD为调试器分析不同断点的区别: 普通断点原理:直接改写断点内存地址的第一个字节,替换为int3 (0xcc,软中断机制),并保存原始字节至OD维护的一张断点表处。程序运行到此处时会中断,抛出...
  • zxu618
  • zxu618
  • 2015-04-21 22:55:16
  • 1315

OD下断点的方法

寻常断点 Ollydbg中一般下中断的方法,就是在程序的地址处用鼠标选择这一行。然后按F2键,这时被选择的那一行的地址会变成别的颜色,就表示这个地址处下了中断。然后运行程序时只有到这个地址处就会被O...
  • purplethunder
  • purplethunder
  • 2008-05-20 21:42:00
  • 5922

断点的设置方法

断点的设置,本质上就是动态调试时,在大量代码中快速找到关键代码的过程。 在 Android 逆向过程中,设置断点有两个思路: 一)。顺流程思路 拿登录流程来说,必定有用户名及密码输入框以及登录按钮...
  • weixin_37556843
  • weixin_37556843
  • 2017-03-31 14:53:47
  • 282

OD消息断点的设置方法

这一篇讲的是 消息断点和RUN跟踪的简单知识  这一篇没怎么看明白  大概使用知道了   怎么用不太清楚。 介绍本次软件特点输入后木有反应(纱布垃圾的。。哈哈) -- 消息断点 RUN跟踪" t...
  • liujiayu2
  • liujiayu2
  • 2016-06-30 12:03:04
  • 2785
收藏助手
不良信息举报
您举报文章:解决断点不工作
举报原因:
原因补充:

(最多只允许输入30个字)