2016-12-08 08:52:44 -05:00
|
|
|
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Widgets/SCompoundWidget.h"
|
|
|
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
|
|
|
#include "Styling/SlateTypes.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
class SSymbolDebugger : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Text fields for the label/text box pairs
|
|
|
|
|
*/
|
|
|
|
|
enum ESymbolDebuggerTextFields
|
|
|
|
|
{
|
|
|
|
|
/** The crash dump file */
|
|
|
|
|
TextField_CrashDump,
|
|
|
|
|
/** The engine version */
|
|
|
|
|
TextField_EngineVersion,
|
|
|
|
|
/** The changelist */
|
|
|
|
|
TextField_ChangeList,
|
|
|
|
|
/** The source control label */
|
|
|
|
|
TextField_Label,
|
|
|
|
|
/** The platform */
|
|
|
|
|
TextField_Platform,
|
|
|
|
|
/** The locaion of the symbol store */
|
|
|
|
|
TextField_SymbolStore,
|
|
|
|
|
/** The IP of the machine to remote debug on */
|
|
|
|
|
TextField_RemoteDebugIP,
|
|
|
|
|
/** The source control depot to utilize */
|
|
|
|
|
TextField_SourceControlDepot,
|
|
|
|
|
TextField_MAX
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The different methods of symbol debugging
|
|
|
|
|
*/
|
|
|
|
|
enum ESymbolDebuggerMethods
|
|
|
|
|
{
|
|
|
|
|
/** A minidump file */
|
|
|
|
|
DebugMethod_CrashDump,
|
|
|
|
|
/** The engine version */
|
|
|
|
|
DebugMethod_EngineVersion,
|
|
|
|
|
/** The changelist number */
|
|
|
|
|
DebugMethod_ChangeList,
|
|
|
|
|
/** The source control label */
|
|
|
|
|
DebugMethod_SourceControlLabel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Actions the symbol debugger can perform
|
|
|
|
|
*/
|
|
|
|
|
enum ESymbolDebuggerActions
|
|
|
|
|
{
|
|
|
|
|
/** None - no action */
|
|
|
|
|
DebugAction_None,
|
|
|
|
|
/** Inspect - using the current method, gather any other information */
|
|
|
|
|
DebugAction_Inspect,
|
|
|
|
|
/** Sync - sync the files required for debugging to the symbol store */
|
|
|
|
|
DebugAction_Sync,
|
|
|
|
|
/** Debug - launch the debugger; only valid for CrashDump at this time */
|
|
|
|
|
DebugAction_Debug,
|
|
|
|
|
/** Process - inspect, sync and debug the given CrashDump */
|
|
|
|
|
DebugAction_Process
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The results of an action
|
|
|
|
|
*/
|
|
|
|
|
enum ESymbolDebuggerActionResults
|
|
|
|
|
{
|
|
|
|
|
/** Task is still going */
|
|
|
|
|
DebugResult_InProgress,
|
|
|
|
|
/** Task completed successfully */
|
|
|
|
|
DebugResult_Success,
|
|
|
|
|
/** Task completed but failed */
|
|
|
|
|
DebugResult_Failure
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Delegates used to trigger actions, check for completion */
|
|
|
|
|
DECLARE_DELEGATE_RetVal(ESymbolDebuggerMethods, FSymbolDebuggerGetCurrentMethod);
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(bool, FSymbolDebuggerSetCurrentMethod, ESymbolDebuggerMethods);
|
|
|
|
|
DECLARE_DELEGATE_RetVal(FString, FSymbolDebuggerGetMethodText)
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(bool, FSymbolDebuggerSetMethodText, const FString&);
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(bool, FSymbolDebuggerOnFileOpen, TSharedRef<SWidget>);
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(FString, FSymbolDebuggerGetTextField, ESymbolDebuggerTextFields);
|
|
|
|
|
DECLARE_DELEGATE_RetVal_TwoParams(bool, FSymbolDebuggerSetTextField, ESymbolDebuggerTextFields, const FString&);
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_RetVal(ESymbolDebuggerActions, FSymbolDebuggerGetCurrentAction);
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(bool, FSymbolDebuggerIsActionEnabled, ESymbolDebuggerActions);
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(bool, FSymbolDebuggerOnAction, ESymbolDebuggerActions);
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_RetVal(FString, FSymbolDebuggerOnGetStatusText)
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_RetVal_OneParam(ESymbolDebuggerActionResults, FSymbolDebuggerHasActionCompleted, ESymbolDebuggerActions);
|
|
|
|
|
|
|
|
|
|
SLATE_BEGIN_ARGS(SSymbolDebugger)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerGetCurrentMethod, OnGetCurrentMethod)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerSetCurrentMethod, OnSetCurrentMethod)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerOnFileOpen, OnFileOpen)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerGetTextField, OnGetTextField)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerSetTextField, OnSetTextField)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerGetMethodText, OnGetMethodText)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerSetMethodText, OnSetMethodText)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerGetCurrentAction, OnGetCurrentAction)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerIsActionEnabled, IsActionEnabled)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerOnAction, OnAction)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerOnGetStatusText, OnGetStatusText)
|
|
|
|
|
SLATE_EVENT(FSymbolDebuggerHasActionCompleted, HasActionCompleted)
|
|
|
|
|
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the button for the given action
|
|
|
|
|
*
|
|
|
|
|
* @param InAction The debugger action button to generate
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The button...
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateActionButton(ESymbolDebuggerActions InAction);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the action buttons
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The buttons
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateActionButtons();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate a label/text box pair for the given Debugger text field
|
|
|
|
|
*
|
|
|
|
|
* @param InTextField The text field to generate the label/textbox pair for
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The label/textbox pair...
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateLabelTextBoxPair(ESymbolDebuggerTextFields InTextField);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the radio button for the given method
|
|
|
|
|
*
|
|
|
|
|
* @param InMethodName The name of the method to display on the radio button
|
|
|
|
|
* @param InMethod The debugger method associated with the radio button
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The radio button
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateMethodButton(const FText& InMethodName, ESymbolDebuggerMethods InMethod);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the radio buttons for selecting the current method
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The radio buttons
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateMethodButtons();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the method input widgets
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The widgets
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateMethodInputWidgets();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate the status widgets
|
|
|
|
|
*
|
|
|
|
|
* @return SWidget The widgets
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SWidget> GenerateStatusWidgets();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Construct this Slate ui
|
|
|
|
|
*/
|
|
|
|
|
void Construct(const FArguments& InArgs);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the current method
|
|
|
|
|
*
|
|
|
|
|
* @return ESymbolDebuggerMethods The current method
|
|
|
|
|
*/
|
|
|
|
|
ESymbolDebuggerMethods GetSymbolDebuggertMethod() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the current action being handled
|
|
|
|
|
*
|
|
|
|
|
* @return ESymbolDebuggerActions The current action
|
|
|
|
|
*/
|
|
|
|
|
ESymbolDebuggerActions GetSymbolDebuggerAction() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the FileOpen button visible?
|
|
|
|
|
*
|
|
|
|
|
* @return EVisibility The visibility of the button at this time
|
|
|
|
|
*/
|
|
|
|
|
EVisibility IsFileOpenVisible() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handle the FileOpen button being clicked
|
|
|
|
|
*
|
|
|
|
|
* @return FReply How the function handled the click
|
|
|
|
|
*/
|
|
|
|
|
FReply FileOpenClicked();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the given method selected in the Method radio buttons?
|
|
|
|
|
*
|
|
|
|
|
* @param InMethod The debugger method to check
|
|
|
|
|
*
|
2014-12-10 14:24:09 -05:00
|
|
|
* @return ECheckBoxState The state of the button for the given method
|
2014-03-14 14:13:41 -04:00
|
|
|
*/
|
2014-12-10 14:24:09 -05:00
|
|
|
ECheckBoxState IsMethodChecked(ESymbolDebuggerMethods InMethod) const;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handle the Method radio buttons changing
|
|
|
|
|
*
|
|
|
|
|
* @param InNewRadioState The new state of the radio button
|
|
|
|
|
* @param InMethodThatChanged The method radio button that changed
|
|
|
|
|
*/
|
2014-12-10 14:24:09 -05:00
|
|
|
void OnMethodChanged(ECheckBoxState InNewRadioState, ESymbolDebuggerMethods InMethodThatChanged);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the textbox enabled for the given TextField?
|
|
|
|
|
*
|
|
|
|
|
* @param InTextField The textfield of interest
|
|
|
|
|
*
|
|
|
|
|
* @return bool true if enabled, false if not
|
|
|
|
|
*/
|
|
|
|
|
bool IsTextEnabled(ESymbolDebuggerTextFields InTextField) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the given text field visible?
|
|
|
|
|
*
|
|
|
|
|
* @param InTextField The textfield of interest
|
|
|
|
|
*
|
|
|
|
|
* @return EVisibility The visibility of the status widgets at this time
|
|
|
|
|
*/
|
|
|
|
|
EVisibility IsTextVisible(ESymbolDebuggerTextFields InTextField) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the text for the given TextField textbox
|
|
|
|
|
*
|
|
|
|
|
* @param InTextField The textfield of interest
|
|
|
|
|
*
|
|
|
|
|
* @return FString The contents of the text box, "" if not found
|
|
|
|
|
*/
|
|
|
|
|
FText OnGetText(ESymbolDebuggerTextFields InTextField) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Callback for a TextField textbox edit to be committed
|
|
|
|
|
*
|
|
|
|
|
* @param InNewString The edited string
|
|
|
|
|
* @param InCommitInfo The TextCommit type that occurred (unused at this time)
|
|
|
|
|
* @param InTextField The textfield of interest
|
|
|
|
|
*/
|
|
|
|
|
void OnTextCommited(const FText& InNewString, ETextCommit::Type /*InCommitInfo*/, ESymbolDebuggerTextFields InTextField);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the shared 'Method' text
|
|
|
|
|
*
|
|
|
|
|
* @return FString The method text
|
|
|
|
|
*/
|
|
|
|
|
FText OnGetMethodText() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Callback for the method text edit to be committed
|
|
|
|
|
*
|
|
|
|
|
* @param InNewString The edited string
|
|
|
|
|
* @param InCommitInfo The TextCommit type that occurred (unused at this time)
|
|
|
|
|
*/
|
|
|
|
|
void OnMethodTextCommited(const FText& InNewString, ETextCommit::Type InCommitInfo);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the given Action button enabled?
|
|
|
|
|
*
|
|
|
|
|
* @param InAction The action of interest
|
|
|
|
|
*
|
|
|
|
|
* @return bool true if enabled, false if not
|
|
|
|
|
*/
|
|
|
|
|
bool IsActionEnabled(ESymbolDebuggerActions InAction) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handle for an action button being clicked
|
|
|
|
|
*
|
|
|
|
|
* @param InAction The action that was clicked
|
|
|
|
|
*
|
|
|
|
|
* @return FReply How the function handled the click
|
|
|
|
|
*/
|
|
|
|
|
FReply OnActionClicked(ESymbolDebuggerActions InAction);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handler for DragOver of an item on this window
|
|
|
|
|
*/
|
|
|
|
|
FReply OnDragOver(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handler for Drop of an item on this window
|
|
|
|
|
*/
|
|
|
|
|
FReply OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Are the status widgets visible?
|
|
|
|
|
*
|
|
|
|
|
* @return EVisibility The visibility of the status widgets at this time
|
|
|
|
|
*/
|
|
|
|
|
EVisibility AreStatusWidgetsVisible() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the status text
|
|
|
|
|
*
|
|
|
|
|
* @return FString The status text
|
|
|
|
|
*/
|
|
|
|
|
FText OnGetStatusText() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is the status text enabled?
|
|
|
|
|
*
|
|
|
|
|
* @return bool true if enabled, false if not
|
|
|
|
|
*/
|
|
|
|
|
bool IsStatusTextEnabled() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
/** Method Delegates */
|
|
|
|
|
FSymbolDebuggerGetCurrentMethod Delegate_OnGetCurrentMethod;
|
|
|
|
|
FSymbolDebuggerSetCurrentMethod Delegate_OnSetCurrentMethod;
|
|
|
|
|
FSymbolDebuggerGetMethodText Delegate_OnGetMethodText;
|
|
|
|
|
FSymbolDebuggerSetMethodText Delegate_OnSetMethodText;
|
|
|
|
|
|
|
|
|
|
/** FileOpen Delegates */
|
|
|
|
|
FSymbolDebuggerOnFileOpen Delegate_OnFileOpen;
|
|
|
|
|
|
|
|
|
|
/** TextField Delegates */
|
|
|
|
|
FSymbolDebuggerGetTextField Delegate_OnGetTextField;
|
|
|
|
|
FSymbolDebuggerSetTextField Delegate_OnSetTextField;
|
|
|
|
|
|
|
|
|
|
/** Action Delegates */
|
|
|
|
|
FSymbolDebuggerGetCurrentAction Delegate_OnGetCurrentAction;
|
|
|
|
|
FSymbolDebuggerIsActionEnabled Delegate_IsActionEnabled;
|
|
|
|
|
FSymbolDebuggerOnAction Delegate_OnAction;
|
|
|
|
|
|
|
|
|
|
/** Status Delegates */
|
|
|
|
|
FSymbolDebuggerOnGetStatusText Delegate_OnGetStatusText;
|
|
|
|
|
FSymbolDebuggerHasActionCompleted Delegate_HasActionCompleted;
|
|
|
|
|
};
|