DLL调试中断点失效的问题

    用VS2008编写了一个DLL工程,打算加上application进行调试,结果点下F5,DLL工程中的所有断点都被禁掉了,显示如下:

 

    The breakpoint will not currently be hit. No symbols have been loaded for this document.

 

   在网上搜了一下有没有找到合适的结果,自己瞎折腾倒是折腾出来了,再搜,找到了合适的结果,总结如下:

 

 

   原因

 

  DLL工程中的 pdb 文件的时间戳与application路径下的dll文件的时间戳 不一致。即当DLL工程新编译后,没有将工程下的新编译的dll文件拷贝至 application路径下,使得 application路径下的dll文件仍然为旧的。

 

  解决办法

 

  1. 将application exe拷贝至DLL功能debug目录下,这样就不会发生上述情况。


  2. 在每次新编译dll后及时更新 application路径下的dll文件。

 

  顺带附上在网上找到的一个英文解决办法,没看太懂,是C#,不过道理估计是相通的。

 

two projects, the first one (A) calls the second (B) as a .dll .Both are projects for PocketPC (Smart device applications).
When i set a Breakpoint in the code of B it looks OK but when i Debug Question Mark appears with the infamous

note: The Breakpoint will not currently be hit. No Symbols have been loaded for this document.

The B.pdb has a timestamp different from B.dll and THIS is the problem. You have to DELETE B.pdb NOT ONLY from the Debug/bin directory because THERE IS ANOTHER COPY of this B.pdb in the obj directory and you CAN'T touch this copy so easily. So here is the complete walkthrough:

1) For your project set "Generate DEBUG information" to FALSE
2) DELETE ALL the occurences of B.pdb under /bin and /obj
3) Set "Generate DEBUG information" back to TRUE
4) BUILD


Between 2 and 3 I also built once but i think this is not necessary.

Now my pdb and dll have the same timestamp and all is working perfectly

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值