2

I'd like to compare the state change of an instance in my program between two different breakpoints. Concretely I'd like to break at location A, get a snapshot of the current instance state, continue execution, break at location B, get another snapshot of the instance state and be able to compare the two, be it with text export and a diff tool.

I was hoping this is somehow possible with Visual Studio's debug tool tips because they can also store the last session's debug value but I haven't found a way to do so. How else can I achieve this?

4
  • 1
    Just store the "snapshot" in a temporary? Commented Aug 3, 2016 at 13:11
  • You can output them as text and compare: stackoverflow.com/questions/2927991/… Commented Aug 3, 2016 at 13:12
  • Why don't can you compare in yourself according to of them value? Commented Aug 3, 2016 at 13:28
  • @NathanOliver doesn't work (well) if the class contains pointers Commented Aug 6, 2016 at 11:11

1 Answer 1

0

VS2015 has a Diagnostic tools which shared the Memory Usage, you could take snapshot in debugging, click the View help, and double click the Object type, you could view the Instance. Is it what you want to get?

Reference: https://msdn.microsoft.com/en-us/magazine/dn973013.aspx

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Cool feature. Not sure if applicable for my use-case or probably more compilcated than outputting the variable contents in immediate window but definitely interesting. Unfortunately I'm bound to VS2013 for now anyway.
You can use the "Memory Usage" under Debug->Performance and Diagnostics even if you use the VS2013. Of course, you can also use the VS2015 community version which is free.
@user1709708, if the above suggestion is helpful, please accept it as the answer. If not, please feel free to let me know.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.