Compare commits

...

2 Commits

Author SHA1 Message Date
3be98f3617 Yet another fix for UEDataFormatter.py 2026-05-04 16:51:39 -04:00
3cf984ff65 Fewer log messages from UE Wingman 2026-05-04 16:11:06 -04:00
3 changed files with 16 additions and 17 deletions

View File

@@ -4,6 +4,7 @@
#include "UObject/StrongObjectPtr.h" #include "UObject/StrongObjectPtr.h"
#include "AssetRegistry/AssetRegistryModule.h" #include "AssetRegistry/AssetRegistryModule.h"
#include "AssetRegistry/IAssetRegistry.h" #include "AssetRegistry/IAssetRegistry.h"
#include "Misc/CoreDelegates.h"
#include "Misc/OutputDeviceRedirector.h" #include "Misc/OutputDeviceRedirector.h"
#include "Serialization/JsonReader.h" #include "Serialization/JsonReader.h"
#include "Serialization/JsonSerializer.h" #include "Serialization/JsonSerializer.h"
@@ -55,8 +56,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
return; return;
} }
BuildWingHandlerRegistry(); LoadingPhasesCompleteHandle = FCoreDelegates::OnAllModuleLoadingPhasesComplete.AddUObject(this, &UWingServer::BuildWingHandlerRegistry);
ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged);
LogCapture.bEnabled = false; LogCapture.bEnabled = false;
GLog->AddOutputDevice(&LogCapture); GLog->AddOutputDevice(&LogCapture);
bRunning = true; bRunning = true;
@@ -65,7 +65,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
void UWingServer::Deinitialize() void UWingServer::Deinitialize()
{ {
FModuleManager::Get().OnModulesChanged().Remove(ModulesChangedHandle); FCoreDelegates::OnAllModuleLoadingPhasesComplete.Remove(LoadingPhasesCompleteHandle);
if (!bRunning) if (!bRunning)
{ {
@@ -534,11 +534,6 @@ void UWingServer::BuildWingHandlerRegistry()
WingHandlerRegistry.Sort([](const FWingHandlerConfig& A, const FWingHandlerConfig& B) { return A.Name < B.Name; }); WingHandlerRegistry.Sort([](const FWingHandlerConfig& A, const FWingHandlerConfig& B) { return A.Name < B.Name; });
} }
void UWingServer::OnModulesChanged(FName ModuleName, EModuleChangeReason Reason)
{
BuildWingHandlerRegistry();
}
FWingHandlerConfig* UWingServer::FindHandler(const FString& Name) FWingHandlerConfig* UWingServer::FindHandler(const FString& Name)
{ {
int32 Index = Algo::LowerBoundBy(WingHandlerRegistry, Name, [](const FWingHandlerConfig& H) { return H.Name; }); int32 Index = Algo::LowerBoundBy(WingHandlerRegistry, Name, [](const FWingHandlerConfig& H) { return H.Name; });

View File

@@ -76,8 +76,7 @@ private:
FLogCaptureOutputDevice LogCapture; // installed once at startup, enabled per-request FLogCaptureOutputDevice LogCapture; // installed once at startup, enabled per-request
TArray<FWingHandlerConfig> WingHandlerRegistry; // sorted by Name TArray<FWingHandlerConfig> WingHandlerRegistry; // sorted by Name
void BuildWingHandlerRegistry(); void BuildWingHandlerRegistry();
void OnModulesChanged(FName ModuleName, EModuleChangeReason Reason); FDelegateHandle LoadingPhasesCompleteHandle;
FDelegateHandle ModulesChangedHandle;
FWingHandlerConfig* FindHandler(const FString& Name); FWingHandlerConfig* FindHandler(const FString& Name);
// Handle a complete JSON line and return the response JSON // Handle a complete JSON line and return the response JSON

View File

@@ -16,12 +16,10 @@ _FUObjectItemType = None
_GNameBlocksDebug = None _GNameBlocksDebug = None
_GObjectArrayForDebugVisualizers = None _GObjectArrayForDebugVisualizers = None
def _init_globals(frame, bp_loc, dict): def _init_globals(target):
global _FNameEntryType, _FNameEntryStride, _FUObjectItemType global _FNameEntryType, _FNameEntryStride, _FUObjectItemType
global _GNameBlocksDebug, _GObjectArrayForDebugVisualizers global _GNameBlocksDebug, _GObjectArrayForDebugVisualizers
target = frame.GetThread().GetProcess().GetTarget()
if _FNameEntryType is None: if _FNameEntryType is None:
t = target.FindFirstType('FNameEntry') t = target.FindFirstType('FNameEntry')
if t.IsValid(): if t.IsValid():
@@ -43,6 +41,13 @@ def _init_globals(frame, bp_loc, dict):
if v.IsValid(): if v.IsValid():
_GObjectArrayForDebugVisualizers = v _GObjectArrayForDebugVisualizers = v
class _GlobalsInitStopHook:
def __init__(self, target, extra_args, internal_dict):
_init_globals(target)
def handle_stop(self, exe_ctx, stream):
_init_globals(exe_ctx.GetTarget())
return True
############################################################ ############################################################
# #
@@ -683,11 +688,11 @@ def _register_provider(cat, pattern, summary_fn=None, synth_cls=None):
def __lldb_init_module(debugger, dict): def __lldb_init_module(debugger, dict):
print("Running lldb_init_module") print("Running lldb_init_module")
debugger.HandleCommand('target stop-hook add --python-function ' + __name__ + '._init_globals') debugger.HandleCommand('target stop-hook add -P ' + __name__ + '._GlobalsInitStopHook')
debugger.HandleCommand('type category delete ' + __name__) debugger.HandleCommand('type category delete ' + __name__)
frame = debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() target = debugger.GetSelectedTarget()
if frame.IsValid(): if target.IsValid():
_init_globals(frame, None, {}) _init_globals(target)
cat = debugger.CreateCategory(__name__) cat = debugger.CreateCategory(__name__)
_register_provider(cat, '^FString$', summary_fn='UEFStringSummaryProvider') _register_provider(cat, '^FString$', summary_fn='UEFStringSummaryProvider')