locked
debug engine, breakpoint with passcount RRS feed

  • Question

  • with my custom debug engine, I can set breakpoints with a passcount and they are hit as expected. However the hitcount in the breakpoints window of VS is not updated. When a breakpoint is hit but hitcount <> passcount, I send an

    IDebugBreakpointEvent2 event with attributes = EVENT_ASYNCHRONOUS; execution then continues, but as said before the hit count is not updated.

    What am I missing?

    Regards, Jan


    Jan

    Monday, December 2, 2013 1:49 PM

All replies

  • Hi Jan,

    According to your description, the problem is that the hitcount in the breakpoints window is not updated after breakpoints are hit.

    What's the number of the Hit Count you set? When did you check the Hit Count? Did the Hit Count always keep zero?

    Please take a look at the following information:

    "The specified hit count is retained only for the debugging session. When the debugging session ends, the hit count is reset to zero."

    For more information,please refer to Breakpoints: Use Hit Counts, Call Stack Functions, and Conditions to Break When and Where You Want in the Visual Studio Debugger .

    By the way,did you use the IDebugBoundBreakpoint2::GetHitCount to get the current hit count for this bound breakpoint?

    Please try to use the IDebugBoundBreakpoint2::GetState to get the state of this bound breakpoint.

    >>When a breakpoint is hit but hitcount <> passcount, I send an IDebugBreakpointEvent2 event with attributes = EVENT_ASYNCHRONOUS

    Please check if you have used the interfaces and attributes correctly.

    "The values of EVENTATTRIBUTES are passed in the dwAttrib parameter of the IDebugEventCallback2::Event method."

    "The Debug Engine creates and sends the event object of IDebugBreakpointEvent2 when at least one breakpoint is encountered in the program. The event is sent by using the IDebugEventCallback2 callback function supplied by the SDM when it attached to the program being debugged."

    Here are some related links that I hope could provide some useful information:

    When a Breakpoint Binds or Becomes Unbound

    EVENT_ASYNC_STOP or not?

    If I have any misunderstanding, please feel free to let me know.

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 3, 2013 2:58 AM
  • I think there is some misunderstanding. Breakpoints with hitcount/passcount are working correctly. An example: when passcount is set to 5, the breakpoint is hit 4 times where the hitcount is not yet 5 and the DE then sends an IDebugBreakpointEvent2 with attributes = EVENT_ASYNCHRONOUS, then continues the debuggee thread. On the 5th hit, the DE sends an IDebugBreakpointEvent2 with attributes = EVENT_SYNC_STOP which switches into debugging mode. So far all is well.

    What is wrong is that in the VS breakpoint window the updated hitcount is not shown, i.e. it remains shown as zero. I would expect that the IDebugBreakpointEvent2 with attributes = EVENT_ASYNCHRONOUS would call GetHitCount but it does not. What should I do instead to stay in running mode but still get this updated value?

    Regards, Jan


    Jan

    Tuesday, December 3, 2013 9:58 AM
  • Hi Jan,

    Thank you for your feedback.

    Could you please tell us Which version of Visual Studio are you using?

    Did the Hit Count change in the Breakpoints window?

    The following screenshot is from the built-in debugger in Visual Studio Ultimate 2012.

    Please try to use this custom debug engine on the other machines, or restart or repair Visual Studio and check if there still comes the same scenario.

    Is there the possibility that something might be missing during Registering the Custom Debug Engine ?

    If you have had remote debugging installed, you could try to Debug the Custom Debug Engine .

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, December 4, 2013 7:32 AM
  • Hello Jane,

    thanks for your reply. I decided to test with a Windows app and the result is the same! So there is nothing wrong with my debugger. This is VS2010 by the way.

    To reproduce, I used this code in a Windows console application:
    int _tmain(int argc, _TCHAR* argv[])
    {
      int n;
      n = 0;
      while (n < 10)
      {
        getchar();
        n++;
      }
      return 0;
    }

    Then on the line getchar set a breakpoint with 'hitcount equal to 5'. The breakpoint will work as expected (i.e. the first 4 hits will not be visible and then you get a normal breakpoint). But with these first 4 hits, the hitcount in the breakpoint window is displayed as 0; on the fifth, real hit, the value is shown as 5.

    To me this proves there is a problem in VS/SDM where it does not call GetHitCount on the DE.

    Regards, Jan


    Jan

    Wednesday, December 4, 2013 7:54 AM
  • Hello Jan,

    >>To me this proves there is a problem in VS/SDM where it does not call GetHitCount on the DE.

    Since this issue is due to VS/SDM, which is beyond my support capabilities,I have delivered this case to the team members who have rich experience on this aspect and they would post replies as soon as they have found out the solution.

    Thanks for your patience.

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 4, 2013 8:18 AM
  • Hi,

    I tried looking into this issue and tried to reproduce the issue. But I was unable to reproduce this issue across several machines.

    Did you have all the updates for VS 2010? Is this VS 2010 has SP1?

    From a support perspective this is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.

    Thanks!


    Shaleen Thapa

    Thursday, December 19, 2013 9:28 PM
  • Hello Shaleen,

    thanks for your time. The version of VS2010 is 10.0.4029.1 SP1Rel. But the same problem occurs in VS2012 and VS2013!

    The real problem is that the count shown in the breakpoint is NOT UPDATED when the breakpoint is hit but the hit count has not been reached, so the program is not stopped.

    If this is a bug in VS20xx I can live with it and will inform our customers about that.

    Regards, Jan


    Jan

    Friday, December 20, 2013 7:42 AM