You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
94 lines
2.6 KiB
C++
94 lines
2.6 KiB
C++
// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreTypes.h"
|
|
#include "LC_Symbols.h"
|
|
#include "LC_Hook.h"
|
|
#include "LC_CriticalSection.h"
|
|
|
|
|
|
class LiveProcess;
|
|
class DuplexPipe;
|
|
|
|
// thread-safe
|
|
class ModuleCache
|
|
{
|
|
public:
|
|
static const size_t SEARCH_ALL_MODULES = static_cast<size_t>(-1);
|
|
|
|
struct ProcessData
|
|
{
|
|
// all data except moduleBase is redundant and stored per cache entry, but this doesn't
|
|
// increase memory requirements by much. we'd rather have all information accessible fast.
|
|
unsigned int processId;
|
|
process::Handle processHandle;
|
|
const DuplexPipe* pipe;
|
|
|
|
void* moduleBase;
|
|
};
|
|
|
|
struct Data
|
|
{
|
|
uint16_t index; // index of the patch corresponding to the data (0 = original executable)
|
|
const symbols::SymbolDB* symbolDb;
|
|
const symbols::ContributionDB* contributionDb;
|
|
const symbols::CompilandDB* compilandDb;
|
|
const symbols::ThunkDB* thunkDb;
|
|
const symbols::ImageSectionDB* imageSectionDb;
|
|
|
|
types::vector<ProcessData> processes; // all processes that this patch is loaded into
|
|
};
|
|
|
|
struct FindSymbolData
|
|
{
|
|
const Data* data;
|
|
const symbols::Symbol* symbol;
|
|
};
|
|
|
|
struct FindHookData
|
|
{
|
|
const Data* data;
|
|
uint32_t firstRva;
|
|
uint32_t lastRva;
|
|
};
|
|
|
|
ModuleCache(void);
|
|
|
|
|
|
// adds an entry to the cache. does not take ownership of the databases.
|
|
// returns a token for registering a process associated with this entry.
|
|
size_t Insert(const symbols::SymbolDB* symbolDb, const symbols::ContributionDB* contributionDb, const symbols::CompilandDB* compilandDb, const symbols::ThunkDB* thunkDb, const symbols::ImageSectionDB* imageSectionDb);
|
|
|
|
// associates a process with an entry identified by a previously returned token.
|
|
void RegisterProcess(size_t token, LiveProcess* liveProcess, void* moduleBase);
|
|
|
|
// removes a process from all entries
|
|
void UnregisterProcess(LiveProcess* liveProcess);
|
|
|
|
|
|
// tries finding a symbol by name, starting from the first module, walking to the latest, excluding the module with the given token
|
|
FindSymbolData FindSymbolByName(size_t ignoreToken, const ImmutableString& symbolName) const;
|
|
|
|
// tries finding the first and last hook in a given section, starting from the newest module, walking to the first, excluding the module with the given token
|
|
FindHookData FindHooksInSectionBackwards(size_t ignoreToken, const ImmutableString& sectionName) const;
|
|
|
|
|
|
types::vector<void*> GatherModuleBases(unsigned int processId) const;
|
|
|
|
|
|
inline size_t GetSize(void) const
|
|
{
|
|
return m_cache.size();
|
|
}
|
|
|
|
inline const Data& GetEntry(size_t i) const
|
|
{
|
|
return m_cache[i];
|
|
}
|
|
|
|
private:
|
|
mutable CriticalSection m_cs;
|
|
types::vector<Data> m_cache;
|
|
};
|