Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search in debug mode inside an object

Is it possible to search inside an object for values and/or other field while debugging a C# application? I'm looking for a deep search that can drill down the object for many levels.

What I'm looking for is a way to search (like F3 for documents search) inside very complex objects (while debugging, in the Quick watch window for example).

like image 598
Shahar Avatar asked Aug 03 '11 10:08

Shahar


People also ask

How do I search in debugger?

Try using F10 or F11 to get further down your objects. Also, there is built-in functionality to view object values etc. I think you need to be more specific what you mean by "search" to get better answers.

How can I see value while debugging in Visual Studio?

When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.

How do you Debug inside a function?

To debug a function which is defined inside another function, single-step through to the end of its definition, and then call debug on its name. If you want to debug a function not starting at the very beginning, use trace(..., at = *) or setBreakpoint .


2 Answers

You could use OzCode (an add-on for Visual Studio), which lets you search for the members you want to see from within the on-hover-DataTip or the QuickWatch window.

See example in the following screenshot:

Search Feature

Full disclosure: I am the co-creator of "OzCode".

like image 88
Omer Raviv Avatar answered Oct 08 '22 01:10

Omer Raviv


If you want to do whitout an add-on it can be done by going to the object list, selecting all objects (ctrl+a) and copy them to a searchable text-editor. This will give you a newline seperated list.

enter image description here

like image 44
Openeye Avatar answered Oct 07 '22 23:10

Openeye