Files
UnrealEngineUWP/Engine/Source/Programs/SymbolDebugger/Private/SymbolDebuggerApp.cpp
brandon schaefer b402364d5a Deprecate GIsRequestingExit
Get GIsRequestingExit now by IsEngineRequestingExit()

Set GIsRequestingExit now by RequestEngineExit(const TCHAR* Reason) or RequestEngineExit(const FString& Reason)
NOTE If Reason is 4 or less chars it will generate an ensure to force a reason to exit

The reason behind this change is right now setting GIsRequestingExit to true can cause many things to break mainly early on and with out any sort of log warning we have entered this state. We should wrap this behind a function to allow for proper handling

#rb Chris.Babcock, Michael.Trepka, Michael.Noland
#jira UE-79933
[FYI] Michael.Noland

#ROBOMERGE-OWNER: ben.marsh
#ROBOMERGE-AUTHOR: brandon.schaefer
#ROBOMERGE-SOURCE: CL 8649683 via CL 8653683 via CL 8658680
#ROBOMERGE-BOT: BUILD (Main -> Dev-Build) (v422-8689730)

[CL 8743281 by brandon schaefer in Dev-Build branch]
2019-09-17 08:33:13 -04:00

89 lines
3.4 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "SymbolDebuggerApp.h"
#include "SSymbolDebugger.h"
#include "SymbolDebugger.h"
#include "RequiredProgramMainCPPInclude.h"
#include "CrashDebugHelperModule.h"
#include "Async/AsyncWork.h"
#include "ISourceControlModule.h"
#include "EditorStyleSet.h"
#include "Interfaces/IEditorStyleModule.h"
#include "Widgets/SWindow.h"
#include "Framework/Application/SlateApplication.h"
IMPLEMENT_APPLICATION(SymbolDebugger, "SymbolDebugger");
void RunSymbolDebugger(const TCHAR* CommandLine)
{
// start up the main loop
GEngineLoop.PreInit(CommandLine);
// crank up a normal Slate application using the platform's standalone renderer
FSlateApplication::InitializeAsStandaloneApplication( GetStandardStandaloneRenderer() );
// The source control plugins currently rely on EditorStyle being loaded
FModuleManager::LoadModuleChecked<IEditorStyleModule>("EditorStyle");
// Load in the perforce source control plugin, as standalone programs don't currently support plugins and
// we don't support any other provider apart from Perforce in this module.
IModuleInterface& PerforceSourceControlModule = FModuleManager::LoadModuleChecked<IModuleInterface>( FName( "PerforceSourceControl" ) );
// make sure our provider is set to Perforce
ISourceControlModule& SourceControlModule = FModuleManager::LoadModuleChecked<ISourceControlModule>( FName( "SourceControl" ) );
SourceControlModule.SetProvider(FName("Perforce"));
// Create the symbol debugger helper
TSharedPtr<FSymbolDebugger> SymbolDebugger = MakeShareable(new FSymbolDebugger());
checkf(SymbolDebugger.IsValid(), TEXT("Failed to create SymbolDebugger"));
// open up the SymbolDebugger windows
{
TSharedRef<SWindow> Window = SNew(SWindow)
.Title(NSLOCTEXT("SymbolDebugger", "SymbolDebuggerAppName", "Symbol Debugger"))
.ClientSize(FVector2D(400, 300))
[
SNew(SSymbolDebugger)
.OnGetCurrentMethod(SymbolDebugger.Get(), &FSymbolDebugger::GetCurrentMethod)
.OnSetCurrentMethod(SymbolDebugger.Get(), &FSymbolDebugger::SetCurrentMethod)
.OnGetMethodText(SymbolDebugger.Get(), &FSymbolDebugger::GetMethodText)
.OnSetMethodText(SymbolDebugger.Get(), &FSymbolDebugger::SetMethodText)
.OnFileOpen(SymbolDebugger.Get(), &FSymbolDebugger::OnFileOpen)
.OnGetTextField(SymbolDebugger.Get(), &FSymbolDebugger::GetTextField)
.OnSetTextField(SymbolDebugger.Get(), &FSymbolDebugger::SetTextField)
.OnGetCurrentAction(SymbolDebugger.Get(), &FSymbolDebugger::GetCurrentAction)
.IsActionEnabled(SymbolDebugger.Get(), &FSymbolDebugger::IsActionEnabled)
.OnAction(SymbolDebugger.Get(), &FSymbolDebugger::OnAction)
.OnGetStatusText(SymbolDebugger.Get(), &FSymbolDebugger::GetStatusText)
.HasActionCompleted(SymbolDebugger.Get(), &FSymbolDebugger::ActionHasCompleted)
];
FSlateApplication::Get().AddWindow(Window);
}
#if WITH_SHARED_POINTER_TESTS
SharedPointerTesting::TestSharedPointer< ESPMode::Fast >();
SharedPointerTesting::TestSharedPointer< ESPMode::ThreadSafe >();
#endif
// loop while the server does the rest
double LastTime = FPlatformTime::Seconds();
while (!IsEngineExitRequested())
{
FSlateApplication::Get().PumpMessages();
FSlateApplication::Get().Tick();
ISourceControlModule::Get().Tick();
// Tick the helper
SymbolDebugger->Tick();
// Sleep
FPlatformProcess::Sleep(0);
}
PerforceSourceControlModule.ShutdownModule();
FSlateApplication::Shutdown();
}