1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[llvm-jitlink] Add -show-init-es option to dump initial ExecutionSession state.

Inspecting this state can be helpful when debugging jit-linking testcases.
This commit is contained in:
Lang Hames 2020-03-14 16:07:46 -07:00
parent 601e0cfef0
commit da59eff7c0

View File

@ -86,6 +86,11 @@ static cl::list<std::string> AbsoluteDefs(
cl::desc("Inject absolute symbol definitions (syntax: <name>=<addr>)"), cl::desc("Inject absolute symbol definitions (syntax: <name>=<addr>)"),
cl::ZeroOrMore); cl::ZeroOrMore);
static cl::opt<bool> ShowInitialExecutionSessionState(
"show-init-es",
cl::desc("Print ExecutionSession state before resolving entry point"),
cl::init(false));
static cl::opt<bool> ShowAddrs( static cl::opt<bool> ShowAddrs(
"show-addrs", "show-addrs",
cl::desc("Print registered symbol, section, got and stub addresses"), cl::desc("Print registered symbol, section, got and stub addresses"),
@ -841,12 +846,14 @@ int main(int argc, char *argv[]) {
ExitOnErr(loadProcessSymbols(*S)); ExitOnErr(loadProcessSymbols(*S));
ExitOnErr(loadDylibs()); ExitOnErr(loadDylibs());
{ {
TimeRegion TR(Timers ? &Timers->LoadObjectsTimer : nullptr); TimeRegion TR(Timers ? &Timers->LoadObjectsTimer : nullptr);
ExitOnErr(loadObjects(*S)); ExitOnErr(loadObjects(*S));
} }
if (ShowInitialExecutionSessionState)
S->ES.dump(outs());
JITEvaluatedSymbol EntryPoint = 0; JITEvaluatedSymbol EntryPoint = 0;
{ {
TimeRegion TR(Timers ? &Timers->LinkTimer : nullptr); TimeRegion TR(Timers ? &Timers->LinkTimer : nullptr);