Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9292969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:00:56+00:00 2026-06-18T21:00:56+00:00

Is it possible to break execution when a watch variable (not a property, just

  • 0

Is it possible to break execution when a watch variable (not a property, just a normal variable) changes to see where the change occurred? I searched and found this question which relates to properties it seems which is not what I’m looking for.

This variable is used several times in several thousand lines of code, but it is only changed from null when a problem happens. We are trying to track that problem down.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:00:58+00:00Added an answer on June 18, 2026 at 9:00 pm
    1. Create a breakpoint (f9) around the variable
    2. Right-click on the red circle of the breakpoint and click on “Condition…”
    3. Type in the name of the variable, and change the radio to “Has changed”
    4. The breakpoint should now have a + in it to indicate that it is conditional

    However: frankly, I find the following simpler and much more efficient – especially for fields; say we start with:

    string name;
    

    we change it just for now to:

    private string __name;
    string name {
        get { return __name; }
        set { __name = value; }
    }
    

    and just put a break-point on the set line. It should still compile, and you can see the change trivially. For more complex cases:

    private string __name;
    string name {
        get { return __name; }
        set {
            if(__name != value) {
                __name = value; // a non-trivial change
            }
        }
    }
    

    and put the breakpoint on the inner-most line; this bypasses code that sets the field without actually changing the value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to break the execution of a Python script called with the
Is it possible to use continue/break in a %control structure loop. For example: %
Is it possible to get chrome dev tool or firebug to break when a
I'm attempting to break a list of words (a tokenized string) into each possible
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: check whether internet connection is available with C# I just want to
Possible Duplicate: Safe executing shell scripts; escaping vars before execution I want to pass
I am aware that it's possible to emulate the maxlength property from input elements
At the moment I am using fault handlers to break out of execution e.g:
Possible Duplicate: How to stop GDB from executing break main by default in Eclipse?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.