468,458 Members | 1,878 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,458 developers. It's quick & easy.

Visual C# 2005: How can I trigger a breakpoint upon a class member variable change?

Hi,

I am using Visual C# 2005 and I like to setup breakpoint that pause
execution upon a class variable change.

Is that possible?

Thank you,

Max


Aug 21 '07 #1
5 2069
Hi,
Set your BP and right click in the red indicator, you will get a list of
options
"Max2006" <al*******@newsgroup.nospamwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
Hi,

I am using Visual C# 2005 and I like to setup breakpoint that pause
execution upon a class variable change.

Is that possible?

Thank you,

Max


Aug 21 '07 #2

I am aware of those options. I don't know how to specify: **"break at the
palce that assigns new value to this variable"**.

I remember we had this feature with old VB6. DO we still have it?

Thanks for help,
Max
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:eP**************@TK2MSFTNGP04.phx.gbl...
Hi,
Set your BP and right click in the red indicator, you will get a list of
options
"Max2006" <al*******@newsgroup.nospamwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
>Hi,

I am using Visual C# 2005 and I like to setup breakpoint that pause
execution upon a class variable change.

Is that possible?

Thank you,

Max



Aug 21 '07 #3
Hello Max,

me either not aware of that feature but you can place breakpoints in
the place your code changes that variable:)
or just add that variable to watch list and step over your whole
application's run and see in watch list where is the place that
changes that variable.

On Aug 22, 12:19 am, "Max2006" <alanal...@newsgroup.nospamwrote:
I am aware of those options. I don't know how to specify: **"break at the
palce that assigns new value to this variable"**.

I remember we had this feature with old VB6. DO we still have it?

Thanks for help,
Max

"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
messagenews:eP**************@TK2MSFTNGP04.phx.gbl. ..
Hi,
Set your BP and right click in the red indicator, you will get a list of
options
"Max2006" <alanal...@newsgroup.nospamwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
Hi,
I am using Visual C# 2005 and I like to setup breakpoint that pause
execution upon a class variable change.
Is that possible?
Thank you,
Max

Aug 22 '07 #4
Hi Max,

This type of breakpoint is called data breakpoint, which is a type of
hardware breakpoint.

The normal breakpoint is called software breakpoint, which is implemented
by inserting a "int 3" instruction in the function start. So if the code
executed the "int 3", it will notify the debugger that a breakpoint is
triggered. To monitor the data variable change, it is different from normal
breakpoint, because it is not code. "int 3" trick can not be used here. We
need hardware support from CPU. So x86 CPU provided the debug registers to
help debugger implement data breakpoints for this purpose.

However, because the GC will move the objects frequently in managed code,
it makes the data breakpoints almost impossible for managed objects data.
That's why data breakpoint is only supported for native debugging
currently. Our Visual Studio debugger team developer confirmed this in his
blog below:
"Data Breakpoints"
http://blogs.msdn.com/greggm/archive...30/124161.aspx

So we can not set data breakpoint on class member variable yet. Hope this
helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 22 '07 #5
Hi Max,

Have you reviewed my reply to you? Does it make sense to you? If you still
need any help or have any concern, please feel free to tell me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 24 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.