Skip to content

Commit 85e3634

Browse files
author
Michael DeRoy
committed
remove address from beginning of string
1 parent d9fa180 commit 85e3634

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

PmipRunner.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,26 @@ public DkmStackWalkFrame PmipStackFrame()
3030
var ip = $"0x{_frame.InstructionAddress.CPUInstructionPart.InstructionPointer:X}";
3131
var call = $"((char*(*)(void*)){pmipFunction.PmipFunction})((void*){ip})";
3232

33-
var result = "";
33+
var result = "<ERROR>";
3434
var isNull = true;
3535

3636
var eval = EvaluateExpression(call, r =>
3737
{
3838
isNull = r.Address.InstructionAddress.CPUInstructionPart.InstructionPointer == 0;
39-
result = r.Value ?? "<ERROR>";
39+
if (r.Value != null)
40+
{
41+
try
42+
{
43+
int afterBeginQuote = r.Value.IndexOf("\"", StringComparison.Ordinal) + 1;
44+
int beforeEndQuote = r.Value.Length - 1;
45+
result = r.Value.Substring(afterBeginQuote, beforeEndQuote - afterBeginQuote);
46+
}
47+
catch (Exception)
48+
{
49+
}
50+
51+
}
52+
4053
});
4154

4255
if (!eval || isNull)

0 commit comments

Comments
 (0)