So, if you need to restart debugging, be sure to right click and re-create the object ID.
Note: The object ID refers to the object’s address in memory and consequently will change with every new debug session. This will take you to the line of code that is changing the property for this specific instance of the object. Look at the Call Stack and double click on the previous frame.Press Continue (F5) and now you will break in the setter when that property changes for that instance.Go to the setter of the property you care about and add a condition to the breakpoint,.
This gives you a handle to that object in memory, referenced by “$1”.
When you get to a breakpoint with the interesting instance right click on the object and select Make Object ID. If you are debugging managed code, you can use Make Object ID plus a Conditional Breakpoint to narrow your search for the problem area. You can set a breakpoint on the setter in the class, but this breaks for every instance of the object type! What if you only care about one problematic instance? When debugging C++ code, Data Breakpoints can help you out. Have you been in a situation while debugging where you inspect an object’s property at one breakpoint and by the time you get to the next breakpoint that property has changed unexpectedly. This line will be the next statement to execute when taking a step or pressing Continue (F5). Click on that glyph and the yellow arrow will move to that line.Ĥ. Hold the CTRL key and notice the Run to Click (Run execution to here) glyph changes into the Set Next Statement glyph.ģ. Hover over the line of code where you want to move the yellow arrow.Ģ. What you probably didn’t know is that as of Visual Studio 2017 version 15,3 Preview there is an even easier way to target a line and Set Next Statement.ġ. You may also know that you grab and drag the yellow arrow up and down in the gutter to move it. Many of you may know about the context menu item Set Next Statement (Ctrl+Shift+F10) that moves the yellow arrow (the instruction pointer) to the target line of code. It is chock-full of tools that can make debugging easier… if you know they exist, and where to find them! Let’s look at 7 lesser known goodies you can use to help you #SuperChargeYourDebugging. The Visual Studio debugger is a magical beast that can save you loads of time while finding and fixing issues in your application. Please refer the thread for more discussion, this is for reference purpose only.