bebo
bebo

Reputation: 849

Microsoft.Diagnostics.Runtime: Reading string with ClrMD ClrObject

I'm using the Microsoft.Diagnostics.Runtime library.

I have an object: ClrObject obj = heap.GetObject(ptr); And I can read:

    int length = obj.ReadField<int>("_stringLength");
    char firstCharacter = obj.ReadField<char>("_firstChar");

of a System.String object.

When I know the length and I can read the first character, how can I read the complete string?

Upvotes: 1

Views: 339

Answers (1)

LCC
LCC

Reputation: 1189

Use ClrObject.AsString in ClrMD 2.0.

Upvotes: 2

Related Questions