Update declarations for all functions/methods that accept printf-style
stdarg formats to use __attribute__ format so the compiler can flag
incorrect uses. Fix all incorrect uses. Most of these are innocuous,
a few were resulting in crashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140185 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBData.cpp b/source/API/SBData.cpp
index cee6316..5859341 100644
--- a/source/API/SBData.cpp
+++ b/source/API/SBData.cpp
@@ -108,7 +108,7 @@
value = m_opaque_sp->GetByteSize();
if (log)
log->Printf ("SBData::GetByteSize () => "
- "(%i)", value);
+ "(%lu)", value);
return value;
}
@@ -187,7 +187,7 @@
}
if (log)
log->Printf ("SBData::GetLongDouble (error=%p,offset=%d) => "
- "(%lf)", error.get(), offset, value);
+ "(%Lf)", error.get(), offset, value);
return value;
}
@@ -297,7 +297,7 @@
}
if (log)
log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%d) => "
- "(%q)", error.get(), offset, value);
+ "(%lld)", error.get(), offset, value);
return value;
}
@@ -385,7 +385,7 @@
}
if (log)
log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%d) => "
- "(%q)", error.get(), offset, value);
+ "(%lld)", error.get(), offset, value);
return value;
}
@@ -453,7 +453,7 @@
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::ReadRawData (error=%p,offset=%d,buf=%p,size=%d) => "
+ log->Printf ("SBData::ReadRawData (error=%p,offset=%d,buf=%p,size=%lu) => "
"(%p)", error.get(), offset, buf, size, ok);
return ok ? size : 0;
}
@@ -471,7 +471,7 @@
else
m_opaque_sp->SetData(buf, size, endian);
if (log)
- log->Printf ("SBData::SetData (error=%p,buf=%p,size=%d,endian=%d,addr_size=%c) => "
+ log->Printf ("SBData::SetData (error=%p,buf=%p,size=%lu,endian=%d,addr_size=%c) => "
"(%p)", error.get(), buf, size, endian, addr_size, m_opaque_sp.get());
}
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 180a5af..c9062bd 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -246,7 +246,7 @@
}
if (log)
- log->Printf ("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %d",
+ log->Printf ("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %lu",
m_opaque_sp.get(),
src,
(uint32_t) src_len,
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 3343b48..5f3716c 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -646,7 +646,7 @@
if (log)
{
- log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (%p, address=%p) => SBBreakpoint(%p)", m_opaque_sp.get(), address, sb_bp.get());
+ log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (address=%llu) => SBBreakpoint(%p)", m_opaque_sp.get(), (uint64_t) address, sb_bp.get());
}
return sb_bp;
diff --git a/source/API/SBThread.cpp b/source/API/SBThread.cpp
index 3f6a751..6b498c1 100644
--- a/source/API/SBThread.cpp
+++ b/source/API/SBThread.cpp
@@ -729,7 +729,7 @@
if (all_in_function)
{
step_file_spec.GetPath (path, sizeof(path));
- sb_error.SetErrorStringWithFormat("No line entries for %s:u", path, line);
+ sb_error.SetErrorStringWithFormat("No line entries for %s:%u", path, line);
}
else
sb_error.SetErrorString ("Step until target not in current function.\n");
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 6fba661..f190585 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -106,7 +106,7 @@
if (name)
log->Printf ("SBValue(%p)::GetName () => \"%s\"", m_opaque_sp.get(), name);
else
- log->Printf ("SBValue(%p)::GetName () => NULL", m_opaque_sp.get(), name);
+ log->Printf ("SBValue(%p)::GetName () => NULL", m_opaque_sp.get());
}
return name;
@@ -357,7 +357,7 @@
if (log)
{
if (result.IsValid())
- log->Printf ("SBValue(%p)::GetChildAtOffset => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp.get());
+ log->Printf ("SBValue(%p)::GetChildAtOffset => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp->GetName().AsCString());
else
log->Printf ("SBValue(%p)::GetChildAtOffset => NULL", m_opaque_sp.get());
}
@@ -391,7 +391,7 @@
if (log)
{
if (result.IsValid())
- log->Printf ("SBValue(%p)::GetChildFromExpression => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp.get());
+ log->Printf ("SBValue(%p)::GetChildFromExpression => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp->GetName().AsCString());
else
log->Printf ("SBValue(%p)::GetChildFromExpression => NULL", m_opaque_sp.get());
}
@@ -433,7 +433,7 @@
if (log)
{
if (result.IsValid())
- log->Printf ("SBValue(%p)::GetChildFromAddress => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp.get());
+ log->Printf ("SBValue(%p)::GetChildFromAddress => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp->GetName().AsCString());
else
log->Printf ("SBValue(%p)::GetChildFromAddress => NULL", m_opaque_sp.get());
}
@@ -463,7 +463,7 @@
if (log)
{
if (result.IsValid())
- log->Printf ("SBValue(%p)::GetChildFromExpression => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp.get());
+ log->Printf ("SBValue(%p)::GetChildFromExpression => \"%s\"", m_opaque_sp.get(), result.m_opaque_sp->GetName().AsCString());
else
log->Printf ("SBValue(%p)::GetChildFromExpression => NULL", m_opaque_sp.get());
}
@@ -541,7 +541,7 @@
if (log)
{
if (idx == UINT32_MAX)
- log->Printf ("SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => NOT FOUND", m_opaque_sp.get(), name, idx);
+ log->Printf ("SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => NOT FOUND", m_opaque_sp.get(), name);
else
log->Printf ("SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => %u", m_opaque_sp.get(), name, idx);
}
diff --git a/source/Breakpoint/BreakpointList.cpp b/source/Breakpoint/BreakpointList.cpp
index ff0738a..4c9fa06 100644
--- a/source/Breakpoint/BreakpointList.cpp
+++ b/source/Breakpoint/BreakpointList.cpp
@@ -154,7 +154,7 @@
BreakpointList::Dump (Stream *s) const
{
Mutex::Locker locker(m_mutex);
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
s->Printf("BreakpointList with %u Breakpoints:\n", (uint32_t)m_breakpoints.size());
s->IndentMore();
diff --git a/source/Breakpoint/BreakpointLocationList.cpp b/source/Breakpoint/BreakpointLocationList.cpp
index f71382f..54824dd 100644
--- a/source/Breakpoint/BreakpointLocationList.cpp
+++ b/source/Breakpoint/BreakpointLocationList.cpp
@@ -123,7 +123,7 @@
void
BreakpointLocationList::Dump (Stream *s) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
//s->Indent();
Mutex::Locker locker (m_mutex);
s->Printf("BreakpointLocationList with %zu BreakpointLocations:\n", m_locations.size());
diff --git a/source/Breakpoint/BreakpointSiteList.cpp b/source/Breakpoint/BreakpointSiteList.cpp
index a8858f7..758521d 100644
--- a/source/Breakpoint/BreakpointSiteList.cpp
+++ b/source/Breakpoint/BreakpointSiteList.cpp
@@ -167,7 +167,7 @@
void
BreakpointSiteList::Dump (Stream *s) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
//s->Indent();
s->Printf("BreakpointSiteList with %u BreakpointSites:\n", (uint32_t)m_bp_site_list.size());
s->IndentMore();
diff --git a/source/Breakpoint/WatchpointLocationList.cpp b/source/Breakpoint/WatchpointLocationList.cpp
index 1664d5b..c39bd58 100644
--- a/source/Breakpoint/WatchpointLocationList.cpp
+++ b/source/Breakpoint/WatchpointLocationList.cpp
@@ -69,7 +69,7 @@
WatchpointLocationList::DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const
{
Mutex::Locker locker (m_mutex);
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
//s->Indent();
s->Printf("WatchpointLocationList with %zu WatchpointLocations:\n",
m_address_to_location.size());
diff --git a/source/Commands/CommandObjectBreakpoint.cpp b/source/Commands/CommandObjectBreakpoint.cpp
index 88a130d..2b9643e 100644
--- a/source/Commands/CommandObjectBreakpoint.cpp
+++ b/source/Commands/CommandObjectBreakpoint.cpp
@@ -885,7 +885,7 @@
{
// No breakpoint selected; enable all currently set breakpoints.
target->EnableAllBreakpoints ();
- result.AppendMessageWithFormat ("All breakpoints enabled. (%d breakpoints)\n", num_breakpoints);
+ result.AppendMessageWithFormat ("All breakpoints enabled. (%lu breakpoints)\n", num_breakpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
@@ -998,7 +998,7 @@
{
// No breakpoint selected; disable all currently set breakpoints.
target->DisableAllBreakpoints ();
- result.AppendMessageWithFormat ("All breakpoints disabled. (%d breakpoints)\n", num_breakpoints);
+ result.AppendMessageWithFormat ("All breakpoints disabled. (%lu breakpoints)\n", num_breakpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
@@ -1301,7 +1301,7 @@
else
{
target->RemoveAllBreakpoints ();
- result.AppendMessageWithFormat ("All breakpoints removed. (%d breakpoints)\n", num_breakpoints);
+ result.AppendMessageWithFormat ("All breakpoints removed. (%lu breakpoints)\n", num_breakpoints);
}
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
diff --git a/source/Commands/CommandObjectMemory.cpp b/source/Commands/CommandObjectMemory.cpp
index 32ac9a2..f6a1846 100644
--- a/source/Commands/CommandObjectMemory.cpp
+++ b/source/Commands/CommandObjectMemory.cpp
@@ -547,7 +547,7 @@
}
else if (m_memory_options.m_count.OptionWasSet())
{
- result.AppendErrorWithFormat("specify either the end address (0x%llx) or the count (--count %u), not both.\n", end_addr, item_count);
+ result.AppendErrorWithFormat("specify either the end address (0x%llx) or the count (--count %lu), not both.\n", end_addr, item_count);
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -572,7 +572,7 @@
}
if (bytes_read < total_byte_size)
- result.AppendWarningWithFormat("Not all bytes (%u/%u) were able to be read from 0x%llx.\n", bytes_read, total_byte_size, addr);
+ result.AppendWarningWithFormat("Not all bytes (%lu/%lu) were able to be read from 0x%llx.\n", bytes_read, total_byte_size, addr);
}
StreamFile outfile_stream;
@@ -1012,7 +1012,7 @@
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
- result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %u byte unsigned integer value.\n", uval64, item_byte_size);
+ result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -1040,7 +1040,7 @@
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
- result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %u byte unsigned integer value.\n", uval64, item_byte_size);
+ result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -1080,7 +1080,7 @@
}
else if (!SIntValueIsValidForSize (sval64, item_byte_size))
{
- result.AppendErrorWithFormat ("Value %lli is too large or small to fit in a %u byte signed integer value.\n", sval64, item_byte_size);
+ result.AppendErrorWithFormat ("Value %lli is too large or small to fit in a %lu byte signed integer value.\n", sval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -1097,7 +1097,7 @@
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
- result.AppendErrorWithFormat ("Value %llu is too large to fit in a %u byte unsigned integer value.\n", uval64, item_byte_size);
+ result.AppendErrorWithFormat ("Value %llu is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -1114,7 +1114,7 @@
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
- result.AppendErrorWithFormat ("Value %llo is too large to fit in a %u byte unsigned integer value.\n", uval64, item_byte_size);
+ result.AppendErrorWithFormat ("Value %llo is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
diff --git a/source/Commands/CommandObjectProcess.cpp b/source/Commands/CommandObjectProcess.cpp
index 2f5c1b2..3145984 100644
--- a/source/Commands/CommandObjectProcess.cpp
+++ b/source/Commands/CommandObjectProcess.cpp
@@ -610,7 +610,7 @@
if (command.GetArgumentCount())
{
- result.AppendErrorWithFormat("Invalid arguments for '%s'.\nUsage: \n", m_cmd_name.c_str(), m_cmd_syntax.c_str());
+ result.AppendErrorWithFormat("Invalid arguments for '%s'.\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
}
else
@@ -733,9 +733,7 @@
}
else
{
- result.AppendErrorWithFormat ("No PID specified for attach\n",
- attach_pid,
- error.AsCString());
+ result.AppendErrorWithFormat ("No PID specified for attach\n");
result.SetStatus (eReturnStatusFailed);
}
@@ -1081,15 +1079,14 @@
}
else
{
- result.AppendErrorWithFormat ("Unable to find process plug-in for remote URL '%s'.\nPlease specify a process plug-in name with the --plugin option, or specify an object file using the \"file\" command: \n",
- m_cmd_name.c_str(),
- m_cmd_syntax.c_str());
+ result.AppendErrorWithFormat ("Unable to find process plug-in for remote URL '%s'.\nPlease specify a process plug-in name with the --plugin option, or specify an object file using the \"file\" command.\n",
+ m_cmd_name.c_str());
result.SetStatus (eReturnStatusFailed);
}
}
else
{
- result.AppendErrorWithFormat ("'%s' takes exactly one argument:\nUsage: \n",
+ result.AppendErrorWithFormat ("'%s' takes exactly one argument:\nUsage: %s\n",
m_cmd_name.c_str(),
m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
@@ -1317,7 +1314,7 @@
}
else
{
- result.AppendErrorWithFormat("'%s' takes exactly one signal number argument:\nUsage: \n", m_cmd_name.c_str(),
+ result.AppendErrorWithFormat("'%s' takes exactly one signal number argument:\nUsage: %s\n", m_cmd_name.c_str(),
m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
}
@@ -1380,7 +1377,7 @@
}
else
{
- result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: \n",
+ result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: %s\n",
m_cmd_name.c_str(),
m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
@@ -1438,7 +1435,7 @@
}
else
{
- result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: \n",
+ result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: %s\n",
m_cmd_name.c_str(),
m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
diff --git a/source/Commands/CommandObjectSource.cpp b/source/Commands/CommandObjectSource.cpp
index e6b98fa..aba27c1 100644
--- a/source/Commands/CommandObjectSource.cpp
+++ b/source/Commands/CommandObjectSource.cpp
@@ -389,7 +389,7 @@
sc_list.GetContextAtIndex (i, scratch_sc);
if (scratch_sc.function != NULL)
{
- s.Printf("\n%d: ", i);
+ s.Printf("\n%lu: ", i);
scratch_sc.function->Dump (&s, true);
}
}
diff --git a/source/Commands/CommandObjectThread.cpp b/source/Commands/CommandObjectThread.cpp
index 612e162..292b963 100644
--- a/source/Commands/CommandObjectThread.cpp
+++ b/source/Commands/CommandObjectThread.cpp
@@ -436,7 +436,7 @@
if (thread == NULL)
{
result.AppendErrorWithFormat ("Thread index %u is out of range (valid values are 0 - %u).\n",
- step_thread_idx, 0, num_threads);
+ step_thread_idx, num_threads);
result.SetStatus (eReturnStatusFailed);
return false;
}
@@ -944,7 +944,6 @@
const uint32_t num_threads = process->GetThreadList().GetSize();
result.AppendErrorWithFormat ("Thread index %u is out of range (valid values are 0 - %u).\n",
m_options.m_thread_idx,
- 0,
num_threads);
result.SetStatus (eReturnStatusFailed);
return false;
@@ -1135,7 +1134,7 @@
}
else if (command.GetArgumentCount() != 1)
{
- result.AppendErrorWithFormat("'%s' takes exactly one thread index argument:\nUsage: \n", m_cmd_name.c_str(), m_cmd_syntax.c_str());
+ result.AppendErrorWithFormat("'%s' takes exactly one thread index argument:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str());
result.SetStatus (eReturnStatusFailed);
return false;
}
diff --git a/source/Commands/CommandObjectType.cpp b/source/Commands/CommandObjectType.cpp
index 6c6b842..45fe0bf 100644
--- a/source/Commands/CommandObjectType.cpp
+++ b/source/Commands/CommandObjectType.cpp
@@ -557,7 +557,7 @@
&error);
if (error.Fail())
{
- out_stream->Printf (error.AsCString());
+ out_stream->Printf ("%s", error.AsCString());
out_stream->Flush();
return;
}
@@ -574,14 +574,14 @@
&error);
if (error.Fail())
{
- out_stream->Printf (error.AsCString());
+ out_stream->Printf ("%s", error.AsCString());
out_stream->Flush();
return;
}
}
else
{
- out_stream->Printf (error.AsCString());
+ out_stream->Printf ("%s", error.AsCString());
out_stream->Flush();
return;
}
diff --git a/source/Core/Address.cpp b/source/Core/Address.cpp
index c07901c..200ef4c 100644
--- a/source/Core/Address.cpp
+++ b/source/Core/Address.cpp
@@ -384,7 +384,7 @@
break;
case DumpStyleSectionPointerOffset:
- s->Printf("(Section *)%.*p + ", (int)sizeof(void*) * 2, m_section);
+ s->Printf("(Section *)%p + ", m_section);
s->Address(m_offset, addr_size);
break;
diff --git a/source/Core/AddressRange.cpp b/source/Core/AddressRange.cpp
index 42b1b20..391f611 100644
--- a/source/Core/AddressRange.cpp
+++ b/source/Core/AddressRange.cpp
@@ -196,7 +196,7 @@
void
AddressRange::DumpDebug (Stream *s) const
{
- s->Printf("%.*p: AddressRange section = %*p, offset = 0x%16.16llx, byte_size = 0x%16.16llx\n", (int)sizeof(void*) * 2, this, (int)sizeof(void*) * 2, m_base_addr.GetSection(), m_base_addr.GetOffset(), GetByteSize());
+ s->Printf("%p: AddressRange section = %p, offset = 0x%16.16llx, byte_size = 0x%16.16llx\n", this, m_base_addr.GetSection(), m_base_addr.GetOffset(), GetByteSize());
}
//
//bool
diff --git a/source/Core/DataExtractor.cpp b/source/Core/DataExtractor.cpp
index 2cfced0..4d5ac71 100644
--- a/source/Core/DataExtractor.cpp
+++ b/source/Core/DataExtractor.cpp
@@ -1414,15 +1414,15 @@
{
switch (ch)
{
- case '\e': s->Printf ("\\e", (uint8_t)ch); break;
- case '\a': s->Printf ("\\a", ch); break;
- case '\b': s->Printf ("\\b", ch); break;
- case '\f': s->Printf ("\\f", ch); break;
- case '\n': s->Printf ("\\n", ch); break;
- case '\r': s->Printf ("\\r", ch); break;
- case '\t': s->Printf ("\\t", ch); break;
- case '\v': s->Printf ("\\v", ch); break;
- case '\0': s->Printf ("\\0", ch); break;
+ case '\e': s->Printf ("\\e"); break;
+ case '\a': s->Printf ("\\a"); break;
+ case '\b': s->Printf ("\\b"); break;
+ case '\f': s->Printf ("\\f"); break;
+ case '\n': s->Printf ("\\n"); break;
+ case '\r': s->Printf ("\\r"); break;
+ case '\t': s->Printf ("\\t"); break;
+ case '\v': s->Printf ("\\v"); break;
+ case '\0': s->Printf ("\\0"); break;
default:
if (item_byte_size == 1)
s->Printf ("\\x%2.2x", ch);
@@ -1492,15 +1492,15 @@
{
switch (ch)
{
- case '\e': s->Printf ("\\e", (uint8_t)ch); break;
- case '\a': s->Printf ("\\a", ch); break;
- case '\b': s->Printf ("\\b", ch); break;
- case '\f': s->Printf ("\\f", ch); break;
- case '\n': s->Printf ("\\n", ch); break;
- case '\r': s->Printf ("\\r", ch); break;
- case '\t': s->Printf ("\\t", ch); break;
- case '\v': s->Printf ("\\v", ch); break;
- case '\0': s->Printf ("\\0", ch); break;
+ case '\e': s->Printf ("\\e"); break;
+ case '\a': s->Printf ("\\a"); break;
+ case '\b': s->Printf ("\\b"); break;
+ case '\f': s->Printf ("\\f"); break;
+ case '\n': s->Printf ("\\n"); break;
+ case '\r': s->Printf ("\\r"); break;
+ case '\t': s->Printf ("\\t"); break;
+ case '\v': s->Printf ("\\v"); break;
+ case '\0': s->Printf ("\\0"); break;
default: s->Printf ("\\x%2.2x", ch); break;
}
}
@@ -1521,7 +1521,7 @@
s->Printf("\"%s\"", cstr);
else
{
- s->Printf("NULL", cstr);
+ s->Printf("NULL");
offset = UINT32_MAX;
}
}
diff --git a/source/Core/Debugger.cpp b/source/Core/Debugger.cpp
index debba81..c101038 100644
--- a/source/Core/Debugger.cpp
+++ b/source/Core/Debugger.cpp
@@ -790,7 +790,7 @@
*index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
*index_higher = *index_lower;
if (log)
- log->Printf("[%d] detected, high index is same", *index_lower);
+ log->Printf("[%lld] detected, high index is same", *index_lower);
}
else if (*close_bracket_position && *close_bracket_position < var_name_end)
{
@@ -798,7 +798,7 @@
*index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
*index_higher = ::strtoul (*separator_position+1, &end, 0);
if (log)
- log->Printf("[%d-%d] detected", *index_lower, *index_higher);
+ log->Printf("[%lld-%lld] detected", *index_lower, *index_higher);
}
else
{
@@ -1267,7 +1267,7 @@
if (!item)
{
if (log)
- log->Printf("ERROR in getting child item at index %d", index_lower);
+ log->Printf("ERROR in getting child item at index %lld", index_lower);
}
else
{
diff --git a/source/Core/Log.cpp b/source/Core/Log.cpp
index f537f1e..2809a93 100644
--- a/source/Core/Log.cpp
+++ b/source/Core/Log.cpp
@@ -100,7 +100,7 @@
if (m_options.Test (LLDB_LOG_OPTION_PREPEND_TIMESTAMP))
{
struct timeval tv = TimeValue::Now().GetAsTimeVal();
- header.Printf ("%9llu.%6.6llu ", tv.tv_sec, tv.tv_usec);
+ header.Printf ("%9ld.%6.6d ", tv.tv_sec, tv.tv_usec);
}
// Add the process and thread if requested
diff --git a/source/Core/Module.cpp b/source/Core/Module.cpp
index d54f969..dc0c55c 100644
--- a/source/Core/Module.cpp
+++ b/source/Core/Module.cpp
@@ -217,7 +217,7 @@
void
Module::DumpSymbolContext(Stream *s)
{
- s->Printf(", Module{0x%8.8x}", this);
+ s->Printf(", Module{%p}", this);
}
uint32_t
diff --git a/source/Core/UserSettingsController.cpp b/source/Core/UserSettingsController.cpp
index 404526b..332652a 100644
--- a/source/Core/UserSettingsController.cpp
+++ b/source/Core/UserSettingsController.cpp
@@ -859,9 +859,7 @@
StreamString value_str;
- if (tmp_value.GetSize() == 0)
- value_str.Printf ("");
- else if (tmp_value.GetSize() == 1)
+ if (tmp_value.GetSize() == 1)
value_str.Printf ("%s", tmp_value.GetStringAtIndex (0));
else
{
diff --git a/source/Expression/ClangFunction.cpp b/source/Expression/ClangFunction.cpp
index a8e5a5c..21acb5b 100644
--- a/source/Expression/ClangFunction.cpp
+++ b/source/Expression/ClangFunction.cpp
@@ -176,7 +176,7 @@
}
else
{
- errors.Printf("Could not determine type of input value %d.", i);
+ errors.Printf("Could not determine type of input value %lu.", i);
return 1;
}
}
@@ -335,7 +335,7 @@
size_t num_args = arg_values.GetSize();
if (num_args != m_arg_values.GetSize())
{
- errors.Printf ("Wrong number of arguments - was: %d should be: %d", num_args, m_arg_values.GetSize());
+ errors.Printf ("Wrong number of arguments - was: %lu should be: %lu", num_args, m_arg_values.GetSize());
return false;
}
diff --git a/source/Expression/ClangUserExpression.cpp b/source/Expression/ClangUserExpression.cpp
index 3e3d9d4..742367f 100644
--- a/source/Expression/ClangUserExpression.cpp
+++ b/source/Expression/ClangUserExpression.cpp
@@ -319,7 +319,7 @@
if (error_cstr && error_cstr[0])
error_stream.Printf ("error: %s\n", error_cstr);
else
- error_stream.Printf ("error: expression can't be interpreted or run\n", num_errors);
+ error_stream.Printf ("error: expression can't be interpreted or run\n");
return false;
}
}
@@ -550,7 +550,7 @@
if (error_desc)
error_stream.Printf ("Execution was interrupted, reason: %s.", error_desc);
else
- error_stream.Printf ("Execution was interrupted.", error_desc);
+ error_stream.Printf ("Execution was interrupted.");
if (discard_on_error)
error_stream.Printf ("\nThe process has been returned to the state before execution.");
diff --git a/source/Expression/ClangUtilityFunction.cpp b/source/Expression/ClangUtilityFunction.cpp
index d079dc4..0d11c91 100644
--- a/source/Expression/ClangUtilityFunction.cpp
+++ b/source/Expression/ClangUtilityFunction.cpp
@@ -173,7 +173,7 @@
if (error_cstr && error_cstr[0])
error_stream.Printf ("error: %s\n", error_cstr);
else
- error_stream.Printf ("error: expression can't be interpreted or run\n", num_errors);
+ error_stream.Printf ("error: expression can't be interpreted or run\n");
return false;
}
}
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index b5cd852..037fbc1 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -310,8 +310,8 @@
case DW_OP_const4s: s->Printf("DW_OP_const4s(0x%8.8x) ", m_data.GetU32(&offset)); break; // 0x0d 1 4-byte constant
case DW_OP_const8u: s->Printf("DW_OP_const8u(0x%16.16llx) ", m_data.GetU64(&offset)); break; // 0x0e 1 8-byte constant
case DW_OP_const8s: s->Printf("DW_OP_const8s(0x%16.16llx) ", m_data.GetU64(&offset)); break; // 0x0f 1 8-byte constant
- case DW_OP_constu: s->Printf("DW_OP_constu(0x%x) ", m_data.GetULEB128(&offset)); break; // 0x10 1 ULEB128 constant
- case DW_OP_consts: s->Printf("DW_OP_consts(0x%x) ", m_data.GetSLEB128(&offset)); break; // 0x11 1 SLEB128 constant
+ case DW_OP_constu: s->Printf("DW_OP_constu(0x%llx) ", m_data.GetULEB128(&offset)); break; // 0x10 1 ULEB128 constant
+ case DW_OP_consts: s->Printf("DW_OP_consts(0x%lld) ", m_data.GetSLEB128(&offset)); break; // 0x11 1 SLEB128 constant
case DW_OP_dup: s->PutCString("DW_OP_dup"); break; // 0x12
case DW_OP_drop: s->PutCString("DW_OP_drop"); break; // 0x13
case DW_OP_over: s->PutCString("DW_OP_over"); break; // 0x14
@@ -330,7 +330,7 @@
case DW_OP_or: s->PutCString("DW_OP_or"); break; // 0x21
case DW_OP_plus: s->PutCString("DW_OP_plus"); break; // 0x22
case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend
- s->Printf("DW_OP_plus_uconst(0x%x) ", m_data.GetULEB128(&offset));
+ s->Printf("DW_OP_plus_uconst(0x%llx) ", m_data.GetULEB128(&offset));
break;
case DW_OP_shl: s->PutCString("DW_OP_shl"); break; // 0x24
@@ -541,7 +541,7 @@
}
break;
case DW_OP_piece: // 0x93 1 ULEB128 size of piece addressed
- s->Printf("DW_OP_piece(0x%x)", m_data.GetULEB128(&offset));
+ s->Printf("DW_OP_piece(0x%llx)", m_data.GetULEB128(&offset));
break;
case DW_OP_deref_size: // 0x94 1 1-byte size of data retrieved
s->Printf("DW_OP_deref_size(0x%2.2x)", m_data.GetU8(&offset));
@@ -568,7 +568,7 @@
// case DW_OP_lo_user: s->PutCString("DW_OP_lo_user"); break; // 0xe0
// case DW_OP_hi_user: s->PutCString("DW_OP_hi_user"); break; // 0xff
case DW_OP_APPLE_extern:
- s->Printf("DW_OP_APPLE_extern(%u)", m_data.GetULEB128(&offset));
+ s->Printf("DW_OP_APPLE_extern(%llu)", m_data.GetULEB128(&offset));
break;
case DW_OP_APPLE_array_ref:
s->PutCString("DW_OP_APPLE_array_ref");
@@ -589,7 +589,7 @@
s->PutCString("DW_OP_APPLE_deref_type");
break;
case DW_OP_APPLE_expr_local: // 0xF5 - ULEB128 expression local index
- s->Printf("DW_OP_APPLE_expr_local(%u)", m_data.GetULEB128(&offset));
+ s->Printf("DW_OP_APPLE_expr_local(%llu)", m_data.GetULEB128(&offset));
break;
case DW_OP_APPLE_constf: // 0xF6 - 1 byte float size, followed by constant float data
{
@@ -1029,7 +1029,7 @@
if (log)
{
size_t count = stack.size();
- log->Printf("Stack before operation has %d values:", count);
+ log->Printf("Stack before operation has %lu values:", count);
for (size_t i=0; i<count; ++i)
{
StreamString new_value;
@@ -2856,7 +2856,7 @@
else if (log)
{
size_t count = stack.size();
- log->Printf("Stack after operation has %d values:", count);
+ log->Printf("Stack after operation has %lu values:", count);
for (size_t i=0; i<count; ++i)
{
StreamString new_value;
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index 4d28c04..6a70d4d 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -1465,7 +1465,7 @@
off_t value_alignment = (ast_context->getTypeAlign(qual_type) + 7) / 8;
if (log)
- log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %d, align %d]",
+ log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %lu, align %lld]",
name.c_str(),
qual_type.getAsString().c_str(),
PrintType(value_type).c_str(),
@@ -1815,7 +1815,7 @@
}
ss.flush();
- log->Printf("Found ConstantFP with size %d and raw data %s", operand_data_size, s.c_str());
+ log->Printf("Found ConstantFP with size %lu and raw data %s", operand_data_size, s.c_str());
}
lldb_private::DataBufferHeap data(operand_data_size, 0);
@@ -2186,7 +2186,7 @@
}
if (log)
- log->Printf(" \"%s\" [\"%s\"] (\"%s\") placed at %d",
+ log->Printf(" \"%s\" [\"%s\"] (\"%s\") placed at %lld",
value->getName().str().c_str(),
name.GetCString(),
PrintValue(value, true).c_str(),
@@ -2225,7 +2225,7 @@
}
if (log)
- log->Printf("Total structure [align %d, size %d]", alignment, size);
+ log->Printf("Total structure [align %lld, size %lu]", alignment, size);
return true;
}
diff --git a/source/Interpreter/CommandObject.cpp b/source/Interpreter/CommandObject.cpp
index afd00c5..ebfbb0f 100644
--- a/source/Interpreter/CommandObject.cpp
+++ b/source/Interpreter/CommandObject.cpp
@@ -600,7 +600,7 @@
str.Printf ("[<%s>]", names.GetData());
break;
case eArgRepeatRange:
- str.Printf ("<%s_1> .. <%s_n>", names.GetData());
+ str.Printf ("<%s_1> .. <%s_n>", names.GetData(), names.GetData());
break;
// Explicitly test for all the rest of the cases, so if new types get added we will notice the
// missing case statement(s).
diff --git a/source/Interpreter/ScriptInterpreterPython.cpp b/source/Interpreter/ScriptInterpreterPython.cpp
index 91fb927..446d677 100644
--- a/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/source/Interpreter/ScriptInterpreterPython.cpp
@@ -204,8 +204,7 @@
PyRun_SimpleString (run_string.GetData());
run_string.Clear();
- run_string.Printf ("run_one_line (%s, 'import gnu_libstdcpp')", m_dictionary_name.c_str(),
- interpreter.GetDebugger().GetID());
+ run_string.Printf ("run_one_line (%s, 'import gnu_libstdcpp')", m_dictionary_name.c_str());
PyRun_SimpleString (run_string.GetData());
if (m_dbg_stdout != NULL)
@@ -629,7 +628,7 @@
if (script_interpreter->m_embedded_python_pty.GetMasterFileDescriptor() != -1)
{
if (log)
- log->Printf ("ScriptInterpreterPython::InputReaderCallback, GotToken, bytes='%s', byte_len = %d", bytes,
+ log->Printf ("ScriptInterpreterPython::InputReaderCallback, GotToken, bytes='%s', byte_len = %lu", bytes,
bytes_len);
if (bytes && bytes_len)
{
@@ -643,7 +642,7 @@
else
{
if (log)
- log->Printf ("ScriptInterpreterPython::InputReaderCallback, GotToken, bytes='%s', byte_len = %d, Master File Descriptor is bad.",
+ log->Printf ("ScriptInterpreterPython::InputReaderCallback, GotToken, bytes='%s', byte_len = %lu, Master File Descriptor is bad.",
bytes,
bytes_len);
reader.SetIsDone (true);
diff --git a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 667c435..e5f6155 100644
--- a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -493,7 +493,7 @@
OSKextLoadedKextSummary::collection kext_summaries;
LogSP log(GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER));
if (log)
- log->Printf ("Adding %d modules.\n");
+ log->Printf ("Adding %d modules.\n", count);
Mutex::Locker locker(m_mutex);
diff --git a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index b051cb0..1060192 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -686,7 +686,7 @@
DYLDImageInfo::collection image_infos;
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER));
if (log)
- log->Printf ("Adding %d modules.\n");
+ log->Printf ("Adding %d modules.\n", image_infos_count);
Mutex::Locker locker(m_mutex);
if (m_process->GetStopID() == m_dyld_image_infos_stop_id)
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 771b00d..ec01909 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -359,11 +359,11 @@
void
ObjectContainerBSDArchive::Dump (Stream *s) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
const size_t num_archs = GetNumArchitectures();
const size_t num_objects = GetNumObjects();
- s->Printf("ObjectContainerBSDArchive, num_archs = %u, num_objects = %u", num_archs, num_objects);
+ s->Printf("ObjectContainerBSDArchive, num_archs = %lu, num_objects = %lu", num_archs, num_objects);
uint32_t i;
ArchSpec arch;
s->IndentMore();
@@ -371,12 +371,12 @@
{
s->Indent();
GetArchitectureAtIndex(i, arch);
- s->Printf("arch[%u] = %s\n", arch.GetArchitectureName());
+ s->Printf("arch[%u] = %s\n", i, arch.GetArchitectureName());
}
for (i=0; i<num_objects; i++)
{
s->Indent();
- s->Printf("object[%u] = %s\n", GetObjectNameAtIndex (i));
+ s->Printf("object[%u] = %s\n", i, GetObjectNameAtIndex (i));
}
s->IndentLess();
s->EOL();
diff --git a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index 218e97e..8c4359f 100644
--- a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -156,11 +156,11 @@
void
ObjectContainerUniversalMachO::Dump (Stream *s) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
const size_t num_archs = GetNumArchitectures();
const size_t num_objects = GetNumObjects();
- s->Printf("ObjectContainerUniversalMachO, num_archs = %u, num_objects = %u", num_archs, num_objects);
+ s->Printf("ObjectContainerUniversalMachO, num_archs = %lu, num_objects = %lu", num_archs, num_objects);
uint32_t i;
ArchSpec arch;
s->IndentMore();
@@ -168,12 +168,12 @@
{
s->Indent();
GetArchitectureAtIndex(i, arch);
- s->Printf("arch[%u] = %s\n", arch.GetArchitectureName());
+ s->Printf("arch[%u] = %s\n", i, arch.GetArchitectureName());
}
for (i=0; i<num_objects; i++)
{
s->Indent();
- s->Printf("object[%u] = %s\n", GetObjectNameAtIndex (i));
+ s->Printf("object[%u] = %s\n", i, GetObjectNameAtIndex (i));
}
s->IndentLess();
s->EOL();
diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 6c55360..1cd8c3b 100644
--- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1161,9 +1161,9 @@
DumpELFHeader_e_type(s, header.e_type);
s->Printf("\ne_machine = 0x%4.4x\n", header.e_machine);
s->Printf("e_version = 0x%8.8x\n", header.e_version);
- s->Printf("e_entry = 0x%8.8lx\n", header.e_entry);
- s->Printf("e_phoff = 0x%8.8lx\n", header.e_phoff);
- s->Printf("e_shoff = 0x%8.8lx\n", header.e_shoff);
+ s->Printf("e_entry = 0x%8.8llx\n", header.e_entry);
+ s->Printf("e_phoff = 0x%8.8llx\n", header.e_phoff);
+ s->Printf("e_shoff = 0x%8.8llx\n", header.e_shoff);
s->Printf("e_flags = 0x%8.8x\n", header.e_flags);
s->Printf("e_ehsize = 0x%4.4x\n", header.e_ehsize);
s->Printf("e_phentsize = 0x%4.4x\n", header.e_phentsize);
@@ -1221,11 +1221,11 @@
ObjectFileELF::DumpELFProgramHeader(Stream *s, const ELFProgramHeader &ph)
{
DumpELFProgramHeader_p_type(s, ph.p_type);
- s->Printf(" %8.8lx %8.8lx %8.8lx", ph.p_offset, ph.p_vaddr, ph.p_paddr);
- s->Printf(" %8.8lx %8.8lx %8.8lx (", ph.p_filesz, ph.p_memsz, ph.p_flags);
+ s->Printf(" %8.8llx %8.8llx %8.8llx", ph.p_offset, ph.p_vaddr, ph.p_paddr);
+ s->Printf(" %8.8llx %8.8llx %8.8x (", ph.p_filesz, ph.p_memsz, ph.p_flags);
DumpELFProgramHeader_p_flags(s, ph.p_flags);
- s->Printf(") %8.8x", ph.p_align);
+ s->Printf(") %8.8llx", ph.p_align);
}
//----------------------------------------------------------------------
@@ -1306,11 +1306,11 @@
{
s->Printf("%8.8x ", sh.sh_name);
DumpELFSectionHeader_sh_type(s, sh.sh_type);
- s->Printf(" %8.8lx (", sh.sh_flags);
+ s->Printf(" %8.8llx (", sh.sh_flags);
DumpELFSectionHeader_sh_flags(s, sh.sh_flags);
- s->Printf(") %8.8lx %8.8lx %8.8lx", sh.sh_addr, sh.sh_offset, sh.sh_size);
+ s->Printf(") %8.8llx %8.8llx %8.8llx", sh.sh_addr, sh.sh_offset, sh.sh_size);
s->Printf(" %8.8x %8.8x", sh.sh_link, sh.sh_info);
- s->Printf(" %8.8lx %8.8lx", sh.sh_addralign, sh.sh_entsize);
+ s->Printf(" %8.8llx %8.8llx", sh.sh_addralign, sh.sh_entsize);
}
//----------------------------------------------------------------------
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 420830d..4788595 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1479,7 +1479,7 @@
ObjectFileMachO::Dump (Stream *s)
{
lldb_private::Mutex::Locker locker(m_mutex);
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
if (m_header.magic == HeaderMagic64 || m_header.magic == HeaderMagic64Swapped)
s->PutCString("ObjectFileMachO64");
diff --git a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 425c668..91b087b 100644
--- a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -656,7 +656,7 @@
ObjectFilePECOFF::Dump(Stream *s)
{
Mutex::Locker locker(m_mutex);
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
s->PutCString("ObjectFilePECOFF");
diff --git a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index 39624dc..ef9e597 100644
--- a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -743,7 +743,7 @@
const addr_t region_addr = packet.GetPointer (&offset);
const uint32_t region_size = packet.GetU32 (&offset);
const uint32_t region_prot = packet.GetU32 (&offset);
- s.Printf("\n\tregion[%i] = { range = [0x%16.16llx - 0x%16.16llx), size = 0x%8.8x, prot = %s }", region_addr, region_addr + region_size, region_size, GetPermissionsAsCString (region_prot));
+ s.Printf("\n\tregion[%llu] = { range = [0x%16.16llx - 0x%16.16llx), size = 0x%8.8x, prot = %s }", region_addr, region_addr, region_addr + region_size, region_size, GetPermissionsAsCString (region_prot));
}
}
break;
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index a37469c..e7fcb92 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -391,7 +391,7 @@
{
success = false;
if (log)
- log->Printf ("error: invalid checksum in packet: '%s'\n", (int)(total_length), m_bytes.c_str());
+ log->Printf ("error: invalid checksum in packet: '%s'\n", m_bytes.c_str());
}
}
m_bytes.erase(0, total_length);
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 0c246f7..1f2ad79 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -245,7 +245,7 @@
else
{
if (log)
- log->Printf("error: failed to send '%*s'", payload_length, payload);
+ log->Printf("error: failed to send '%*s'", (int) payload_length, payload);
}
}
else
@@ -311,13 +311,13 @@
else
{
if (log)
- log->Printf("error: packet mutex taken and send_async == false, not sending packet '%*s'", payload_length, payload);
+ log->Printf("error: packet mutex taken and send_async == false, not sending packet '%*s'", (int) payload_length, payload);
}
}
if (response_len == 0)
{
if (log)
- log->Printf("error: failed to get response for '%*s'", payload_length, payload);
+ log->Printf("error: failed to get response for '%*s'", (int) payload_length, payload);
}
return response_len;
}
@@ -385,7 +385,7 @@
got_stdout = false;
if (log)
- log->Printf ("GDBRemoteCommunicationClient::%s () WaitForPacket(%.*s)", __FUNCTION__);
+ log->Printf ("GDBRemoteCommunicationClient::%s () WaitForPacket(%s)", __FUNCTION__, continue_packet.c_str());
if (WaitForPacketWithTimeoutMicroSeconds (response, UINT32_MAX))
{
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 1fbcf56..8f09fcf 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1737,7 +1737,7 @@
{
LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
if (log)
- log->Printf ("ProcessGDBRemote::%s (&%p[%u]) ...", __FUNCTION__, buf, buf_size);
+ log->Printf ("ProcessGDBRemote::%s (&%p[%lu]) ...", __FUNCTION__, buf, buf_size);
if (bytes_available > buf_size)
{
memcpy(buf, m_stdout_data.c_str(), buf_size);
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 29db0a7..8f73353 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -885,7 +885,7 @@
}
s->Printf("-------- -------- -------- -------------------------------------------\n");
- s->Printf("%7u %8u 100.00% Total for all DIEs\n", total_die_count, total_die_size);
+ s->Printf("%7u %8u 100.00%% Total for all DIEs\n", total_die_count, total_die_size);
float total_category_percentages[kNumTagCategories] =
{
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 22d0d22..152867a 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -1146,7 +1146,7 @@
if (obj_file)
obj_file_name = obj_file->GetFileSpec().GetFilename().AsCString();
const char *die_name = GetName (dwarf2Data, cu);
- s.Printf ("CU: %s OBJFILE: %s DIE: %s (0x%llx).",
+ s.Printf ("CU: %s OBJFILE: %s DIE: %s (0x%x).",
cu_name ? cu_name : "<UNKNOWN>",
obj_file_name ? obj_file_name : "<UNKNOWN>",
die_name ? die_name : "<NO NAME>",
@@ -1215,7 +1215,7 @@
{
case DW_AT_stmt_list:
if ( verbose ) s.PutCString(" ( ");
- s.Printf( "0x%8.8x", form_value.Unsigned());
+ s.Printf( "0x%8.8llx", form_value.Unsigned());
if ( verbose ) s.PutCString(" )");
break;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 675c4bc..05688d4 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -274,7 +274,7 @@
{
dw_uleb128_t addr_offset_n = debug_line_data.GetULEB128(&offset);
dw_uleb128_t addr_offset = addr_offset_n * prologue.min_inst_length;
- log->Printf( "0x%8.8x: DW_LNS_advance_pc (0x%llx)", op_offset, addr_offset);
+ log->Printf( "0x%8.8x: DW_LNS_advance_pc (0x%x)", op_offset, addr_offset);
row.address += addr_offset;
}
break;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
index c07cec4..0aaeb7e 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
@@ -65,7 +65,7 @@
break;
case DW_MACINFO_start_file:
- s->Printf(" line:%u file index: '%s'\n", (uint32_t)m_line, (uint32_t)m_op2.file_idx);
+ s->Printf(" line:%u file index: '%u'\n", (uint32_t)m_line, (uint32_t)m_op2.file_idx);
break;
case DW_MACINFO_end_file:
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index 018b9e0..ac417e5 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -437,7 +437,7 @@
if (verbose)
s.PutCString(" => ");
- s.Printf("{0x%8.8x}", (uvalue + (cu ? cu->GetOffset() : 0)));
+ s.Printf("{0x%8.8llx}", (uvalue + (cu ? cu->GetOffset() : 0)));
}
}
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp
index 8cca445..d1e4d40 100644
--- a/source/Symbol/Block.cpp
+++ b/source/Symbol/Block.cpp
@@ -78,7 +78,7 @@
}
}
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
*s << "Block" << ((const UserID&)*this);
const Block* parent_block = GetParent();
diff --git a/source/Symbol/CompileUnit.cpp b/source/Symbol/CompileUnit.cpp
index 8f51210..d50ad99 100644
--- a/source/Symbol/CompileUnit.cpp
+++ b/source/Symbol/CompileUnit.cpp
@@ -93,7 +93,7 @@
void
CompileUnit::Dump(Stream *s, bool show_context) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
*s << "CompileUnit" << (const UserID&)*this
<< ", language = \"" << (const Language&)*this
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index fd4e15f..85c4839 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -355,7 +355,7 @@
void
Function::Dump(Stream *s, bool show_context) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
*s << "Function" << (const UserID&)*this;
@@ -363,7 +363,7 @@
if (m_type)
{
- s->Printf(", type = %.*p", (int)sizeof(void*) * 2, m_type);
+ s->Printf(", type = %p", m_type);
}
else if (m_type_uid != LLDB_INVALID_UID)
{
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index 23722f6..45a5f52 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -749,15 +749,15 @@
s->Printf ("File: %s", path_str);
if (m_type == eLineStartSpecified)
{
- s->Printf (" from line %d", m_start_line);
+ s->Printf (" from line %lu", m_start_line);
if (m_type == eLineEndSpecified)
- s->Printf ("to line %d", m_end_line);
+ s->Printf ("to line %lu", m_end_line);
else
- s->Printf ("to end", m_end_line);
+ s->Printf ("to end");
}
else if (m_type == eLineEndSpecified)
{
- s->Printf (" from start to line %d", m_end_line);
+ s->Printf (" from start to line %ld", m_end_line);
}
s->Printf (".\n");
}
@@ -765,16 +765,16 @@
if (m_type == eLineStartSpecified)
{
s->Indent();
- s->Printf ("From line %d", m_start_line);
+ s->Printf ("From line %lu", m_start_line);
if (m_type == eLineEndSpecified)
- s->Printf ("to line %d", m_end_line);
+ s->Printf ("to line %lu", m_end_line);
else
- s->Printf ("to end", m_end_line);
+ s->Printf ("to end");
s->Printf (".\n");
}
else if (m_type == eLineEndSpecified)
{
- s->Printf ("From start to line %d.\n", m_end_line);
+ s->Printf ("From start to line %ld.\n", m_end_line);
}
if (m_type == eFunctionSpecified)
diff --git a/source/Symbol/SymbolVendor.cpp b/source/Symbol/SymbolVendor.cpp
index b228780..4c23640 100644
--- a/source/Symbol/SymbolVendor.cpp
+++ b/source/Symbol/SymbolVendor.cpp
@@ -279,7 +279,7 @@
Mutex::Locker locker(m_mutex);
bool show_context = false;
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
s->PutCString("SymbolVendor");
if (m_sym_file_ap.get())
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp
index 6c81cc1..9ce0df9 100644
--- a/source/Symbol/Symtab.cpp
+++ b/source/Symbol/Symtab.cpp
@@ -87,7 +87,7 @@
object_name = m_objfile->GetModule()->GetObjectName().GetCString();
if (file_spec)
- s->Printf("Symtab, file = %s/%s%s%s%s, num_symbols = %u",
+ s->Printf("Symtab, file = %s/%s%s%s%s, num_symbols = %lu",
file_spec.GetDirectory().AsCString(),
file_spec.GetFilename().AsCString(),
object_name ? "(" : "",
@@ -95,7 +95,7 @@
object_name ? ")" : "",
m_symbols.size());
else
- s->Printf("Symtab, num_symbols = %u", m_symbols.size());
+ s->Printf("Symtab, num_symbols = %lu", m_symbols.size());
if (!m_symbols.empty())
{
@@ -169,7 +169,7 @@
const size_t num_symbols = GetNumSymbols();
//s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
- s->Printf("Symtab %u symbol indexes (%u symbols total):\n", indexes.size(), m_symbols.size());
+ s->Printf("Symtab %lu symbol indexes (%lu symbols total):\n", indexes.size(), m_symbols.size());
s->IndentMore();
if (!indexes.empty())
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 46d8700..dbe15ef 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -142,7 +142,7 @@
void
Type::Dump (Stream *s, bool show_context)
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
*s << "Type" << (const UserID&)*this << ' ';
if (m_name)
diff --git a/source/Symbol/UnwindPlan.cpp b/source/Symbol/UnwindPlan.cpp
index 01cb737..2ea11b8 100644
--- a/source/Symbol/UnwindPlan.cpp
+++ b/source/Symbol/UnwindPlan.cpp
@@ -166,7 +166,7 @@
if (base_addr != LLDB_INVALID_ADDRESS)
s.Printf ("0x%16.16llx: CFA=", base_addr + GetOffset());
else
- s.Printf ("0x%8.8x: CFA=", GetOffset());
+ s.Printf ("0x%8.8llx: CFA=", GetOffset());
if (reg_info)
s.Printf ("%s", reg_info->name);
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp
index e752485..d5bba28 100644
--- a/source/Symbol/Variable.cpp
+++ b/source/Symbol/Variable.cpp
@@ -84,7 +84,7 @@
void
Variable::Dump(Stream *s, bool show_context) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ s->Printf("%p: ", this);
s->Indent();
*s << "Variable" << (const UserID&)*this;
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index 417c274..14f26d2 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -167,7 +167,7 @@
}
else
{
- s.Printf ("%-10s %.*-7s ",
+ s.Printf ("%-10s %-7d %s ",
platform->GetUserName (m_euid),
(int)m_arch.GetTriple().getArchName().size(),
m_arch.GetTriple().getArchName().data());
@@ -1107,7 +1107,7 @@
else
{
if (log)
- log->Printf("Process::SetPrivateState (%s) state didn't change. Ignoring...", StateAsCString(new_state), StateAsCString(old_state));
+ log->Printf("Process::SetPrivateState (%s) state didn't change. Ignoring...", StateAsCString(new_state));
}
}
@@ -2682,7 +2682,7 @@
}
if (log)
- log->Printf ("Process::ShouldBroadcastEvent (%p) => %s", event_ptr, StateAsCString(state), return_value ? "YES" : "NO");
+ log->Printf ("Process::ShouldBroadcastEvent (%p) => %s - %s", event_ptr, StateAsCString(state), return_value ? "YES" : "NO");
return return_value;
}
@@ -2830,8 +2830,7 @@
__FUNCTION__,
GetID(),
StateAsCString(new_state),
- StateAsCString (GetState ()),
- IsHijackedForEvent(eBroadcastBitStateChanged) ? "hijacked" : "public");
+ StateAsCString (GetState ()));
}
}
}
diff --git a/source/Target/StackFrameList.cpp b/source/Target/StackFrameList.cpp
index a19106e..3f74781 100644
--- a/source/Target/StackFrameList.cpp
+++ b/source/Target/StackFrameList.cpp
@@ -266,7 +266,7 @@
frame->DumpUsingSettingsFormat (s);
}
else
- s->Printf("frame #%u", std::distance (begin, pos));
+ s->Printf("frame #%ld", std::distance (begin, pos));
s->EOL();
}
s->EOL();
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 7c29da2..e458519 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -1018,7 +1018,7 @@
if (name && name[0] != '\0')
sstr.Printf ("%s", name);
else if ((GetIndexID() != 0) || (GetID() != 0))
- sstr.Printf ("0x%4.4x", GetIndexID(), GetID());
+ sstr.Printf ("0x%4.4x", GetIndexID());
if (sstr.GetSize() > 0)
Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
diff --git a/source/Target/ThreadPlanStepUntil.cpp b/source/Target/ThreadPlanStepUntil.cpp
index 5ad0940..f54bf46 100644
--- a/source/Target/ThreadPlanStepUntil.cpp
+++ b/source/Target/ThreadPlanStepUntil.cpp
@@ -147,7 +147,7 @@
s->Printf ("\n\t0x%llx (bp: %d)", (uint64_t) (*pos).first, (*pos).second);
}
}
- s->Printf(" stepped out address is 0x%lx.", (uint64_t) m_return_addr);
+ s->Printf(" stepped out address is 0x%llx.", (uint64_t) m_return_addr);
}
}
diff --git a/source/Target/ThreadSpec.cpp b/source/Target/ThreadSpec.cpp
index 07abf59..ca47e72 100644
--- a/source/Target/ThreadSpec.cpp
+++ b/source/Target/ThreadSpec.cpp
@@ -104,7 +104,7 @@
else
{
if (GetTID() != LLDB_INVALID_THREAD_ID)
- s->Printf("tid: 0x%llx ", GetTID());
+ s->Printf("tid: 0x%x ", GetTID());
if (GetIndex() != UINT32_MAX)
s->Printf("index: %d ", GetIndex());