llvm.org GIT mirror llvm / 5eccd36
Audited all the format strings in libDebugInfo and fixed those that didn't match the types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143814 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 7 years ago
4 changed file(s) with 14 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
8282
8383 DWARFAbbreviationDeclarationCollMapConstIter pos;
8484 for (pos = AbbrevCollMap.begin(); pos != AbbrevCollMap.end(); ++pos) {
85 OS << format("Abbrev table for offset: 0x%8.8x\n", pos->first);
85 OS << format("Abbrev table for offset: 0x%8.8" PRIx64 "\n", pos->first);
8686 pos->second.dump(OS);
8787 }
8888 }
2424 DWARFAbbreviationDeclarationCollConstIter;
2525
2626 class DWARFAbbreviationDeclarationSet {
27 uint64_t Offset;
27 uint32_t Offset;
2828 uint32_t IdxOffset;
2929 std::vector Decls;
3030 public:
3131 DWARFAbbreviationDeclarationSet()
3232 : Offset(0), IdxOffset(0) {}
3333
34 DWARFAbbreviationDeclarationSet(uint64_t offset, uint32_t idxOffset)
34 DWARFAbbreviationDeclarationSet(uint32_t offset, uint32_t idxOffset)
3535 : Offset(offset), IdxOffset(idxOffset) {}
3636
3737 void clear() {
3838 IdxOffset = 0;
3939 Decls.clear();
4040 }
41 uint64_t getOffset() const { return Offset; }
41 uint32_t getOffset() const { return Offset; }
4242 void dump(raw_ostream &OS) const;
4343 bool extract(DataExtractor data, uint32_t* offset_ptr);
4444
4040 "----------------\n";
4141 for (uint32_t i = 0; i < FileNames.size(); ++i) {
4242 const FileNameEntry& fileEntry = FileNames[i];
43 OS << format("file_names[%3u] %4u ", i+1, fileEntry.DirIdx)
44 << format("0x%8.8x 0x%8.8x ", fileEntry.ModTime, fileEntry.Length)
43 OS << format("file_names[%3u] %4" PRIu64 " ", i+1, fileEntry.DirIdx)
44 << format("0x%8.8" PRIx64 " 0x%8.8" PRIx64 " ",
45 fileEntry.ModTime, fileEntry.Length)
4546 << fileEntry.Name << '\n';
4647 }
4748 }
262262 bool cu_relative_offset = false;
263263
264264 switch (Form) {
265 case DW_FORM_addr: OS << format("0x%016x", uvalue); break;
265 case DW_FORM_addr: OS << format("0x%016" PRIx64, uvalue); break;
266266 case DW_FORM_flag:
267 case DW_FORM_data1: OS << format("0x%02x", uvalue); break;
268 case DW_FORM_data2: OS << format("0x%04x", uvalue); break;
269 case DW_FORM_data4: OS << format("0x%08x", uvalue); break;
270 case DW_FORM_data8: OS << format("0x%016x", uvalue); break;
267 case DW_FORM_data1: OS << format("0x%02x", (uint8_t)uvalue); break;
268 case DW_FORM_data2: OS << format("0x%04x", (uint16_t)uvalue); break;
269 case DW_FORM_data4: OS << format("0x%08x", (uint32_t)uvalue); break;
270 case DW_FORM_data8: OS << format("0x%016" PRIx64, uvalue); break;
271271 case DW_FORM_string:
272272 OS << '"';
273273 OS.write_escaped(getAsCString(NULL));
313313 break;
314314 }
315315 case DW_FORM_ref_addr:
316 OS << format("0x%016x", uvalue);
316 OS << format("0x%016" PRIx64, uvalue);
317317 break;
318318 case DW_FORM_ref1:
319319 cu_relative_offset = true;
347347 }
348348
349349 if (cu_relative_offset)
350 OS << format(" => {0x%8.8x}", (uvalue + (cu ? cu->getOffset() : 0)));
350 OS << format(" => {0x%8.8"PRIx64"}", (uvalue + (cu ? cu->getOffset() : 0)));
351351 }
352352
353353 const char*