From 979b8d4a077ea2a5e16f0fa6e60e332864819d3e Mon Sep 17 00:00:00 2001 From: jyelon Date: Mon, 25 Nov 2024 15:20:33 -0500 Subject: [PATCH] Fix the debugger not being able to show TCHAR * --- EnginePatches/EnginePatch | 25 +++++++++++++++++++++++++ build-everything.py | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/EnginePatches/EnginePatch b/EnginePatches/EnginePatch index 04625e97..8666ec81 100644 --- a/EnginePatches/EnginePatch +++ b/EnginePatches/EnginePatch @@ -1,3 +1,28 @@ +diff --git a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py +index f56f5ea9cac4..ff1c4030b38f 100644 +--- a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py ++++ b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py +@@ -32,7 +32,7 @@ def UETCharSummaryProvider(valobj,dict): + if DataVal == 0: + Val = 'NULL' + else: +- Expr = '(char16_t*)(%s)' % Data ++ Expr = '(char16_t*)(%s)' % DataVal + ValRef = valobj.CreateValueFromExpression('string', Expr) + Val = ValRef.GetSummary() + elif Type.IsReferenceType(): +@@ -47,6 +47,11 @@ def UETCharSummaryProvider(valobj,dict): + Expr = '(char16_t*)(%s)' % valobj.GetAddress() + ValRef = valobj.CreateValueFromExpression('string', Expr) + Val = ValRef.GetSummary() ++ else: ++ DataVal = valobj.GetValueAsUnsigned(0) ++ Expr = '(char16_t)(%s)' % DataVal ++ ValRef = valobj.CreateValueFromExpression('string', Expr) ++ Val = ValRef.GetSummary() + return Val + + def UESignedCharSummaryProvider(valobj,dict): diff --git a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp b/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp index ca5f4b5fb5ff..a436a624d5b7 100644 --- a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp diff --git a/build-everything.py b/build-everything.py index e991383f..e5557826 100755 --- a/build-everything.py +++ b/build-everything.py @@ -229,6 +229,13 @@ WORKSPACE["settings"]["files.watcherExclude"] = { f'{UNREALENGINE}/Templates/**' : True } +# +# Tell the LLDB plugin not to dereference pointers. This is dumb behavior, +# it dereferences "char *" and shows only the first character. Not dereferencing +# the pointer shows the whole string. +# +WORKSPACE["settings"]["lldb.dereferencePointers"] = false + # # Write Integration.code-workspace. #