diff options
| author | Daniel Malea <daniel.malea@intel.com> | 2012-11-29 21:49:15 +0000 |
|---|---|---|
| committer | Daniel Malea <daniel.malea@intel.com> | 2012-11-29 21:49:15 +0000 |
| commit | d01b2953fac73977de3bc97e72ea04ad1ec6600f (patch) | |
| tree | 1883eeb5c13d5a2aa557d50eb40a0e08f43a8ec1 /lldb/source/Symbol | |
| parent | 05d3bf77a1af49e8f6513729e4ccce780ffae4bb (diff) | |
| download | bcm5719-llvm-d01b2953fac73977de3bc97e72ea04ad1ec6600f.tar.gz bcm5719-llvm-d01b2953fac73977de3bc97e72ea04ad1ec6600f.zip | |
Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types
Patch from Matt Kopec!
llvm-svn: 168945
Diffstat (limited to 'lldb/source/Symbol')
| -rw-r--r-- | lldb/source/Symbol/Block.cpp | 8 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 8 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTType.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Symbol/CompileUnit.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Symbol/Function.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Symbol/ObjectFile.cpp | 10 | ||||
| -rw-r--r-- | lldb/source/Symbol/Symbol.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/Symbol/Type.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Symbol/UnwindPlan.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Symbol/UnwindTable.cpp | 2 |
11 files changed, 35 insertions, 35 deletions
diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp index 1cda1caaa3a..42ade8c9ab3 100644 --- a/lldb/source/Symbol/Block.cpp +++ b/lldb/source/Symbol/Block.cpp @@ -89,7 +89,7 @@ Block::Dump(Stream *s, addr_t base_addr, int32_t depth, bool show_context) const const Block* parent_block = GetParent(); if (parent_block) { - s->Printf(", parent = {0x%8.8llx}", parent_block->GetID()); + s->Printf(", parent = {0x%8.8" PRIx64 "}", parent_block->GetID()); } if (m_inlineInfoSP.get() != NULL) { @@ -194,7 +194,7 @@ Block::DumpSymbolContext(Stream *s) Function *function = CalculateSymbolContextFunction(); if (function) function->DumpSymbolContext(s); - s->Printf(", Block{0x%8.8llx}", GetID()); + s->Printf(", Block{0x%8.8" PRIx64 "}", GetID()); } void @@ -408,7 +408,7 @@ Block::AddRange (const Range& range) const Declaration &func_decl = func_type->GetDeclaration(); if (func_decl.GetLine()) { - log->Printf ("warning: %s/%s:%u block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s", + log->Printf ("warning: %s/%s:%u block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s", func_decl.GetFile().GetDirectory().GetCString(), func_decl.GetFile().GetFilename().GetCString(), func_decl.GetLine(), @@ -423,7 +423,7 @@ Block::AddRange (const Range& range) } else { - log->Printf ("warning: block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s", + log->Printf ("warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s", GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr, diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index bd669fccf21..a400813482f 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -66,12 +66,12 @@ ClangASTImporter::CopyDecl (clang::ASTContext *dst_ast, user_id = metadata->GetUserID(); if (NamedDecl *named_decl = dyn_cast<NamedDecl>(decl)) - log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s '%s', metadata 0x%llx", + log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s '%s', metadata 0x%" PRIx64, decl->getDeclKindName(), named_decl->getNameAsString().c_str(), user_id); else - log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s, metadata 0x%llx", + log->Printf(" [ClangASTImporter] WARNING: Failed to import a %s, metadata 0x%" PRIx64, decl->getDeclKindName(), user_id); } @@ -467,7 +467,7 @@ clang::Decl from_named_decl->printName(name_stream); name_stream.flush(); - log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%llx", + log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%" PRIx64, from->getDeclKindName(), to, name_string.c_str(), @@ -476,7 +476,7 @@ clang::Decl } else { - log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p (from (Decl*)%p), metadata 0x%llx", + log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p (from (Decl*)%p), metadata 0x%" PRIx64, from->getDeclKindName(), to, from, diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp index 3e9b4664ad8..07adb017477 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/ClangASTType.cpp @@ -811,7 +811,7 @@ ClangASTType::DumpValue } // If we have gotten here we didn't get find the enumerator in the // enum decl, so just print the integer. - s->Printf("%lli", enum_value); + s->Printf("%" PRIi64, enum_value); } return; @@ -1010,7 +1010,7 @@ ClangASTType::DumpTypeValue (clang::ASTContext *ast_context, // If we have gotten here we didn't get find the enumerator in the // enum decl, so just print the integer. - s->Printf("%lli", enum_value); + s->Printf("%" PRIi64, enum_value); return true; } // format was not enum, just fall through and dump the value as requested.... diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index fbcf45b72fe..751b09ec5a6 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -78,7 +78,7 @@ void CompileUnit::DumpSymbolContext(Stream *s) { GetModule()->DumpSymbolContext(s); - s->Printf(", CompileUnit{0x%8.8llx}", GetID()); + s->Printf(", CompileUnit{0x%8.8" PRIx64 "}", GetID()); } diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 0f060ddda9f..34f2ea560a9 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -370,7 +370,7 @@ Function::Dump(Stream *s, bool show_context) const } else if (m_type_uid != LLDB_INVALID_UID) { - s->Printf(", type_uid = 0x%8.8llx", m_type_uid); + s->Printf(", type_uid = 0x%8.8" PRIx64, m_type_uid); } s->EOL(); @@ -426,7 +426,7 @@ void Function::DumpSymbolContext(Stream *s) { m_comp_unit->DumpSymbolContext(s); - s->Printf(", Function{0x%8.8llx}", GetID()); + s->Printf(", Function{0x%8.8" PRIx64 "}", GetID()); } size_t diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index f627f410928..6e4ee9b58bf 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -34,7 +34,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, const FileSpec* file, a if (module_sp) { Timer scoped_timer (__PRETTY_FUNCTION__, - "ObjectFile::FindPlugin (module = %s/%s, file = %p, file_offset = 0x%8.8llx, file_size = 0x%8.8llx)", + "ObjectFile::FindPlugin (module = %s/%s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")", module_sp->GetFileSpec().GetDirectory().AsCString(), module_sp->GetFileSpec().GetFilename().AsCString(), file, (uint64_t) file_offset, (uint64_t) file_size); @@ -114,7 +114,7 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, if (module_sp) { Timer scoped_timer (__PRETTY_FUNCTION__, - "ObjectFile::FindPlugin (module = %s/%s, process = %p, header_addr = 0x%llx)", + "ObjectFile::FindPlugin (module = %s/%s, process = %p, header_addr = 0x%" PRIx64 ")", module_sp->GetFileSpec().GetDirectory().AsCString(), module_sp->GetFileSpec().GetFilename().AsCString(), process_sp.get(), header_addr); @@ -162,7 +162,7 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, { if (m_file) { - log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8llx, size = %llu\n", + log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8" PRIx64 ", size = %" PRIu64 "\n", this, module_sp->GetFileSpec().GetDirectory().AsCString(), module_sp->GetFileSpec().GetFilename().AsCString(), @@ -173,7 +173,7 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, } else { - log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8llx, size = %llu\n", + log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8" PRIx64 ", size = %" PRIu64 "\n", this, module_sp->GetFileSpec().GetDirectory().AsCString(), module_sp->GetFileSpec().GetFilename().AsCString(), @@ -204,7 +204,7 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) { - log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, process = %p, header_addr = 0x%llx\n", + log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, process = %p, header_addr = 0x%" PRIx64 "\n", this, module_sp->GetFileSpec().GetDirectory().AsCString(), module_sp->GetFileSpec().GetFilename().AsCString(), diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp index 8b2bd20aaf6..6f2420dcca9 100644 --- a/lldb/source/Symbol/Symbol.cpp +++ b/lldb/source/Symbol/Symbol.cpp @@ -206,14 +206,14 @@ Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) } } else - s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); + s->Printf (", value = 0x%16.16" PRIx64, m_addr_range.GetBaseAddress().GetOffset()); } else { if (m_size_is_sibling) - s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset()); + s->Printf (", sibling = %5" PRIu64, m_addr_range.GetBaseAddress().GetOffset()); else - s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); + s->Printf (", value = 0x%16.16" PRIx64, m_addr_range.GetBaseAddress().GetOffset()); } if (m_mangled.GetDemangledName()) s->Printf(", name=\"%s\"", m_mangled.GetDemangledName().AsCString()); @@ -251,7 +251,7 @@ Symbol::Dump(Stream *s, Target *target, uint32_t index) const const char *format = m_size_is_sibling ? " Sibling -> [%5llu] 0x%8.8x %s\n": - " 0x%16.16llx 0x%8.8x %s\n"; + " 0x%16.16" PRIx64 " 0x%8.8x %s\n"; s->Printf( format, GetByteSize(), m_flags, @@ -260,8 +260,8 @@ Symbol::Dump(Stream *s, Target *target, uint32_t index) const else { const char *format = m_size_is_sibling ? - "0x%16.16llx Sibling -> [%5llu] 0x%8.8x %s\n": - "0x%16.16llx 0x%16.16llx 0x%8.8x %s\n"; + "0x%16.16" PRIx64 " Sibling -> [%5llu] 0x%8.8x %s\n": + "0x%16.16" PRIx64 " 0x%16.16" PRIx64 " 0x%8.8x %s\n"; s->Printf( format, m_addr_range.GetBaseAddress().GetOffset(), GetByteSize(), diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index f0b5380e708..a47ca5493ae 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -157,7 +157,7 @@ SymbolContext::DumpStopContext if (function_offset) { dumped_something = true; - s->Printf(" + %llu", function_offset); + s->Printf(" + %" PRIu64, function_offset); } } @@ -174,7 +174,7 @@ SymbolContext::DumpStopContext const addr_t inlined_function_offset = addr.GetOffset() - block_range.GetBaseAddress().GetOffset(); if (inlined_function_offset) { - s->Printf(" + %llu", inlined_function_offset); + s->Printf(" + %" PRIu64, inlined_function_offset); } } const Declaration &call_site = inlined_block_info->GetCallSite(); @@ -217,7 +217,7 @@ SymbolContext::DumpStopContext if (symbol_offset) { dumped_something = true; - s->Printf(" + %llu", symbol_offset); + s->Printf(" + %" PRIu64, symbol_offset); } } } @@ -496,7 +496,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, if (log) { - log->Printf ("warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx", + log->Printf ("warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64, curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress()); } #ifdef LLDB_CONFIGURATION_DEBUG @@ -516,7 +516,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, if (objfile) { Host::SystemLog (Host::eSystemLogWarning, - "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx in %s/%s\n", + "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 " in %s/%s\n", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress(), objfile->GetFileSpec().GetDirectory().GetCString(), @@ -525,7 +525,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, else { Host::SystemLog (Host::eSystemLogWarning, - "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx\n", + "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 "\n", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress()); } diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 199c4e625fb..c2d1cddcc36 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -150,7 +150,7 @@ Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name) } else if (m_encoding_uid != LLDB_INVALID_UID) { - s->Printf(", type_uid = 0x%8.8llx", m_encoding_uid); + s->Printf(", type_uid = 0x%8.8" PRIx64, m_encoding_uid); switch (m_encoding_uid_type) { case eEncodingInvalid: break; @@ -257,7 +257,7 @@ Type::DumpValue { s->PutChar('('); if (verbose) - s->Printf("Type{0x%8.8llx} ", GetID()); + s->Printf("Type{0x%8.8" PRIx64 "} ", GetID()); DumpTypeName (s); s->PutCString(") "); } diff --git a/lldb/source/Symbol/UnwindPlan.cpp b/lldb/source/Symbol/UnwindPlan.cpp index 9bccaa8ea8f..c089a7bb8db 100644 --- a/lldb/source/Symbol/UnwindPlan.cpp +++ b/lldb/source/Symbol/UnwindPlan.cpp @@ -164,9 +164,9 @@ UnwindPlan::Row::Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread, const RegisterInfo *reg_info = unwind_plan->GetRegisterInfo (thread, GetCFARegister()); if (base_addr != LLDB_INVALID_ADDRESS) - s.Printf ("0x%16.16llx: CFA=", base_addr + GetOffset()); + s.Printf ("0x%16.16" PRIx64 ": CFA=", base_addr + GetOffset()); else - s.Printf ("0x%8.8llx: CFA=", GetOffset()); + s.Printf ("0x%8.8" PRIx64 ": CFA=", GetOffset()); if (reg_info) s.Printf ("%s", reg_info->name); diff --git a/lldb/source/Symbol/UnwindTable.cpp b/lldb/source/Symbol/UnwindTable.cpp index 7b31120fac4..f128066684f 100644 --- a/lldb/source/Symbol/UnwindTable.cpp +++ b/lldb/source/Symbol/UnwindTable.cpp @@ -140,7 +140,7 @@ UnwindTable::Dump (Stream &s) const_iterator end = m_unwinds.end(); for (const_iterator pos = begin; pos != end; ++pos) { - s.Printf ("[%u] 0x%16.16llx\n", (unsigned)std::distance (begin, pos), pos->first); + s.Printf ("[%u] 0x%16.16" PRIx64 "\n", (unsigned)std::distance (begin, pos), pos->first); } s.EOL(); } |

