Skip to content

Commit

Permalink
Fixed format strings to avoid pointer truncation during 64-bit debugg…
Browse files Browse the repository at this point in the history
…ing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167185 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Andrew Kaylor committed Nov 1, 2012
1 parent 7dd4dc8 commit 3037a58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/lli/lli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void layoutRemoteTargetMemory(RemoteTarget *T, RecordingMemoryManager *JMM) {
EE->mapSectionAddress(const_cast<void*>(Offsets[i].first), Addr);

DEBUG(dbgs() << " Mapping local: " << Offsets[i].first
<< " to remote: " << format("%#018x", Addr) << "\n");
<< " to remote: " << format("%p", Addr) << "\n");

}
// Now load it all to the target.
Expand All @@ -483,12 +483,12 @@ void layoutRemoteTargetMemory(RemoteTarget *T, RecordingMemoryManager *JMM) {
T->loadCode(Addr, Offsets[i].first, Sizes[i]);

DEBUG(dbgs() << " loading code: " << Offsets[i].first
<< " to remote: " << format("%#018x", Addr) << "\n");
<< " to remote: " << format("%p", Addr) << "\n");
} else {
T->loadData(Addr, Offsets[i].first, Sizes[i]);

DEBUG(dbgs() << " loading data: " << Offsets[i].first
<< " to remote: " << format("%#018x", Addr) << "\n");
<< " to remote: " << format("%p", Addr) << "\n");
}

}
Expand Down Expand Up @@ -693,7 +693,7 @@ int main(int argc, char **argv, char * const *envp) {
uint64_t Entry = (uint64_t)EE->getPointerToFunction(EntryFn);

DEBUG(dbgs() << "Executing '" << EntryFn->getName() << "' at "
<< format("%#18x", Entry) << "\n");
<< format("%p", Entry) << "\n");

if (Target.executeCode(Entry, Result))
errs() << "ERROR: " << Target.getErrorMsg() << "\n";
Expand Down

0 comments on commit 3037a58

Please sign in to comment.