forked from OSchip/llvm-project
[JITLink] Display host -> target address mapping in debugging output.
This can be helpful for sanity checking JITLink memory manager behavior.
This commit is contained in:
parent
7e825abd57
commit
bf783a6aa8
|
@ -267,11 +267,12 @@ Error JITLinkerBase::allocateSegments(const SegmentLayoutMap &Layout) {
|
||||||
return AllocOrErr.takeError();
|
return AllocOrErr.takeError();
|
||||||
|
|
||||||
LLVM_DEBUG({
|
LLVM_DEBUG({
|
||||||
dbgs() << "JIT linker got working memory:\n";
|
dbgs() << "JIT linker got memory (working -> target):\n";
|
||||||
for (auto &KV : Layout) {
|
for (auto &KV : Layout) {
|
||||||
auto Prot = static_cast<sys::Memory::ProtectionFlags>(KV.first);
|
auto Prot = static_cast<sys::Memory::ProtectionFlags>(KV.first);
|
||||||
dbgs() << " " << Prot << ": "
|
dbgs() << " " << Prot << ": "
|
||||||
<< (const void *)Alloc->getWorkingMemory(Prot).data() << "\n";
|
<< (const void *)Alloc->getWorkingMemory(Prot).data() << " -> "
|
||||||
|
<< formatv("{0:x16}", Alloc->getTargetMemory(Prot)) << "\n";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue