Com+ debug issue: incorrect watch value and abnormal step through path

Issue:
When I started  to debug a Com+ project with VC8, I saw many incorrect value in the watch window, and abnormal step through path
 
For some CString variable:
When I watch them, I can not see the correct value of them. Sometimes I could see <Bad Ptr>, ""(empty) or some garbage strings like "pÏà".
 
For some int variable:
I even got the value like 2016111848, in the watch window. But in fact, the correct value should be in 0-10
 
But I could view the correct value of some other CString and int variable.
 
And, when I go through some methods step by step by click F10, I find something more strange, for example:
 
1)      if (!m_bReadyForQuery)
2)      {// not ready to build query
3)              return false;
4)      }
5)    // this will add WHERE for the key field, if applicable
6)    if ( !ProcessKeyCriteria(rstWhere) )
7)    {
8)        return false;
9)    }
...
When it runs 1->3->6->8, so strange! It goes to the return line, but it does not return after that line!
 
Root Reason:
I believe it is caused by the incomplete rebuild of the project.
 
Solution:
Finally, I fixed this issue by one of the following 2 reasons( I did all of them, and I'm not quite sure which one make things work)
 
As I have put this mentioned ATL project, says ComA, into a big solution with other ATL projects (totally around 20 projects). And the projects have some dependencies between each other. Another ATL project, says ComB, has dlldata.c set readonly somehow. When I choose to rebuild the whole solution, it always tells me that the dlldata.c can not be opened. But when I build the solution again, the compiler says ok, the error is ignored.
 
Now I'd like to say the 2 things I did:
1) Change the dlldata.c of ComB to be writable
2) Delete all output of the whole solution, means all dll, ocx, pdb, lib, map files.
 
Then rebuild the whole solution. This time the debugger starts to work normally.  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值