Reputation:

Visual Studio 2005 Search Memory

I don't think this exists, but I'll throw this out there anyway. Is it possible, while debugging, to search for a value in memory?

For example, if I have a string "uniqueString" cached somewhere in memory, but I don't know under which variable it's stored--can I do a search for it? As in, find out which variable(s) have "uniqueString" as their value?

This is for C# managed code.

Upvotes: 5

Views: 2813

Answers (2)

Ofek Shilon
Ofek Shilon

Reputation: 16147

You have the same functionality in Visual Studio, available from the immediate window. Although, you'd have to manually somehow limit the address range to search in (see the syntax in the link).

(edit) BTW, you can easily create dumps from VS too: Debug->Save Dump As.

Upvotes: 2

ShuggyCoUk
ShuggyCoUk

Reputation: 36438

windbg will let you do the search directly. 's' is the command you're looking for, here's a very good cheat sheet. sos extension lets you scan for string objects too in managed code though the s command should find them too (must use unicode aware search).

Upvotes: 4

Related Questions