mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Sanitize MCJIT remote execution
MCJIT remote execution (ChildTarget+RemoteTargetExternal) protocol was in dire need of refactoring. It was fail-prone, had no error reporting and implemented the same message logic on every single function. This patch rectifies it, and makes it work on ARM, where it was randomly failing. Other architectures shall profit from this change as well, making their buildbots and releases more reliable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -129,7 +129,7 @@ void RemoteMemoryManager::notifyObjectLoaded(ExecutionEngine *EE,
|
||||
|
||||
// Allocate space in the remote target.
|
||||
uint64_t RemoteAddr;
|
||||
if (Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr))
|
||||
if (!Target->allocateSpace(CurOffset, MaxAlign, RemoteAddr))
|
||||
report_fatal_error(Target->getErrorMsg());
|
||||
|
||||
// Map the section addresses so relocations will get updated in the local
|
||||
@@ -155,13 +155,13 @@ bool RemoteMemoryManager::finalizeMemory(std::string *ErrMsg) {
|
||||
uint64_t RemoteAddr = I->first;
|
||||
const Allocation &Section = I->second;
|
||||
if (Section.IsCode) {
|
||||
Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size());
|
||||
|
||||
if (!Target->loadCode(RemoteAddr, Section.MB.base(), Section.MB.size()))
|
||||
report_fatal_error(Target->getErrorMsg());
|
||||
DEBUG(dbgs() << " loading code: " << Section.MB.base()
|
||||
<< " to remote: 0x" << format("%llx", RemoteAddr) << "\n");
|
||||
} else {
|
||||
Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size());
|
||||
|
||||
if (!Target->loadData(RemoteAddr, Section.MB.base(), Section.MB.size()))
|
||||
report_fatal_error(Target->getErrorMsg());
|
||||
DEBUG(dbgs() << " loading data: " << Section.MB.base()
|
||||
<< " to remote: 0x" << format("%llx", RemoteAddr) << "\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user