From eb291cefdf3c414b6d7dd95ca3e2a04a50cebc50 Mon Sep 17 00:00:00 2001 From: GustavEikaas Date: Sun, 22 Mar 2026 14:29:30 +0100 Subject: [PATCH] feat: enable Nullable inspection --- src/debugger/evaluator.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/debugger/evaluator.cpp b/src/debugger/evaluator.cpp index 3180da7f..2974cc0b 100644 --- a/src/debugger/evaluator.cpp +++ b/src/debugger/evaluator.cpp @@ -778,8 +778,22 @@ static HRESULT InternalWalkMembers(EvalHelpers *pEvalHelpers, ICorDebugValue *pI if (className == "decimal") // TODO: implement mechanism for walking over custom type fields return S_OK; - if (className.back() == '?') // System.Nullable, don't provide class member list. + if (className.back() == '?') // System.Nullable + { + ToRelease pValueValue; + ToRelease pHasValueValue; + IfFailRet(GetNullableValue(pInputValue, &pValueValue, &pHasValueValue)); + + BYTE hasValueByte = 0; + ToRelease pGenericValue; + IfFailRet(pHasValueValue->QueryInterface(IID_ICorDebugGenericValue, (LPVOID*)&pGenericValue)); + IfFailRet(pGenericValue->GetValue((LPVOID)&hasValueByte)); + + if (hasValueByte != 0) + return InternalWalkMembers(pEvalHelpers, pValueValue, pThread, frameLevel, nullptr, provideSetterData, cb); + return S_OK; + } CorElementType corElemType; IfFailRet(pType->GetType(&corElemType));