Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find a variable with a given value in VS2008

I have an instance variable with several members, many of which have their own members and so on. Using the debugger and watch variables, I found a string variable with a specific value that I need by diving into this variable's members.

However, after spending some time on other things and coming back to this, I am now unable to find where this value is located. When I have my application paused, is there a way to search the values of variables in the current context for a given value?

To clarify, if I have the given structure:

myVariable
|
|--aMember1
|  |--subMember = "A value"
|
|--aMember2
   |--subMember = "Another value"

Is there a way (possibly using the watch list in VS debugger) to search myVariable for any member or submember with the value "A value", returning to me the path myVariable->aMember->subMember?

like image 649
Aaron Avatar asked Oct 14 '22 09:10

Aaron


1 Answers

No this feature does not exist in Visual Studio 2008 (or any other version).

What you can do is add an ID for the value the first time you find it. Simply right click on the value and select "Make Object ID". This will create a unique identify that shows up in the value such as 1#. You can then type this value into the watch window at any future point and get the value to come back.

like image 144
JaredPar Avatar answered Oct 27 '22 00:10

JaredPar