diff options
author | Deepak Panickal <deepak@codeplay.com> | 2014-03-03 15:39:47 +0000 |
---|---|---|
committer | Deepak Panickal <deepak@codeplay.com> | 2014-03-03 15:39:47 +0000 |
commit | 99fbc07600b16093ac2875a461a1c086ae1db5ee (patch) | |
tree | caa3aa183d1a4d2acc0021abc38de58c260fb9e7 | |
parent | 6fa32b6f545477a2d539499cb3c8702c3a47f870 (diff) | |
download | llvm-99fbc07600b16093ac2875a461a1c086ae1db5ee.zip llvm-99fbc07600b16093ac2875a461a1c086ae1db5ee.tar.gz llvm-99fbc07600b16093ac2875a461a1c086ae1db5ee.tar.bz2 |
Fix Windows build using portable types for formatting the log outputs
llvm-svn: 202723
39 files changed, 134 insertions, 136 deletions
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp index 06dcfc1..20092c0 100644 --- a/lldb/source/API/SBData.cpp +++ b/lldb/source/API/SBData.cpp @@ -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; diff --git a/lldb/source/API/SBHostOS.cpp b/lldb/source/API/SBHostOS.cpp index 1664031..5f9ba62 100644 --- a/lldb/source/API/SBHostOS.cpp +++ b/lldb/source/API/SBHostOS.cpp @@ -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); } diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 235388b..4eeb48f 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -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, diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index 3b919d1..cbfd055 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -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"); } diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index c20da7f..ce977fa 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -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); } diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index cb7398f..3925768 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -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; } diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index deaf2ab..035fcf9 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -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; } diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 308b72f..3c2d5f1 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -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; diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index e55b2ee..bc8325b 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -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()); diff --git a/lldb/source/Core/DataBufferMemoryMap.cpp b/lldb/source/Core/DataBufferMemoryMap.cpp index 008b736..b385a25 100644 --- a/lldb/source/Core/DataBufferMemoryMap.cpp +++ b/lldb/source/Core/DataBufferMemoryMap.cpp @@ -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()); } } } diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index b42c6ff..4f1c00b3 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -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; diff --git a/lldb/source/Core/Scalar.cpp b/lldb/source/Core/Scalar.cpp index 26f7437..b9dd4f2 100644 --- a/lldb/source/Core/Scalar.cpp +++ b/lldb/source/Core/Scalar.cpp @@ -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; } diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index 64b5a83..dee2f2e 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -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()) diff --git a/lldb/source/Core/Stream.cpp b/lldb/source/Core/Stream.cpp index 49c15d6..075b705 100644 --- a/lldb/source/Core/Stream.cpp +++ b/lldb/source/Core/Stream.cpp @@ -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; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index f58271c..b10f327 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -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. diff --git a/lldb/source/DataFormatters/LibCxx.cpp b/lldb/source/DataFormatters/LibCxx.cpp index 6380d97..585c2e6 100644 --- a/lldb/source/DataFormatters/LibCxx.cpp +++ b/lldb/source/DataFormatters/LibCxx.cpp @@ -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; diff --git a/lldb/source/DataFormatters/LibCxxList.cpp b/lldb/source/DataFormatters/LibCxxList.cpp index e542a98..7d6db1a 100644 --- a/lldb/source/DataFormatters/LibCxxList.cpp +++ b/lldb/source/DataFormatters/LibCxxList.cpp @@ -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)); } diff --git a/lldb/source/DataFormatters/LibCxxMap.cpp b/lldb/source/DataFormatters/LibCxxMap.cpp index 7d5c94f..e665f29 100644 --- a/lldb/source/DataFormatters/LibCxxMap.cpp +++ b/lldb/source/DataFormatters/LibCxxMap.cpp @@ -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)); } diff --git a/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp b/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp index 99cd08e..bf68f20 100644 --- a/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp +++ b/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp @@ -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); diff --git a/lldb/source/DataFormatters/LibStdcpp.cpp b/lldb/source/DataFormatters/LibStdcpp.cpp index 08e7d58..f2d6173 100644 --- a/lldb/source/DataFormatters/LibStdcpp.cpp +++ b/lldb/source/DataFormatters/LibStdcpp.cpp @@ -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; diff --git a/lldb/source/DataFormatters/NSArray.cpp b/lldb/source/DataFormatters/NSArray.cpp index d8ee9bf..7497191 100644 --- a/lldb/source/DataFormatters/NSArray.cpp +++ b/lldb/source/DataFormatters/NSArray.cpp @@ -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())); diff --git a/lldb/source/DataFormatters/NSDictionary.cpp b/lldb/source/DataFormatters/NSDictionary.cpp index f53004d..5ee37f2 100644 --- a/lldb/source/DataFormatters/NSDictionary.cpp +++ b/lldb/source/DataFormatters/NSDictionary.cpp @@ -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); } diff --git a/lldb/source/DataFormatters/NSSet.cpp b/lldb/source/DataFormatters/NSSet.cpp index e6fe2a3..3c7c003 100644 --- a/lldb/source/DataFormatters/NSSet.cpp +++ b/lldb/source/DataFormatters/NSSet.cpp @@ -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; diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index e707c60..6a56970 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -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; } diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 28aa6d0..daff1f2e 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -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; diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index a998896..f64da07 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -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; } diff --git a/lldb/source/Host/windows/EditLineWin.cpp b/lldb/source/Host/windows/EditLineWin.cpp index 2a6e526..d3d029d 100644 --- a/lldb/source/Host/windows/EditLineWin.cpp +++ b/lldb/source/Host/windows/EditLineWin.cpp @@ -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; } diff --git a/lldb/source/Interpreter/CommandHistory.cpp b/lldb/source/Interpreter/CommandHistory.cpp index 33971e39..7744ba9 100644 --- a/lldb/source/Interpreter/CommandHistory.cpp +++ b/lldb/source/Interpreter/CommandHistory.cpp @@ -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()); } } } diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index fb0fc7f7..7a563b7 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -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); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index f92b864..acf415c 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -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; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 32574e3e..70c437b 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -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(); diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index dc90b7a..4418a03 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -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); diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index f1e581f..0a350a2 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -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) diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index 430fc17..b27cd78 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -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()) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 79454b2..4b55f98 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -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(); } diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 309f773..66b6953 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -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; diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 78d3a7e..06814ea 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -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>"); diff --git a/lldb/tools/driver/Platform.cpp b/lldb/tools/driver/Platform.cpp index 5b5286e..f80234f 100644 --- a/lldb/tools/driver/Platform.cpp +++ b/lldb/tools/driver/Platform.cpp @@ -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
\ No newline at end of file +#endif diff --git a/lldb/tools/driver/Platform.h b/lldb/tools/driver/Platform.h index faa2991..6c2f1a2 100644 --- a/lldb/tools/driver/Platform.h +++ b/lldb/tools/driver/Platform.h @@ -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> |