Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveProcess.h
ben marsh 7c46cc6b4c Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.

Changes vs standalone Live++ version:

* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.

Known issues:

* Does not currently support class layout changes / object reinstancing

#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira

#ROBOMERGE-OWNER: ryan.gerleve
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051
#ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking)

[CL 5326306 by ben marsh in Dev-Networking branch]
2019-03-06 18:19:24 -05:00

85 lines
1.9 KiB
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "CoreTypes.h"
#include "LC_Process.h"
#include "LC_Executable.h"
#include "LC_Types.h"
class DuplexPipe;
class CodeCave;
class LiveProcess
{
public:
LiveProcess(process::Handle processHandle, unsigned int processId, unsigned int commandThreadId, const DuplexPipe* pipe);
void ReadHeartBeatDelta(const wchar_t* const processGroupName);
// returns whether this process made some progress, based on the heart beat received from the client
bool MadeProgress(void) const;
void InstallCodeCave(void);
void UninstallCodeCave(void);
void AddLoadedImage(const executable::Header& imageHeader);
void RemoveLoadedImage(const executable::Header& imageHeader);
bool TriedToLoadImage(const executable::Header& imageHeader) const;
inline process::Handle GetProcessHandle(void) const
{
return m_processHandle;
}
inline unsigned int GetProcessId(void) const
{
return m_processId;
}
inline unsigned int GetCommandThreadId(void) const
{
return m_commandThreadId;
}
inline const DuplexPipe* GetPipe(void) const
{
return m_pipe;
}
// BEGIN EPIC MOD - Add build arguments
inline void SetBuildArguments(const wchar_t* buildArguments)
{
m_buildArguments = buildArguments;
}
inline const wchar_t* GetBuildArguments()
{
return m_buildArguments.c_str();
}
// END EPIC MOD
private:
process::Handle m_processHandle;
unsigned int m_processId;
unsigned int m_commandThreadId;
const DuplexPipe* m_pipe;
// BEGIN EPIC MOD - Add build arguments
std::wstring m_buildArguments;
// END EPIC MOD
// loaded modules are not identified by their full path, but by their executable image header.
// we do this to ensure that the same executable loaded from a different path is not treated as
// a different executable.
types::unordered_set<executable::Header> m_imagesTriedToLoad;
uint64_t m_heartBeatDelta;
CodeCave* m_codeCave;
};