[llvm] bf783a6 - [JITLink] Display host -> target address mapping in debugging output.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 10:06:23 PDT 2020


Author: Lang Hames
Date: 2020-06-19T10:05:02-07:00
New Revision: bf783a6aa890d7e759f2e920e89ca6179e6c7fc0

URL: https://github.com/llvm/llvm-project/commit/bf783a6aa890d7e759f2e920e89ca6179e6c7fc0
DIFF: https://github.com/llvm/llvm-project/commit/bf783a6aa890d7e759f2e920e89ca6179e6c7fc0.diff

LOG: [JITLink] Display host -> target address mapping in debugging output.

This can be helpful for sanity checking JITLink memory manager behavior.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
index ec6681c823f6..1d76a49939dc 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
@@ -267,11 +267,12 @@ Error JITLinkerBase::allocateSegments(const SegmentLayoutMap &Layout) {
     return AllocOrErr.takeError();
 
   LLVM_DEBUG({
-    dbgs() << "JIT linker got working memory:\n";
+    dbgs() << "JIT linker got memory (working -> target):\n";
     for (auto &KV : Layout) {
       auto Prot = static_cast<sys::Memory::ProtectionFlags>(KV.first);
       dbgs() << "  " << Prot << ": "
-             << (const void *)Alloc->getWorkingMemory(Prot).data() << "\n";
+             << (const void *)Alloc->getWorkingMemory(Prot).data() << " -> "
+             << formatv("{0:x16}", Alloc->getTargetMemory(Prot)) << "\n";
     }
   });
 


        


More information about the llvm-commits mailing list