Discussion:
Dynamic Breakpoints...
(too old to reply)
Thomas Lehmann
2009-09-21 07:43:38 UTC
Permalink
Hi!

Let's say I have one method handling a "double click". Somewhere in
the call stack there is a method I want to stop at when the "double
click" has been triggered. How can I do this best?

One solution is to use a global variable. When entering the double
click method I set this variable and when leaving the method I reset
it. In the method I'm interested in I'm defining a conditional break
point. The issue I don't like is that I have to manipulate the code. I
need the global variable at both locations to be known and I have to
set this variable two times.

I would like to use the visual debugger itself to define the state
(when possible)
Can somebody help?

Thank you in advance...
Martin T.
2009-09-21 09:35:38 UTC
Permalink
Post by Thomas Lehmann
Hi!
Let's say I have one method handling a "double click". Somewhere in
the call stack there is a method I want to stop at when the "double
click" has been triggered. How can I do this best?
One solution is to use a global variable. When entering the double
click method I set this variable and when leaving the method I reset
it. In the method I'm interested in I'm defining a conditional break
point. The issue I don't like is that I have to manipulate the code. I
need the global variable at both locations to be known and I have to
set this variable two times.
I would like to use the visual debugger itself to define the state
(when possible)
Can somebody help?
Thank you in advance...
AFAIK it is not possible to set a breakpoint depending on the current
call-stack which would be what you need.

In these cases I simply will set two breakpoints in both methods, and
disable/enable them as needed. (i.e. first enable the one in
OnDoubleClick() and when you hit that one enable the one in YourFunction() )

br,
Martin

Loading...