WheretIB / LuaDkmDebugger

Visual Studio C++ debugger extensions for Lua
MIT License
81 stars 32 forks source link

Lua 5.3 not detected correctly #4

Closed fsfod closed 4 years ago

fsfod commented 4 years ago

I was getting no callstacks in the debugger because the version detection logic didn't work for me for a Lua 5.3 dll. I managed to get it working by just checking if a lua_rotate function is declared.

fsfod commented 4 years ago

It looks like real fix is to always use the value from stateAddress instead of trying to use a optimized L in expressions.

long? version = EvaluationHelpers.TryEvaluateNumberExpression($"(int)*((lua_State*){stateAddress})->l_G->version", inspectionSession, thread, frame, DkmEvaluationFlags.TreatAsExpression | DkmEvaluationFlags.NoSideEffects);
WheretIB commented 4 years ago

Great idea, I've already had a fallback register lookup for state value, but didn't update the other two expressions.

WheretIB commented 4 years ago

Fixed in e611e404a864a7d5c04f600d869c9f8e43a99533

I will try to update the extension later on July 6th.