Unmapped.back().RemoteCodeAddr =
Client.reserveMem(Id, CodeSize, CodeAlign);
- LLVM_DEBUG(dbgs() << " code: "
- << format("0x%016x", Unmapped.back().RemoteCodeAddr)
- << " (" << CodeSize << " bytes, alignment "
- << CodeAlign << ")\n");
+ LLVM_DEBUG(
+ dbgs() << " code: "
+ << format("0x%016" PRIx64, Unmapped.back().RemoteCodeAddr)
+ << " (" << CodeSize << " bytes, alignment " << CodeAlign
+ << ")\n");
}
if (RODataSize != 0) {
Unmapped.back().RemoteRODataAddr =
Client.reserveMem(Id, RODataSize, RODataAlign);
- LLVM_DEBUG(dbgs() << " ro-data: "
- << format("0x%016x", Unmapped.back().RemoteRODataAddr)
- << " (" << RODataSize << " bytes, alignment "
- << RODataAlign << ")\n");
+ LLVM_DEBUG(
+ dbgs() << " ro-data: "
+ << format("0x%016" PRIx64, Unmapped.back().RemoteRODataAddr)
+ << " (" << RODataSize << " bytes, alignment " << RODataAlign
+ << ")\n");
}
if (RWDataSize != 0) {
Unmapped.back().RemoteRWDataAddr =
Client.reserveMem(Id, RWDataSize, RWDataAlign);
- LLVM_DEBUG(dbgs() << " rw-data: "
- << format("0x%016x", Unmapped.back().RemoteRWDataAddr)
- << " (" << RWDataSize << " bytes, alignment "
- << RWDataAlign << ")\n");
+ LLVM_DEBUG(
+ dbgs() << " rw-data: "
+ << format("0x%016" PRIx64, Unmapped.back().RemoteRWDataAddr)
+ << " (" << RWDataSize << " bytes, alignment " << RWDataAlign
+ << ")\n");
}
}
for (auto &Alloc : Allocs) {
NextAddr = alignTo(NextAddr, Alloc.getAlign());
Dyld.mapSectionAddress(Alloc.getLocalAddress(), NextAddr);
- LLVM_DEBUG(dbgs() << " "
- << static_cast<void *>(Alloc.getLocalAddress())
- << " -> " << format("0x%016x", NextAddr) << "\n");
+ LLVM_DEBUG(
+ dbgs() << " " << static_cast<void *>(Alloc.getLocalAddress())
+ << " -> " << format("0x%016" PRIx64, NextAddr) << "\n");
Alloc.setRemoteAddress(NextAddr);
// Only advance NextAddr if it was non-null to begin with,
LLVM_DEBUG(dbgs() << " copying section: "
<< static_cast<void *>(Alloc.getLocalAddress())
<< " -> "
- << format("0x%016x", Alloc.getRemoteAddress())
+ << format("0x%016" PRIx64, Alloc.getRemoteAddress())
<< " (" << Alloc.getSize() << " bytes)\n";);
if (Client.writeMem(Alloc.getRemoteAddress(), Alloc.getLocalAddress(),
<< (Permissions & sys::Memory::MF_WRITE ? 'W' : '-')
<< (Permissions & sys::Memory::MF_EXEC ? 'X' : '-')
<< " permissions on block: "
- << format("0x%016x", RemoteSegmentAddr) << "\n");
+ << format("0x%016" PRIx64, RemoteSegmentAddr)
+ << "\n");
if (Client.setProtections(Id, RemoteSegmentAddr, Permissions))
return true;
}
/// Call the int(void) function at the given address in the target and return
/// its result.
Expected<int> callIntVoid(JITTargetAddress Addr) {
- LLVM_DEBUG(dbgs() << "Calling int(*)(void) " << format("0x%016x", Addr)
- << "\n");
+ LLVM_DEBUG(dbgs() << "Calling int(*)(void) "
+ << format("0x%016" PRIx64, Addr) << "\n");
return callB<exec::CallIntVoid>(Addr);
}
Expected<int> callMain(JITTargetAddress Addr,
const std::vector<std::string> &Args) {
LLVM_DEBUG(dbgs() << "Calling int(*)(int, char*[]) "
- << format("0x%016x", Addr) << "\n");
+ << format("0x%016" PRIx64, Addr) << "\n");
return callB<exec::CallMain>(Addr, Args);
}
/// Call the void() function at the given address in the target and wait for
/// it to finish.
Error callVoidVoid(JITTargetAddress Addr) {
- LLVM_DEBUG(dbgs() << "Calling void(*)(void) " << format("0x%016x", Addr)
- << "\n");
+ LLVM_DEBUG(dbgs() << "Calling void(*)(void) "
+ << format("0x%016" PRIx64, Addr) << "\n");
return callB<exec::CallVoidVoid>(Addr);
}
}
raw_ostream &operator<<(raw_ostream &OS, const JITEvaluatedSymbol &Sym) {
- return OS << format("0x%016x", Sym.getAddress()) << " " << Sym.getFlags();
+ return OS << format("0x%016" PRIx64, Sym.getAddress()) << " "
+ << Sym.getFlags();
}
raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap::value_type &KV) {
void JITDylib::dump(raw_ostream &OS) {
ES.runSessionLocked([&, this]() {
- OS << "JITDylib \"" << JITDylibName
- << "\" (ES: " << format("0x%016x", reinterpret_cast<uintptr_t>(&ES))
- << "):\n"
+ OS << "JITDylib \"" << JITDylibName << "\" (ES: "
+ << format("0x%016" PRIx64, reinterpret_cast<uintptr_t>(&ES)) << "):\n"
<< "Search order: [";
for (auto &KV : SearchOrder)
OS << " (\"" << KV.first->getName() << "\", "
for (auto &KV : Symbols) {
OS << " \"" << *KV.first << "\": ";
if (auto Addr = KV.second.getAddress())
- OS << format("0x%016x", Addr) << ", " << KV.second.getFlags();
+ OS << format("0x%016" PRIx64, Addr) << ", " << KV.second.getFlags();
else
OS << "<not resolved>";
if (KV.second.getFlags().isLazy() ||