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
[CL 5304722 by Ben Marsh in 4.22 branch]
2019-03-05 15:54:02 -05:00
|
|
|
// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
|
#include "LC_Thread.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class DuplexPipeClient;
|
|
|
|
|
class Event;
|
|
|
|
|
class CriticalSection;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handles incoming commands from the host (the executable that loaded the Live++ DLL)
|
|
|
|
|
class ClientUserCommandThread
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
struct ExceptionResult
|
|
|
|
|
{
|
|
|
|
|
const void* returnAddress;
|
|
|
|
|
const void* framePointer;
|
|
|
|
|
const void* stackPointer;
|
|
|
|
|
bool continueExecution;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ClientUserCommandThread(DuplexPipeClient* pipeClient, DuplexPipeClient* exceptionPipeClient);
|
|
|
|
|
~ClientUserCommandThread(void);
|
|
|
|
|
|
|
|
|
|
// Starts the thread that takes care of handling incoming commands on the pipe.
|
|
|
|
|
// Returns the thread ID.
|
|
|
|
|
unsigned int Start(const std::wstring& processGroupName, Event* waitForStartEvent, CriticalSection* pipeAccessCS);
|
|
|
|
|
|
|
|
|
|
// Joins this thread.
|
|
|
|
|
void Join(void);
|
|
|
|
|
|
|
|
|
|
void* EnableModule(const wchar_t* const nameOfExeOrDll);
|
|
|
|
|
void* EnableAllModules(const wchar_t* const nameOfExeOrDll);
|
|
|
|
|
|
|
|
|
|
void* DisableModule(const wchar_t* const nameOfExeOrDll);
|
|
|
|
|
void* DisableAllModules(const wchar_t* const nameOfExeOrDll);
|
|
|
|
|
|
|
|
|
|
void WaitForToken(void* token);
|
|
|
|
|
void TriggerRecompile(void);
|
2019-05-14 18:08:51 -04:00
|
|
|
void BuildPatch(const wchar_t* moduleNames[], const wchar_t* objPaths[], const wchar_t* amalgamatedObjPaths[], unsigned int count);
|
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
[CL 5304722 by Ben Marsh in 4.22 branch]
2019-03-05 15:54:02 -05:00
|
|
|
|
|
|
|
|
void InstallExceptionHandler(void);
|
|
|
|
|
ExceptionResult HandleException(EXCEPTION_RECORD* exception, CONTEXT* context, unsigned int threadId);
|
|
|
|
|
void End(void);
|
|
|
|
|
|
|
|
|
|
// BEGIN EPIC MOD - Adding ShowConsole command
|
|
|
|
|
void ShowConsole();
|
|
|
|
|
// END EPIC MOD
|
|
|
|
|
|
|
|
|
|
// BEGIN EPIC MOD - Adding SetVisible command
|
|
|
|
|
void SetVisible(bool visible);
|
|
|
|
|
// END EPIC MOD
|
|
|
|
|
|
|
|
|
|
// BEGIN EPIC MOD - Adding SetActive command
|
|
|
|
|
void SetActive(bool active);
|
|
|
|
|
// END EPIC MOD
|
|
|
|
|
|
|
|
|
|
// BEGIN EPIC MOD - Adding SetBuildArguments command
|
|
|
|
|
void SetBuildArguments(const wchar_t* arguments);
|
|
|
|
|
// END EPIC MOD
|
|
|
|
|
|
2019-03-18 18:06:51 -04:00
|
|
|
// BEGIN EPIC MOD - Support for lazy-loading modules
|
|
|
|
|
void EnableLazyLoadedModule(const wchar_t* fileName, Windows::HMODULE moduleBase);
|
|
|
|
|
// END EPIC MOD
|
|
|
|
|
|
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
[CL 5304722 by Ben Marsh in 4.22 branch]
2019-03-05 15:54:02 -05:00
|
|
|
void ApplySettingBool(const char* const settingName, int value);
|
|
|
|
|
void ApplySettingInt(const char* const settingName, int value);
|
|
|
|
|
void ApplySettingString(const char* const settingName, const wchar_t* const value);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
struct ThreadContext
|
|
|
|
|
{
|
|
|
|
|
ClientUserCommandThread* thisInstance;
|
|
|
|
|
Event* waitForStartEvent;
|
|
|
|
|
CriticalSection* pipeAccessCS;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static unsigned int __stdcall ThreadProxy(void* context);
|
|
|
|
|
unsigned int ThreadFunction(Event* waitForStartEvent, CriticalSection* pipeAccessCS);
|
|
|
|
|
|
|
|
|
|
thread::Handle m_thread;
|
|
|
|
|
std::wstring m_processGroupName;
|
|
|
|
|
DuplexPipeClient* m_pipe;
|
|
|
|
|
DuplexPipeClient* m_exceptionPipe;
|
|
|
|
|
Event* m_itemInQueueEvent;
|
|
|
|
|
};
|