Fix Windows build using portable types for formatting the log outputs

llvm-svn: 202723
This commit is contained in:
Deepak Panickal 2014-03-03 15:39:47 +00:00
parent 6fa32b6f54
commit 99fbc07600
39 changed files with 134 additions and 136 deletions

View File

@ -122,7 +122,7 @@ SBData::GetByteSize ()
value = m_opaque_sp->GetByteSize();
if (log)
log->Printf ("SBData::GetByteSize () => "
"(%zu)", value);
"( %" PRId64 " )", value);
return value;
}
@ -479,7 +479,7 @@ SBData::ReadRawData (lldb::SBError& error,
error.SetErrorString("unable to read data");
}
if (log)
log->Printf ("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%zu) => "
log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%" PRId64 ") => "
"(%p)", error.get(), offset, buf, size, ok);
return ok ? size : 0;
}
@ -497,7 +497,7 @@ SBData::SetData (lldb::SBError& error,
else
m_opaque_sp->SetData(buf, size, endian);
if (log)
log->Printf ("SBData::SetData (error=%p,buf=%p,size=%zu,endian=%d,addr_size=%c) => "
log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRId64 ",endian=%d,addr_size=%c) => "
"(%p)", error.get(), buf, size, endian, addr_size, m_opaque_sp.get());
}
@ -647,7 +647,7 @@ SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len)
if (!array || array_len == 0)
{
if (log)
log->Printf ("SBData::SetDataFromUInt64Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRId64 ") => "
"false", array, array_len);
return false;
}
@ -662,7 +662,7 @@ SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len)
m_opaque_sp->SetData(buffer_sp);
if (log)
log->Printf ("SBData::SetDataFromUInt64Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRId64 ") => "
"true", array, array_len);
return true;
@ -676,7 +676,7 @@ SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len)
if (!array || array_len == 0)
{
if (log)
log->Printf ("SBData::SetDataFromUInt32Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRId64 ") => "
"false", array, array_len);
return false;
}
@ -691,7 +691,7 @@ SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len)
m_opaque_sp->SetData(buffer_sp);
if (log)
log->Printf ("SBData::SetDataFromUInt32Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRId64 ") => "
"true", array, array_len);
return true;
@ -705,7 +705,7 @@ SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len)
if (!array || array_len == 0)
{
if (log)
log->Printf ("SBData::SetDataFromSInt64Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRId64 ") => "
"false", array, array_len);
return false;
}
@ -720,7 +720,7 @@ SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len)
m_opaque_sp->SetData(buffer_sp);
if (log)
log->Printf ("SBData::SetDataFromSInt64Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRId64 ") => "
"true", array, array_len);
return true;
@ -734,7 +734,7 @@ SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len)
if (!array || array_len == 0)
{
if (log)
log->Printf ("SBData::SetDataFromSInt32Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRId64 ") => "
"false", array, array_len);
return false;
}
@ -749,7 +749,7 @@ SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len)
m_opaque_sp->SetData(buffer_sp);
if (log)
log->Printf ("SBData::SetDataFromSInt32Array (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRId64 ") => "
"true", array, array_len);
return true;
@ -763,7 +763,7 @@ SBData::SetDataFromDoubleArray (double* array, size_t array_len)
if (!array || array_len == 0)
{
if (log)
log->Printf ("SBData::SetDataFromDoubleArray (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRId64 ") => "
"false", array, array_len);
return false;
}
@ -778,7 +778,7 @@ SBData::SetDataFromDoubleArray (double* array, size_t array_len)
m_opaque_sp->SetData(buffer_sp);
if (log)
log->Printf ("SBData::SetDataFromDoubleArray (array=%p, array_len = %zu) => "
log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRId64 ") => "
"true", array, array_len);
return true;

View File

@ -42,7 +42,7 @@ lldb::thread_t
SBHostOS::ThreadCreate
(
const char *name,
thread_func_t thread_function,
lldb::thread_func_t thread_function,
void *thread_arg,
SBError *error_ptr
)
@ -77,7 +77,7 @@ SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr)
}
bool
SBHostOS::ThreadJoin (lldb::thread_t thread, thread_result_t *result, SBError *error_ptr)
SBHostOS::ThreadJoin (lldb::thread_t thread, lldb::thread_result_t *result, SBError *error_ptr)
{
return Host::ThreadJoin (thread, result, error_ptr ? error_ptr->get() : NULL);
}

View File

@ -338,7 +338,7 @@ SBProcess::PutSTDIN (const char *src, size_t src_len)
}
if (log)
log->Printf ("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %zu",
log->Printf("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %" PRId64,
process_sp.get(),
src,
(uint32_t) src_len,

View File

@ -255,7 +255,7 @@ CommandObjectArgs::DoExecute (Args& args, CommandReturnObject &result)
for (arg_index = 0; arg_index < num_args; ++arg_index)
{
result.GetOutputStream ().Printf ("%zu (%s): ", arg_index, args.GetArgumentAtIndex (arg_index));
result.GetOutputStream ().Printf ("%" PRIu64 " (%s): ", (uint64_t)arg_index, args.GetArgumentAtIndex (arg_index));
value_list.GetValueAtIndex (arg_index)->Dump (&result.GetOutputStream ());
result.GetOutputStream ().Printf("\n");
}

View File

@ -1078,7 +1078,7 @@ protected:
{
// No breakpoint selected; enable all currently set breakpoints.
target->EnableAllBreakpoints ();
result.AppendMessageWithFormat ("All breakpoints enabled. (%zu breakpoints)\n", num_breakpoints);
result.AppendMessageWithFormat ("All breakpoints enabled. (%" PRId64 " breakpoints)\n", num_breakpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
@ -1197,7 +1197,7 @@ protected:
{
// No breakpoint selected; disable all currently set breakpoints.
target->DisableAllBreakpoints ();
result.AppendMessageWithFormat ("All breakpoints disabled. (%zu breakpoints)\n", num_breakpoints);
result.AppendMessageWithFormat ("All breakpoints disabled. (%" PRId64 " breakpoints)\n", num_breakpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
@ -1699,7 +1699,7 @@ protected:
else
{
target->RemoveAllBreakpoints ();
result.AppendMessageWithFormat ("All breakpoints removed. (%zu %s)\n", num_breakpoints, num_breakpoints > 1 ? "breakpoints" : "breakpoint");
result.AppendMessageWithFormat ("All breakpoints removed. (%" PRId64 " %s)\n", num_breakpoints, num_breakpoints > 1 ? "breakpoints" : "breakpoint");
}
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}

View File

@ -651,7 +651,7 @@ protected:
}
else if (m_format_options.GetCountValue().OptionWasSet())
{
result.AppendErrorWithFormat("specify either the end address (0x%" PRIx64 ") or the count (--count %zu), not both.\n", end_addr, item_count);
result.AppendErrorWithFormat("specify either the end address (0x%" PRIx64 ") or the count (--count %" PRId64 "), not both.\n", end_addr, item_count);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -708,7 +708,7 @@ protected:
}
if (bytes_read < total_byte_size)
result.AppendWarningWithFormat("Not all bytes (%zu/%zu) were able to be read from 0x%" PRIx64 ".\n", bytes_read, total_byte_size, addr);
result.AppendWarningWithFormat("Not all bytes (%" PRId64 "/%" PRId64 ") were able to be read from 0x%" PRIx64 ".\n", bytes_read, total_byte_size, addr);
}
else
{
@ -878,7 +878,7 @@ protected:
// here we passed a count, and it was not 1
// so we have a byte_size and a count
// we could well multiply those, but instead let's just fail
result.AppendErrorWithFormat("reading memory as characters of size %zu is not supported", item_byte_size);
result.AppendErrorWithFormat("reading memory as characters of size %" PRId64 " is not supported", item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -1536,7 +1536,7 @@ protected:
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
result.AppendErrorWithFormat ("Value 0x%" PRIx64 " is too large to fit in a %zu byte unsigned integer value.\n", uval64, item_byte_size);
result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -1564,7 +1564,7 @@ protected:
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
result.AppendErrorWithFormat ("Value 0x%" PRIx64 " is too large to fit in a %zu byte unsigned integer value.\n", uval64, item_byte_size);
result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -1604,7 +1604,7 @@ protected:
}
else if (!SIntValueIsValidForSize (sval64, item_byte_size))
{
result.AppendErrorWithFormat ("Value %" PRIi64 " is too large or small to fit in a %zu byte signed integer value.\n", sval64, item_byte_size);
result.AppendErrorWithFormat ("Value %" PRIi64 " is too large or small to fit in a %" PRId64 " byte signed integer value.\n", sval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -1621,7 +1621,7 @@ protected:
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
result.AppendErrorWithFormat ("Value %" PRIu64 " is too large to fit in a %zu byte unsigned integer value.\n", uval64, item_byte_size);
result.AppendErrorWithFormat ("Value %" PRIu64 " is too large to fit in a %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}
@ -1638,7 +1638,7 @@ protected:
}
else if (!UIntValueIsValidForSize (uval64, item_byte_size))
{
result.AppendErrorWithFormat ("Value %" PRIo64 " is too large to fit in a %zu byte unsigned integer value.\n", uval64, item_byte_size);
result.AppendErrorWithFormat ("Value %" PRIo64 " is too large to fit in a %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size);
result.SetStatus(eReturnStatusFailed);
return false;
}

View File

@ -202,7 +202,7 @@ protected:
}
else
{
result.AppendErrorWithFormat ("invalid register set index: %zu\n", set_idx);
result.AppendErrorWithFormat("invalid register set index: %" PRIu64 "\n", (uint64_t)set_idx);
result.SetStatus (eReturnStatusFailed);
break;
}

View File

@ -1763,7 +1763,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter,
if (num_matches)
{
strm.Indent ();
strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
strm.Printf("%" PRIu64 " match%s found in ", (uint64_t)num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
@ -1794,7 +1794,7 @@ LookupTypeInModule (CommandInterpreter &interpreter,
if (num_matches)
{
strm.Indent ();
strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
strm.Printf("%" PRIu64 " match%s found in ", (uint64_t)num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
for (TypeSP type_sp : type_list.Types())
@ -2200,7 +2200,7 @@ protected:
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
result.GetOutputStream().Printf("Dumping symbol table for %zu modules.\n", num_modules);
result.GetOutputStream().Printf("Dumping symbol table for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (num_dumped > 0)
@ -2333,7 +2333,7 @@ protected:
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
result.GetOutputStream().Printf("Dumping sections for %zu modules.\n", num_modules);
result.GetOutputStream().Printf("Dumping sections for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
num_dumped++;
@ -2441,7 +2441,7 @@ protected:
const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
result.GetOutputStream().Printf("Dumping debug symbols for %zu modules.\n", num_modules);
result.GetOutputStream().Printf("Dumping debug symbols for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (DumpModuleSymbolVendor (result.GetOutputStream(), target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
@ -3402,9 +3402,9 @@ protected:
ref_count = module_sp.use_count() - 1;
}
if (width)
strm.Printf("{%*zu}", width, ref_count);
strm.Printf("{%*" PRIu64 "}", width, ref_count);
else
strm.Printf("{%zu}", ref_count);
strm.Printf("{%" PRIu64 "}", (uint64_t)ref_count);
}
break;

View File

@ -397,7 +397,7 @@ protected:
{
// No watchpoint selected; enable all currently set watchpoints.
target->EnableAllWatchpoints();
result.AppendMessageWithFormat("All watchpoints enabled. (%zu watchpoints)\n", num_watchpoints);
result.AppendMessageWithFormat("All watchpoints enabled. (%" PRId64 " watchpoints)\n", num_watchpoints);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
else
@ -476,7 +476,7 @@ protected:
// No watchpoint selected; disable all currently set watchpoints.
if (target->DisableAllWatchpoints())
{
result.AppendMessageWithFormat("All watchpoints disabled. (%zu watchpoints)\n", num_watchpoints);
result.AppendMessageWithFormat("All watchpoints disabled. (%" PRId64 " watchpoints)\n", num_watchpoints);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
else
@ -564,7 +564,7 @@ protected:
else
{
target->RemoveAllWatchpoints();
result.AppendMessageWithFormat("All watchpoints removed. (%zu watchpoints)\n", num_watchpoints);
result.AppendMessageWithFormat("All watchpoints removed. (%" PRId64 " watchpoints)\n", num_watchpoints);
}
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
@ -706,7 +706,7 @@ protected:
if (command.GetArgumentCount() == 0)
{
target->IgnoreAllWatchpoints(m_options.m_ignore_count);
result.AppendMessageWithFormat("All watchpoints ignored. (%zu watchpoints)\n", num_watchpoints);
result.AppendMessageWithFormat("All watchpoints ignored. (%" PRId64 " watchpoints)\n", num_watchpoints);
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
else
@ -1099,7 +1099,7 @@ protected:
}
else
{
result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%zu, variable expression='%s').\n",
result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRId64 ", variable expression='%s').\n",
addr, size, command.GetArgumentAtIndex(0));
if (error.AsCString(NULL))
result.AppendError(error.AsCString());
@ -1308,7 +1308,7 @@ protected:
}
else
{
result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%zu).\n",
result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRId64 ").\n",
addr, size);
if (error.AsCString(NULL))
result.AppendError(error.AsCString());

View File

@ -89,7 +89,7 @@ DataBufferMemoryMap::Clear()
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP));
if (log)
log->Printf("DataBufferMemoryMap::Clear() m_mmap_addr = %p, m_mmap_size = %zu", m_mmap_addr, m_mmap_size);
log->Printf("DataBufferMemoryMap::Clear() m_mmap_addr = %p, m_mmap_size = %" PRIu64 "", m_mmap_addr, (uint64_t)m_mmap_size);
#ifdef _WIN32
UnmapViewOfFile(m_mmap_addr);
#else
@ -311,8 +311,8 @@ DataBufferMemoryMap::MemoryMapFromFileDescriptor (int fd,
if (log)
{
log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec() m_mmap_addr = %p, m_mmap_size = %zu, error = %s",
m_mmap_addr, m_mmap_size, error.AsCString());
log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec() m_mmap_addr = %p, m_mmap_size = %" PRIu64 ", error = %s",
m_mmap_addr, (uint64_t)m_mmap_size, error.AsCString());
}
}
}

View File

@ -1516,7 +1516,7 @@ DataExtractor::Dump (Stream *s,
s->Printf ("%s", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset) ? "true" : "false");
else
{
s->Printf("error: unsupported byte size (%zu) for boolean format", item_byte_size);
s->Printf("error: unsupported byte size (%" PRIu64 ") for boolean format", (uint64_t)item_byte_size);
return offset;
}
break;
@ -1725,7 +1725,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
s->Printf("error: unsupported byte size (%zu) for complex integer format", item_byte_size);
s->Printf("error: unsupported byte size (%" PRIu64 ") for complex integer format", (uint64_t)item_byte_size);
return offset;
}
}
@ -1757,7 +1757,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
s->Printf("error: unsupported byte size (%zu) for complex float format", item_byte_size);
s->Printf("error: unsupported byte size (%" PRIu64 ") for complex float format", (uint64_t)item_byte_size);
return offset;
}
break;
@ -1909,7 +1909,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
s->Printf("error: unsupported byte size (%zu) for float format", item_byte_size);
s->Printf("error: unsupported byte size (%" PRIu64 ") for float format", (uint64_t)item_byte_size);
return offset;
}
ss.flush();
@ -1973,7 +1973,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
s->Printf("error: unsupported byte size (%zu) for hex float format", item_byte_size);
s->Printf("error: unsupported byte size (%" PRIu64 ") for hex float format", (uint64_t)item_byte_size);
return offset;
}
break;

View File

@ -1794,7 +1794,7 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t by
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string value", value_str);
else if (!UIntValueIsValidForSize (uval64, byte_size))
error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte unsigned integer value", uval64, byte_size);
error.SetErrorStringWithFormat("value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte unsigned integer value", uval64, (uint64_t)byte_size);
else
{
m_type = Scalar::GetValueTypeForUnsignedIntegerWithByteSize (byte_size);
@ -1804,14 +1804,14 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t by
case e_ulong: m_data.ulong = (ulong_t)uval64; break;
case e_ulonglong: m_data.ulonglong = (ulonglong_t)uval64; break;
default:
error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported unsigned integer byte size: %" PRIu64 "", (uint64_t)byte_size);
break;
}
}
}
else
{
error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported unsigned integer byte size: %" PRIu64 "", (uint64_t)byte_size);
return error;
}
break;
@ -1823,7 +1823,7 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t by
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid signed integer string value", value_str);
else if (!SIntValueIsValidForSize (sval64, byte_size))
error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte signed integer value", sval64, byte_size);
error.SetErrorStringWithFormat("value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte signed integer value", sval64, (uint64_t)byte_size);
else
{
m_type = Scalar::GetValueTypeForSignedIntegerWithByteSize (byte_size);
@ -1833,14 +1833,14 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t by
case e_slong: m_data.slong = (slong_t)sval64; break;
case e_slonglong: m_data.slonglong = (slonglong_t)sval64; break;
default:
error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported signed integer byte size: %" PRIu64 "", (uint64_t)byte_size);
break;
}
}
}
else
{
error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported signed integer byte size: %" PRIu64 "", (uint64_t)byte_size);
return error;
}
break;
@ -1869,7 +1869,7 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t by
}
else
{
error.SetErrorStringWithFormat ("unsupported float byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported float byte size: %" PRIu64 "", (uint64_t)byte_size);
return error;
}
break;
@ -1908,7 +1908,7 @@ Scalar::SetValueFromData (DataExtractor &data, lldb::Encoding encoding, size_t b
case 4: operator=((uint32_t)data.GetU32(&offset)); break;
case 8: operator=((uint64_t)data.GetU64(&offset)); break;
default:
error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported unsigned integer byte size: %" PRIu64 "", (uint64_t)byte_size);
break;
}
}
@ -1924,7 +1924,7 @@ Scalar::SetValueFromData (DataExtractor &data, lldb::Encoding encoding, size_t b
case 4: operator=((int32_t)data.GetU32(&offset)); break;
case 8: operator=((int64_t)data.GetU64(&offset)); break;
default:
error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported signed integer byte size: %" PRIu64 "", (uint64_t)byte_size);
break;
}
}
@ -1940,7 +1940,7 @@ Scalar::SetValueFromData (DataExtractor &data, lldb::Encoding encoding, size_t b
else if (byte_size == sizeof (long double))
operator=((long double)data.GetLongDouble(&offset));
else
error.SetErrorStringWithFormat ("unsupported float byte size: %zu", byte_size);
error.SetErrorStringWithFormat("unsupported float byte size: %" PRIu64 "", (uint64_t)byte_size);
}
break;
}

View File

@ -592,7 +592,7 @@ SearchFilterByModuleList::GetDescription (Stream *s)
}
else
{
s->Printf (", modules(%zu) = ", num_modules);
s->Printf(", modules(%" PRIu64 ") = ", (uint64_t)num_modules);
for (size_t i = 0; i < num_modules; i++)
{
if (s->GetVerbose())

View File

@ -479,7 +479,7 @@ Stream::PrintfAsRawHex8 (const char *format, ...)
va_list args;
va_list args_copy;
va_start (args, format);
va_copy (args, args_copy); // Copy this so we
va_copy (args_copy,args); // Copy this so we
char str[1024];
size_t bytes_written = 0;

View File

@ -1708,7 +1708,7 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
break;
case eValueObjectRepresentationStyleChildrenCount:
strm.Printf("%zu", GetNumChildren());
strm.Printf("%" PRIu64 "", (uint64_t)GetNumChildren());
cstr = strm.GetString().c_str();
break;
@ -2064,7 +2064,7 @@ ValueObject::GetSyntheticArrayMemberFromPointer (size_t index, bool can_create)
if (IsPointerType ())
{
char index_str[64];
snprintf(index_str, sizeof(index_str), "[%zu]", index);
snprintf(index_str, sizeof(index_str), "[%" PRIu64 "]", (uint64_t)index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.
@ -2107,7 +2107,7 @@ ValueObject::GetSyntheticArrayMemberFromArray (size_t index, bool can_create)
if (IsArrayType ())
{
char index_str[64];
snprintf(index_str, sizeof(index_str), "[%zu]", index);
snprintf(index_str, sizeof(index_str), "[%" PRIu64 "]", (uint64_t)index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.

View File

@ -143,9 +143,7 @@ lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::GetChildAtIndex (si
DataBufferSP buffer_sp(new DataBufferHeap(m_bool_type.GetByteSize(),0));
if (bit_set && buffer_sp && buffer_sp->GetBytes())
*(buffer_sp->GetBytes()) = 1; // regardless of endianness, anything non-zero is true
StreamString name; name.Printf("[%zu]",idx);
DataExtractor data(buffer_sp, process_sp->GetByteOrder(), process_sp->GetAddressByteSize());
retval_sp = ValueObject::CreateValueObjectFromData(name.GetData(), data, m_exe_ctx_ref, m_bool_type);
StreamString name; name.Printf("[%" PRIu64 "]", (uint64_t)idx);
if (retval_sp)
m_children[idx] = retval_sp;
return retval_sp;
@ -499,7 +497,7 @@ lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::GetChildAtIndex (siz
uint64_t offset = idx * m_element_size;
offset = offset + m_start->GetValueAsUnsigned(0);
StreamString name;
name.Printf("[%zu]",idx);
name.Printf("[%" PRIu64 "]", (uint64_t)idx);
ValueObjectSP child_sp = ValueObject::CreateValueObjectFromAddress(name.GetData(), offset, m_backend.GetExecutionContextRef(), m_element_type);
m_children[idx] = child_sp;
return child_sp;

View File

@ -263,7 +263,7 @@ lldb_private::formatters::LibcxxStdListSyntheticFrontEnd::GetChildAtIndex (size_
return lldb::ValueObjectSP();
StreamString name;
name.Printf("[%zu]",idx);
name.Printf("[%" PRIu64 "]", (uint64_t)idx);
return (m_children[idx] = ValueObject::CreateValueObjectFromData(name.GetData(), data, m_backend.GetExecutionContextRef(), m_element_type));
}

View File

@ -374,7 +374,7 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex (size_t
return lldb::ValueObjectSP();
}
StreamString name;
name.Printf("[%zu]",idx);
name.Printf("[%" PRIu64 "]", (uint64_t)idx);
return (m_children[idx] = ValueObject::CreateValueObjectFromData(name.GetData(), data, m_backend.GetExecutionContextRef(), m_element_type));
}

View File

@ -81,7 +81,7 @@ lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::GetChildAtInde
if (!val_hash.first)
return lldb::ValueObjectSP();
StreamString stream;
stream.Printf("[%zu]",idx);
stream.Printf("[%" PRIu64 "]", (uint64_t)idx);
DataExtractor data;
Error error;
val_hash.first->GetData(data, error);

View File

@ -93,7 +93,7 @@ lldb_private::formatters::LibstdcppVectorBoolSyntheticFrontEnd::GetChildAtIndex
target.EvaluateExpression("(bool)true", NULL, retval_sp);
else
target.EvaluateExpression("(bool)false", NULL, retval_sp);
StreamString name; name.Printf("[%zu]",idx);
StreamString name; name.Printf("[%" PRIu64 "]", (uint64_t)idx);
if (retval_sp)
retval_sp->SetName(ConstString(name.GetData()));
return retval_sp;

View File

@ -128,7 +128,7 @@ lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (size_t idx
pyhs_idx -= (m_data_32 ? m_data_32->_size : m_data_64->_size);
object_at_idx += (pyhs_idx * m_ptr_size);
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(),
object_at_idx,
m_exe_ctx_ref,
@ -278,7 +278,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (size_t idx
if (error.Fail())
return lldb::ValueObjectSP();
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(), object_at_idx, m_exe_ctx_ref, m_id_type);
m_children.push_back(retval_sp);
return retval_sp;
@ -342,7 +342,7 @@ lldb::ValueObjectSP
lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
lldb::ValueObjectSP valobj_sp = CallSelectorOnObject(m_backend,"id","objectAtIndex:",idx);
if (valobj_sp)
valobj_sp->SetName(ConstString(idx_name.GetData()));

View File

@ -210,9 +210,9 @@ lldb::ValueObjectSP
lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
StreamString key_fetcher_expr;
key_fetcher_expr.Printf("(id)[(NSArray*)[(id)0x%" PRIx64 " allKeys] objectAtIndex:%zu]",m_backend.GetPointerValue(),idx);
key_fetcher_expr.Printf("(id)[(NSArray*)[(id)0x%" PRIx64 " allKeys] objectAtIndex:%" PRIu64 "]", m_backend.GetPointerValue(), (uint64_t)idx);
StreamString value_fetcher_expr;
value_fetcher_expr.Printf("(id)[(id)0x%" PRIx64 " objectForKey:(%s)]",m_backend.GetPointerValue(),key_fetcher_expr.GetData());
StreamString object_fetcher_expr;
@ -403,7 +403,7 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (size_
}
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
DataExtractor data(buffer_sp, m_order, m_ptr_size);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromData(idx_name.GetData(), data, m_exe_ctx_ref, m_pair_type);
}
@ -567,7 +567,7 @@ lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (size_
}
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
DataExtractor data(buffer_sp, m_order, m_ptr_size);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromData(idx_name.GetData(), data, m_exe_ctx_ref, m_pair_type);
}

View File

@ -305,7 +305,7 @@ lldb_private::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex (size_t idx)
assert(false && "pointer size is not 4 nor 8 - get out of here ASAP");
}
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
DataExtractor data(buffer.GetBytes(),
buffer.GetByteSize(),
@ -473,7 +473,7 @@ lldb_private::formatters::NSSetMSyntheticFrontEnd::GetChildAtIndex (size_t idx)
assert(false && "pointer size is not 4 nor 8 - get out of here ASAP");
}
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
DataExtractor data(buffer.GetBytes(),
buffer.GetByteSize(),
@ -519,7 +519,7 @@ lldb_private::formatters::NSOrderedSetSyntheticFrontEnd::GetChildAtIndex (size_t
if (retval_sp)
{
StreamString idx_name;
idx_name.Printf("[%zu]",idx);
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
retval_sp->SetName(ConstString(idx_name.GetData()));
}
m_children[idx] = retval_sp;

View File

@ -173,7 +173,7 @@ ClangFunction::CompileFunction (Stream &errors)
}
else
{
errors.Printf("Could not determine type of input value %zu.", i);
errors.Printf("Could not determine type of input value %" PRId64 ".", i);
return 1;
}
}
@ -344,7 +344,7 @@ ClangFunction::WriteFunctionArguments (ExecutionContext &exe_ctx,
size_t num_args = arg_values.GetSize();
if (num_args != m_arg_values.GetSize())
{
errors.Printf ("Wrong number of arguments - was: %zu should be: %zu", num_args, m_arg_values.GetSize());
errors.Printf ("Wrong number of arguments - was: %" PRId64 " should be: %" PRId64 "", num_args, m_arg_values.GetSize());
return false;
}

View File

@ -1363,7 +1363,7 @@ DWARFExpression::Evaluate
if (log && log->GetVerbose())
{
size_t count = stack.size();
log->Printf("Stack before operation has %zu values:", count);
log->Printf("Stack before operation has %" PRId64 " values:", count);
for (size_t i=0; i<count; ++i)
{
StreamString new_value;
@ -2832,7 +2832,7 @@ DWARFExpression::Evaluate
else if (log && log->GetVerbose())
{
size_t count = stack.size();
log->Printf("Stack after operation has %zu values:", count);
log->Printf("Stack after operation has %" PRId64 " values:", count);
for (size_t i=0; i<count; ++i)
{
StreamString new_value;

View File

@ -2016,7 +2016,7 @@ IRForTarget::ReplaceStaticLiterals (llvm::BasicBlock &basic_block)
}
ss.flush();
log->Printf("Found ConstantFP with size %zu and raw data %s", operand_data_size, s.c_str());
log->Printf("Found ConstantFP with size %" PRId64 " and raw data %s", operand_data_size, s.c_str());
}
lldb_private::DataBufferHeap data(operand_data_size, 0);
@ -2479,7 +2479,7 @@ IRForTarget::ReplaceVariables (Function &llvm_function)
}
if (log)
log->Printf("Total structure [align %" PRId64 ", size %zu]", alignment, size);
log->Printf("Total structure [align %" PRId64 ", size %" PRId64 "]", alignment, size);
return true;
}

View File

@ -317,8 +317,6 @@ el_set (EditLine *el, int code, ...)
clientData = va_arg(vl, void*);
}
break;
// default:
// assert( !"Not Implemented!" );
}
return 0;
}
@ -326,7 +324,7 @@ el_set (EditLine *el, int code, ...)
void
el_end (EditLine *el)
{
assert( !"Not implemented!" );
//assert( !"Not implemented!" );
}
void
@ -345,7 +343,6 @@ el_getc (EditLine *, char *)
void
el_push (EditLine *, const char *)
{
// assert( !"Not implemented!" );
}
void
@ -398,7 +395,6 @@ el_resize (EditLine *)
const LineInfo *
el_line (EditLine *el)
{
assert( !"Not implemented!" );
return 0;
}
@ -425,14 +421,14 @@ history_init (void)
void
history_end (History *)
{
assert( !"Not implemented!" );
// assert( !"Not implemented!" );
}
int
history (History *, HistEvent *, int op, ...)
{
// perform operation 'op' on the history list with optional argumetns as needed by
// the operation.
// perform operation 'op' on the history list with
// optional arguments as needed by the operation.
return 0;
}

View File

@ -137,7 +137,7 @@ CommandHistory::Dump (Stream& stream,
if (!hist_item.empty())
{
stream.Indent();
stream.Printf ("%4zu: %s\n", counter, hist_item.c_str());
stream.Printf("%4" PRId64 ": %s\n", counter, hist_item.c_str());
}
}
}

View File

@ -2494,16 +2494,16 @@ CommandInterpreter::HandleCommands (const StringList &commands,
error_msg = "<unknown error>.\n";
if (stop_on_error)
{
result.AppendErrorWithFormat("Aborting reading of commands after command #%zu: '%s' failed with %s",
idx, cmd, error_msg);
result.AppendErrorWithFormat("Aborting reading of commands after command #%" PRIu64 ": '%s' failed with %s",
(uint64_t)idx, cmd, error_msg);
result.SetStatus (eReturnStatusFailed);
m_debugger.SetAsyncExecution (old_async_execution);
return;
}
else if (print_results)
{
result.AppendMessageWithFormat ("Command #%zu '%s' failed with %s",
idx + 1,
result.AppendMessageWithFormat ("Command #%" PRIu64 " '%s' failed with %s",
(uint64_t)idx + 1,
cmd,
error_msg);
}
@ -2527,10 +2527,10 @@ CommandInterpreter::HandleCommands (const StringList &commands,
// status in our real result before returning. This is an error if the continue was not the
// last command in the set of commands to be run.
if (idx != num_lines - 1)
result.AppendErrorWithFormat("Aborting reading of commands after command #%zu: '%s' continued the target.\n",
idx + 1, cmd);
result.AppendErrorWithFormat("Aborting reading of commands after command #%" PRIu64 ": '%s' continued the target.\n",
(uint64_t)idx + 1, cmd);
else
result.AppendMessageWithFormat ("Command #%zu '%s' continued the target.\n", idx + 1, cmd);
result.AppendMessageWithFormat("Command #%" PRIu64 " '%s' continued the target.\n", (uint64_t)idx + 1, cmd);
result.SetStatus(tmp_result.GetStatus());
m_debugger.SetAsyncExecution (old_async_execution);

View File

@ -204,7 +204,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
uint32_t idx = 0;
DEBUG_PRINTF ("objc_opt_ro_ptr = %p\n", objc_opt_ro_ptr);
DEBUG_PRINTF ("class_infos_ptr = %p\n", class_infos_ptr);
DEBUG_PRINTF ("class_infos_byte_size = %u (%zu class infos)\n", class_infos_byte_size, (size_t)(class_infos_byte_size/sizeof(ClassInfo)));
DEBUG_PRINTF ("class_infos_byte_size = %u (%" PRIu64 " class infos)\n", class_infos_byte_size, (size_t)(class_infos_byte_size/sizeof(ClassInfo)));
if (objc_opt_ro_ptr)
{
const objc_opt_t *objc_opt = (objc_opt_t *)objc_opt_ro_ptr;

View File

@ -461,7 +461,7 @@ ObjectContainerBSDArchive::Dump (Stream *s) const
s->Indent();
const size_t num_archs = GetNumArchitectures();
const size_t num_objects = GetNumObjects();
s->Printf("ObjectContainerBSDArchive, num_archs = %zu, num_objects = %zu", num_archs, num_objects);
s->Printf("ObjectContainerBSDArchive, num_archs = %" PRId64 ", num_objects = %" PRId64 "", num_archs, num_objects);
uint32_t i;
ArchSpec arch;
s->IndentMore();

View File

@ -632,10 +632,10 @@ DynamicRegisterInfo::Dump () const
{
StreamFile s(stdout, false);
const size_t num_regs = m_regs.size();
s.Printf("%p: DynamicRegisterInfo contains %zu registers:\n", this, num_regs);
s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " registers:\n", this, (uint64_t)num_regs);
for (size_t i=0; i<num_regs; ++i)
{
s.Printf("[%3zu] name = %-10s", i, m_regs[i].name);
s.Printf("[%3" PRId64 "] name = %-10s", i, m_regs[i].name);
s.Printf(", size = %2u, offset = %4u, encoding = %u, format = %-10s",
m_regs[i].byte_size,
m_regs[i].byte_offset,
@ -673,10 +673,10 @@ DynamicRegisterInfo::Dump () const
}
const size_t num_sets = m_sets.size();
s.Printf("%p: DynamicRegisterInfo contains %zu register sets:\n", this, num_sets);
s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " register sets:\n", this, (uint64_t)num_sets);
for (size_t i=0; i<num_sets; ++i)
{
s.Printf("set[%zu] name = %s, regs = [", i, m_sets[i].name);
s.Printf("set[%" PRIu64 "] name = %s, regs = [", (uint64_t)i, m_sets[i].name);
for (size_t idx=0; idx<m_sets[i].num_registers; ++idx)
{
s.Printf("%s ", m_regs[m_sets[i].registers[idx]].name);

View File

@ -910,15 +910,15 @@ SymbolContextSpecifier::GetDescription (Stream *s, lldb::DescriptionLevel level)
s->Printf ("File: %s", path_str);
if (m_type == eLineStartSpecified)
{
s->Printf (" from line %zu", m_start_line);
s->Printf (" from line %" PRId64 "", m_start_line);
if (m_type == eLineEndSpecified)
s->Printf ("to line %zu", m_end_line);
s->Printf ("to line %" PRId64 "", m_end_line);
else
s->Printf ("to end");
}
else if (m_type == eLineEndSpecified)
{
s->Printf (" from start to line %zu", m_end_line);
s->Printf (" from start to line %" PRId64 "", m_end_line);
}
s->Printf (".\n");
}
@ -926,16 +926,16 @@ SymbolContextSpecifier::GetDescription (Stream *s, lldb::DescriptionLevel level)
if (m_type == eLineStartSpecified)
{
s->Indent();
s->Printf ("From line %zu", m_start_line);
s->Printf ("From line %" PRId64 "", m_start_line);
if (m_type == eLineEndSpecified)
s->Printf ("to line %zu", m_end_line);
s->Printf ("to line %" PRId64 "", m_end_line);
else
s->Printf ("to end");
s->Printf (".\n");
}
else if (m_type == eLineEndSpecified)
{
s->Printf ("From start to line %zu.\n", m_end_line);
s->Printf ("From start to line %" PRId64 ".\n", m_end_line);
}
if (m_type == eFunctionSpecified)

View File

@ -90,14 +90,14 @@ Symtab::Dump (Stream *s, Target *target, SortOrder sort_order)
object_name = m_objfile->GetModule()->GetObjectName().GetCString();
if (file_spec)
s->Printf("Symtab, file = %s%s%s%s, num_symbols = %zu",
s->Printf("Symtab, file = %s%s%s%s, num_symbols = %" PRId64 "",
file_spec.GetPath().c_str(),
object_name ? "(" : "",
object_name ? object_name : "",
object_name ? ")" : "",
m_symbols.size());
else
s->Printf("Symtab, num_symbols = %zu", m_symbols.size());
s->Printf("Symtab, num_symbols = %" PRId64 "", m_symbols.size());
if (!m_symbols.empty())
{
@ -166,7 +166,7 @@ Symtab::Dump(Stream *s, Target *target, std::vector<uint32_t>& indexes) const
const size_t num_symbols = GetNumSymbols();
//s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
s->Printf("Symtab %zu symbol indexes (%zu symbols total):\n", indexes.size(), m_symbols.size());
s->Printf("Symtab %" PRId64 " symbol indexes (%" PRId64 " symbols total):\n", indexes.size(), m_symbols.size());
s->IndentMore();
if (!indexes.empty())

View File

@ -635,7 +635,7 @@ Target::CreateWatchpoint(lldb::addr_t addr, size_t size, const ClangASTType *typ
if (!CheckIfWatchpointsExhausted(this, error))
{
if (!OptionGroupWatchpoint::IsWatchSizeSupported(size))
error.SetErrorStringWithFormat("watch size of %zu is not supported", size);
error.SetErrorStringWithFormat("watch size of %" PRId64 " is not supported", size);
}
wp_sp.reset();
}

View File

@ -443,8 +443,8 @@ ThreadPlanStepRange::NextRangeBreakpointExplainsStop (lldb::StopInfoSP stop_info
}
}
if (log)
log->Printf ("ThreadPlanStepRange::NextRangeBreakpointExplainsStop - Hit next range breakpoint which has %zu owners - explains stop: %u.",
num_owners,
log->Printf ("ThreadPlanStepRange::NextRangeBreakpointExplainsStop - Hit next range breakpoint which has %" PRIu64 " owners - explains stop: %u.",
(uint64_t)num_owners,
explains_stop);
ClearNextBranchBreakpoint();
return explains_stop;

View File

@ -1032,6 +1032,12 @@ sigcont_handler (int signo)
int
main (int argc, char const *argv[], const char *envp[])
{
#ifdef _MSC_VER
// disable buffering on windows
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stdin , NULL, _IONBF, 0);
#endif
SBDebugger::Initialize();
SBHostOS::ThreadCreated ("<lldb.driver.main-thread>");

View File

@ -15,10 +15,6 @@
#include "Platform.h"
// index one of the variable arguments
// presuming "(EditLine *el, ..." is first in the argument list
#define GETARG( Y, X ) ( (void* ) *( ( (int**) &(Y) ) + (X) ) )
// the control handler or SIGINT handler
static sighandler_t _ctrlHandler = NULL;
@ -42,14 +38,16 @@ ioctl (int d, int request, ...)
// request the console windows size
case ( TIOCGWINSZ ):
{
// locate the window size structure on stack
winsize *ws = (winsize*) GETARG( d, 2 );
va_list vl;
va_start(vl,request);
// locate the window size structure on stack
winsize *ws = va_arg(vl, winsize*);
// get screen buffer information
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &info );
// fill in the columns
ws->ws_col = info.dwMaximumWindowSize.X;
//
if ( GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &info ) == TRUE )
// fill in the columns
ws->ws_col = info.dwMaximumWindowSize.X;
va_end(vl);
return 0;
}
break;
@ -108,4 +106,4 @@ signal (int sig, sighandler_t sigFunc)
return 0;
}
#endif
#endif

View File

@ -10,6 +10,8 @@
#ifndef lldb_Platform_h_
#define lldb_Platform_h_
#include "lldb/Host/HostGetOpt.h"
#if defined( _MSC_VER )
// this will stop signal.h being included
@ -19,7 +21,6 @@
#include <eh.h>
#include <inttypes.h>
#include "lldb/Host/windows/Windows.h"
#include "lldb/Host/HostGetOpt.h"
struct timeval
{
@ -91,7 +92,6 @@
#include <inttypes.h>
#include <getopt.h>
#include <libgen.h>
#include <sys/ioctl.h>
#include <termios.h>