Skip to content

Commit c3bbc3a

Browse files
authored
[BOLT] Fix logs with no hex convension (#112650)
Add `utohexstr` to ensure that offsets/addresses are correctly formatted as hexadecimal values.
1 parent 69a798a commit c3bbc3a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class DIEBuilder {
314314

315315
BC.errs()
316316
<< "BOLT-ERROR: unable to find TypeUnit for Type Unit at offset 0x"
317-
<< DU.getOffset() << "\n";
317+
<< Twine::utohexstr(DU.getOffset()) << "\n";
318318
return nullptr;
319319
}
320320

bolt/lib/Core/BinaryContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,8 @@ bool BinaryContext::handleAArch64Veneer(uint64_t Address, bool MatchOnly) {
12941294
Veneer->getOrCreateLocalLabel(Address);
12951295
Veneer->setMaxSize(TotalSize);
12961296
Veneer->updateState(BinaryFunction::State::Disassembled);
1297-
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: handling veneer function at 0x" << Address
1298-
<< "\n");
1297+
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: handling veneer function at 0x"
1298+
<< Twine::utohexstr(Address) << "\n");
12991299
return true;
13001300
};
13011301

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ void DWARFRewriter::updateDWARFObjectAddressRanges(
13621362
Die.getTag() == dwarf::DW_TAG_compile_unit)) {
13631363
if (opts::Verbosity >= 1)
13641364
errs() << "BOLT-WARNING: cannot update ranges for DIE in Unit offset 0x"
1365-
<< Unit.getOffset() << '\n';
1365+
<< Twine::utohexstr(Unit.getOffset()) << '\n';
13661366
}
13671367
}
13681368

0 commit comments

Comments
 (0)