llvm-objdump: use portable format specifiers for info.
authorTim Northover <tnorthover@apple.com>
Fri, 8 Aug 2014 12:00:09 +0000 (12:00 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 8 Aug 2014 12:00:09 +0000 (12:00 +0000)
ARM bots (& others, I think, now that I look) were failing because we
were using incorrect printf-style format specifiers. They were wrong
on almost any platform, actually, just mostly harmlessly so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215196 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/MachODump.cpp

index 3ba8b87d40002986692267786cd350d50a355bd1..017e4f2b9ce8a53b376d2589fe56fc7fe6276483 100644 (file)
@@ -629,27 +629,27 @@ printMachOCompactUnwindSection(const MachOObjectFile *Obj,
   // Finally, we're ready to print the data we've gathered.
   outs() << "Contents of __compact_unwind section:\n";
   for (auto &Entry : CompactUnwinds) {
-    outs() << "  Entry at offset " << format("0x%x", Entry.OffsetInSection)
+    outs() << "  Entry at offset " << format("0x" PRIx32, Entry.OffsetInSection)
            << ":\n";
 
     // 1. Start of the region this entry applies to.
     outs() << "    start:                "
-           << format("0x%x", Entry.FunctionAddr) << ' ';
+           << format("0x%" PRIx64, Entry.FunctionAddr) << ' ';
     printUnwindRelocDest(Obj, Symbols, Entry.FunctionReloc,
                          Entry.FunctionAddr);
     outs() << '\n';
 
     // 2. Length of the region this entry applies to.
     outs() << "    length:               "
-           << format("0x%x", Entry.Length) << '\n';
+           << format("0x%" PRIx32, Entry.Length) << '\n';
     // 3. The 32-bit compact encoding.
     outs() << "    compact encoding:     "
-           << format("0x%08x", Entry.CompactEncoding) << '\n';
+           << format("0x%08" PRIx32, Entry.CompactEncoding) << '\n';
 
     // 4. The personality function, if present.
     if (Entry.PersonalityReloc.getObjectFile()) {
       outs() << "    personality function: "
-             << format("0x%x", Entry.PersonalityAddr) << ' ';
+             << format("0x%" PRIx64, Entry.PersonalityAddr) << ' ';
       printUnwindRelocDest(Obj, Symbols, Entry.PersonalityReloc,
                            Entry.PersonalityAddr);
       outs() << '\n';
@@ -658,7 +658,7 @@ printMachOCompactUnwindSection(const MachOObjectFile *Obj,
     // 5. This entry's language-specific data area.
     if (Entry.LSDAReloc.getObjectFile()) {
       outs() << "    LSDA:                 "
-             << format("0x%x", Entry.LSDAAddr) << ' ';
+             << format("0x%" PRIx64, Entry.LSDAAddr) << ' ';
       printUnwindRelocDest(Obj, Symbols, Entry.LSDAReloc, Entry.LSDAAddr);
       outs() << '\n';
     }