- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone knowan easyway to "watch" a variable? (i.e. detect when it changes)
using the debbugger?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you mut place a breakpoint in your code, and then in debug mode, place the mouse icon on the variable you want to know, instead you can select it and press the quikwatch icon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is available as long as you are not using the bundled Visual Studio 2005 Premier Partner Edition. When you are in the program unit with the variable, select Debug > New Breakpoint > New Data Breakpoint. Enter the name of the variable. Leave the "language" as C.
I will comment that this often does not work.
I will comment that this often does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to get the program to break if the variable changes? (This is not the
same as conditional breakpoint which assumes a location)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are right about "that this often does not work". It was asking for "address" so I
did a LOC(varname) in the itermediate window and put a number in for address (very awkward.)This worked for a while; however,when I reinstalled VS5 (PPE.exe) the"New Data Breakpoint" does not even appear as a selection when the debugger breaks.Is there a simple way to get the debugger to stop when it detects a change in a variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As mentioned in the Release Notes, data breakpoints are not available when you're using VSPPE. This requires a "retail" version of VS. This was not intentional and we are working with Microsoft to see if we can resolve it in the future (it requires Microsoft's assistance.)
Data breakpoints in Visual Studio have never worked well in my experience, going back to VS97. You ought to be able to just type a variable name there - sometimes it works, sometimes it doesn't. Watching an address is somewhat more reliable, if that's available to you.
Data breakpoints in Visual Studio have never worked well in my experience, going back to VS97. You ought to be able to just type a variable name there - sometimes it works, sometimes it doesn't. Watching an address is somewhat more reliable, if that's available to you.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page