diff options
author | Greg Clayton <gclayton@apple.com> | 2014-03-03 19:15:20 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-03-03 19:15:20 +0000 |
commit | 6fea17e8740b0c0687e0f945a3dd19eea32ec8e9 (patch) | |
tree | 68ec1ece80c357f12891d4c6c9c74f9b7443eee1 | |
parent | e6d398189e81533427e5ec0d6602310f67747603 (diff) | |
download | bcm5719-llvm-6fea17e8740b0c0687e0f945a3dd19eea32ec8e9.tar.gz bcm5719-llvm-6fea17e8740b0c0687e0f945a3dd19eea32ec8e9.zip |
"size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed.
If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64.
llvm-svn: 202738
20 files changed, 202 insertions, 159 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index f1281e30c4c..e42d89bd628 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -1419,7 +1419,7 @@ class Process : public PluginInterface { friend class ClangFunction; // For WaitForStateChangeEventsPrivate - friend class Debugger; // For PopProcessIOHandler + friend class Debugger; // For PopProcessIOHandler and ProcessIOHandlerIsActive friend class ProcessEventData; friend class StopInfo; friend class Target; @@ -3875,6 +3875,9 @@ protected: bool PopProcessIOHandler (); + bool + ProcessIOHandlerIsActive (); + Error HaltForDestroyOrDetach(lldb::EventSP &exit_event_sp); diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp index 20092c0e0e1..a284d02aaab 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 () => " - "( %" PRId64 " )", value); + "( %" PRIu64 " )", (uint64_t)value); return value; } @@ -479,8 +479,8 @@ SBData::ReadRawData (lldb::SBError& error, error.SetErrorString("unable to read data"); } if (log) - log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%" PRId64 ") => " - "(%p)", error.get(), offset, buf, size, ok); + log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%" PRIu64 ") => " + "(%p)", error.get(), offset, buf, (uint64_t)size, ok); return ok ? size : 0; } @@ -497,8 +497,8 @@ SBData::SetData (lldb::SBError& error, else m_opaque_sp->SetData(buf, size, endian); if (log) - 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()); + log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64 ",endian=%d,addr_size=%c) => " + "(%p)", error.get(), buf, (uint64_t)size, endian, addr_size, m_opaque_sp.get()); } bool @@ -647,8 +647,8 @@ SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len) if (!array || array_len == 0) { if (log) - log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRId64 ") => " - "false", array, array_len); + log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => " + "false", array, (uint64_t)array_len); return false; } @@ -662,8 +662,8 @@ 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 = %" PRId64 ") => " - "true", array, array_len); + log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => " + "true", array, (uint64_t)array_len); return true; } @@ -676,8 +676,8 @@ SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len) if (!array || array_len == 0) { if (log) - log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRId64 ") => " - "false", array, array_len); + log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => " + "false", array, (uint64_t)array_len); return false; } @@ -691,8 +691,8 @@ 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 = %" PRId64 ") => " - "true", array, array_len); + log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => " + "true", array, (uint64_t)array_len); return true; } @@ -705,8 +705,8 @@ SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len) if (!array || array_len == 0) { if (log) - log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRId64 ") => " - "false", array, array_len); + log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => " + "false", array, (uint64_t)array_len); return false; } @@ -720,8 +720,8 @@ 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 = %" PRId64 ") => " - "true", array, array_len); + log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => " + "true", array, (uint64_t)array_len); return true; } @@ -734,8 +734,8 @@ SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len) if (!array || array_len == 0) { if (log) - log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRId64 ") => " - "false", array, array_len); + log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => " + "false", array, (uint64_t)array_len); return false; } @@ -749,8 +749,8 @@ 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 = %" PRId64 ") => " - "true", array, array_len); + log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => " + "true", array, (uint64_t)array_len); return true; } @@ -763,8 +763,8 @@ SBData::SetDataFromDoubleArray (double* array, size_t array_len) if (!array || array_len == 0) { if (log) - log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRId64 ") => " - "false", array, array_len); + log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => " + "false", array, (uint64_t)array_len); return false; } @@ -778,8 +778,8 @@ SBData::SetDataFromDoubleArray (double* array, size_t array_len) m_opaque_sp->SetData(buffer_sp); if (log) - log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRId64 ") => " - "true", array, array_len); + log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => " + "true", array, (uint64_t)array_len); return true; } diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 4eeb48f3c25..47a6ee48cf3 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -338,11 +338,11 @@ SBProcess::PutSTDIN (const char *src, size_t src_len) } if (log) - log->Printf("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %" PRId64, + log->Printf("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%" PRIu64 ") => %" PRIu64, process_sp.get(), src, - (uint32_t) src_len, - ret_val); + (uint64_t) src_len, + (uint64_t) ret_val); return ret_val; } diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index ce977fac4e3..ad4e6a83bcf 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. (%" PRId64 " breakpoints)\n", num_breakpoints); + result.AppendMessageWithFormat ("All breakpoints enabled. (%" PRIu64 " breakpoints)\n", (uint64_t)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. (%" PRId64 " breakpoints)\n", num_breakpoints); + result.AppendMessageWithFormat ("All breakpoints disabled. (%" PRIu64 " breakpoints)\n", (uint64_t)num_breakpoints); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -1699,7 +1699,7 @@ protected: else { target->RemoveAllBreakpoints (); - result.AppendMessageWithFormat ("All breakpoints removed. (%" PRId64 " %s)\n", num_breakpoints, num_breakpoints > 1 ? "breakpoints" : "breakpoint"); + result.AppendMessageWithFormat ("All breakpoints removed. (%" PRIu64 " breakpoint%s)\n", (uint64_t)num_breakpoints, num_breakpoints > 1 ? "s" : ""); } result.SetStatus (eReturnStatusSuccessFinishNoResult); } diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 3925768eb17..58c0bfcdccb 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 %" PRId64 "), not both.\n", end_addr, item_count); + result.AppendErrorWithFormat("specify either the end address (0x%" PRIx64 ") or the count (--count %" PRIu64 "), not both.\n", end_addr, (uint64_t)item_count); result.SetStatus(eReturnStatusFailed); return false; } @@ -708,7 +708,7 @@ protected: } if (bytes_read < total_byte_size) - result.AppendWarningWithFormat("Not all bytes (%" PRId64 "/%" PRId64 ") were able to be read from 0x%" PRIx64 ".\n", bytes_read, total_byte_size, addr); + result.AppendWarningWithFormat("Not all bytes (%" PRIu64 "/%" PRIu64 ") were able to be read from 0x%" PRIx64 ".\n", (uint64_t)bytes_read, (uint64_t)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 %" PRId64 " is not supported", item_byte_size); + result.AppendErrorWithFormat("reading memory as characters of size %" PRIu64 " is not supported", (uint64_t)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 %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size); + result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)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 %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size); + result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)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 %" PRId64 " byte signed integer value.\n", sval64, item_byte_size); + result.AppendErrorWithFormat ("Value %" PRIi64 " is too large or small to fit in a %" PRIu64 " byte signed integer value.\n", sval64, (uint64_t)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 %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size); + result.AppendErrorWithFormat ("Value %" PRIu64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)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 %" PRId64 " byte unsigned integer value.\n", uval64, item_byte_size); + result.AppendErrorWithFormat ("Value %" PRIo64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)item_byte_size); result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 3c2d5f113eb..16ce7ee32d8 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -3402,7 +3402,7 @@ protected: ref_count = module_sp.use_count() - 1; } if (width) - strm.Printf("{%*" PRIu64 "}", width, ref_count); + strm.Printf("{%*" PRIu64 "}", width, (uint64_t)ref_count); else strm.Printf("{%" PRIu64 "}", (uint64_t)ref_count); } diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index bc8325bcec7..d61c174ff2e 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. (%" PRId64 " watchpoints)\n", num_watchpoints); + result.AppendMessageWithFormat("All watchpoints enabled. (%" PRIu64 " watchpoints)\n", (uint64_t)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. (%" PRId64 " watchpoints)\n", num_watchpoints); + result.AppendMessageWithFormat("All watchpoints disabled. (%" PRIu64 " watchpoints)\n", (uint64_t)num_watchpoints); result.SetStatus(eReturnStatusSuccessFinishNoResult); } else @@ -564,7 +564,7 @@ protected: else { target->RemoveAllWatchpoints(); - result.AppendMessageWithFormat("All watchpoints removed. (%" PRId64 " watchpoints)\n", num_watchpoints); + result.AppendMessageWithFormat("All watchpoints removed. (%" PRIu64 " watchpoints)\n", (uint64_t)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. (%" PRId64 " watchpoints)\n", num_watchpoints); + result.AppendMessageWithFormat("All watchpoints ignored. (%" PRIu64 " watchpoints)\n", (uint64_t)num_watchpoints); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -1099,8 +1099,8 @@ protected: } else { - result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRId64 ", variable expression='%s').\n", - addr, size, command.GetArgumentAtIndex(0)); + result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRIu64 ", variable expression='%s').\n", + addr, (uint64_t)size, command.GetArgumentAtIndex(0)); if (error.AsCString(NULL)) result.AppendError(error.AsCString()); result.SetStatus(eReturnStatusFailed); @@ -1308,8 +1308,8 @@ protected: } else { - result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRId64 ").\n", - addr, size); + result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%" PRIu64 ").\n", + addr, (uint64_t)size); if (error.AsCString(NULL)) result.AppendError(error.AsCString()); result.SetStatus(eReturnStatusFailed); diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index aaacd6e26ca..064f278fb69 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -2959,7 +2959,10 @@ Debugger::HandleProcessEvent (const EventSP &event_sp) if (output_stream.GetSize() || error_stream.GetSize()) { StreamFileSP error_stream_sp (GetOutputFile()); - bool top_io_handler_hid = HideTopIOHandler(); + bool top_io_handler_hid = false; + + if (process_sp->ProcessIOHandlerIsActive() == false) + top_io_handler_hid = HideTopIOHandler(); if (output_stream.GetSize()) { diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index d5758c09b1e..6ce76dc825b 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -131,16 +131,16 @@ namespace lldb { Module::Module (const ModuleSpec &module_spec) : m_mutex (Mutex::eMutexTypeRecursive), - m_mod_time (module_spec.GetFileSpec().GetModificationTime()), - m_arch (module_spec.GetArchitecture()), + m_mod_time (), + m_arch (), m_uuid (), - m_file (module_spec.GetFileSpec()), - m_platform_file(module_spec.GetPlatformFileSpec()), + m_file (), + m_platform_file(), m_remote_install_file(), - m_symfile_spec (module_spec.GetSymbolFileSpec()), - m_object_name (module_spec.GetObjectName()), - m_object_offset (module_spec.GetObjectOffset()), - m_object_mod_time (module_spec.GetObjectModificationTime()), + m_symfile_spec (), + m_object_name (), + m_object_offset (), + m_object_mod_time (), m_objfile_sp (), m_symfile_ap (), m_ast (), @@ -163,11 +163,40 @@ Module::Module (const ModuleSpec &module_spec) : if (log) log->Printf ("%p Module::Module((%s) '%s%s%s%s')", this, - m_arch.GetArchitectureName(), - m_file.GetPath().c_str(), - m_object_name.IsEmpty() ? "" : "(", - m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""), - m_object_name.IsEmpty() ? "" : ")"); + module_spec.GetArchitecture().GetArchitectureName(), + module_spec.GetFileSpec().GetPath().c_str(), + module_spec.GetObjectName().IsEmpty() ? "" : "(", + module_spec.GetObjectName().IsEmpty() ? "" : module_spec.GetObjectName().AsCString(""), + module_spec.GetObjectName().IsEmpty() ? "" : ")"); + + // First extract all module specifications from the file using the local + // file path. If there are no specifications, then don't fill anything in + ModuleSpecList modules_specs; + if (ObjectFile::GetModuleSpecifications(module_spec.GetFileSpec(), 0, 0, modules_specs) == 0) + return; + + // Now make sure that one of the module specifications matches what we just + // extract. We might have a module specification that specifies a file "/usr/lib/dyld" + // with UUID XXX, but we might have a local version of "/usr/lib/dyld" that has + // UUID YYY and we don't want those to match. If they don't match, just don't + // fill any ivars in so we don't accidentally grab the wrong file later since + // they don't match... + ModuleSpec matching_module_spec; + if (modules_specs.FindMatchingModuleSpec(module_spec, matching_module_spec) == 0) + return; + m_mod_time = module_spec.GetFileSpec().GetModificationTime(); + if (module_spec.GetArchitecture().IsValid()) + m_arch = module_spec.GetArchitecture(); + else + m_arch = matching_module_spec.GetArchitecture(); + m_mod_time = module_spec.GetFileSpec().GetModificationTime(); + m_file = module_spec.GetFileSpec(); + m_platform_file = module_spec.GetPlatformFileSpec(); + m_symfile_spec = module_spec.GetSymbolFileSpec(); + m_object_name = module_spec.GetObjectName(); + m_object_offset = module_spec.GetObjectOffset(); + m_object_mod_time = module_spec.GetObjectModificationTime(); + } Module::Module(const FileSpec& file_spec, diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index 6a56970373f..1085acf35ad 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 %" PRId64 ".", i); + errors.Printf("Could not determine type of input value %" PRIu64 ".", (uint64_t)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: %" PRId64 " should be: %" PRId64 "", num_args, m_arg_values.GetSize()); + errors.Printf ("Wrong number of arguments - was: %" PRIu64 " should be: %" PRIu64 "", (uint64_t)num_args, (uint64_t)m_arg_values.GetSize()); return false; } diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index daff1f2ef42..e5821f50f79 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 %" PRId64 " values:", count); + log->Printf("Stack before operation has %" PRIu64 " values:", (uint64_t)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 %" PRId64 " values:", count); + log->Printf("Stack after operation has %" PRIu64 " values:", (uint64_t)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 f64da07f0c2..6de244648a2 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 %" PRId64 " and raw data %s", operand_data_size, s.c_str()); + log->Printf("Found ConstantFP with size %" PRIu64 " and raw data %s", (uint64_t)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 %" PRId64 "]", alignment, size); + log->Printf("Total structure [align %" PRId64 ", size %" PRIu64 "]", (int64_t)alignment, (uint64_t)size); return true; } diff --git a/lldb/source/Interpreter/CommandHistory.cpp b/lldb/source/Interpreter/CommandHistory.cpp index 7744ba95a7b..07ba6f14c28 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("%4" PRId64 ": %s\n", counter, hist_item.c_str()); + stream.Printf("%4" PRIu64 ": %s\n", (uint64_t)counter, hist_item.c_str()); } } } diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 70c437b58be..105a87d2b01 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 = %" PRId64 ", num_objects = %" PRId64 "", num_archs, num_objects); + s->Printf("ObjectContainerBSDArchive, num_archs = %" PRIu64 ", num_objects = %" PRIu64 "", (uint64_t)num_archs, (uint64_t)num_objects); uint32_t i; ArchSpec arch; s->IndentMore(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 3ff620da840..8c18af92f97 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -305,100 +305,100 @@ PlatformDarwin::GetSharedModuleWithLocalCache (const lldb_private::ModuleSpec &m module_spec.GetSymbolFileSpec().GetFilename().AsCString()); std::string cache_path(GetLocalCacheDirectory()); - std::string module_path (module_spec.GetFileSpec().GetPath()); - cache_path.append(module_path); - FileSpec module_cache_spec(cache_path.c_str(),false); - - // if rsync is supported, always bring in the file - rsync will be very efficient - // when files are the same on the local and remote end of the connection - if (this->GetSupportsRSync()) - { - Error err = BringInRemoteFile (this, module_spec, module_cache_spec); - if (err.Fail()) - return err; - if (module_cache_spec.Exists()) - { - Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) - log->Printf("[%s] module %s/%s was rsynced and is now there", - (IsHost() ? "host" : "remote"), - module_spec.GetFileSpec().GetDirectory().AsCString(), - module_spec.GetFileSpec().GetFilename().AsCString()); - ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); - module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); - return Error(); - } - } - - if (module_spec.GetFileSpec().Exists() && !module_sp) + // Only search for a locally cached file if we have a valid cache path + if (!cache_path.empty()) { - module_sp.reset(new Module(module_spec)); - return Error(); - } + std::string module_path (module_spec.GetFileSpec().GetPath()); + cache_path.append(module_path); + FileSpec module_cache_spec(cache_path.c_str(),false); - // try to find the module in the cache - if (module_cache_spec.Exists()) - { - // get the local and remote MD5 and compare - if (m_remote_platform_sp) + // if rsync is supported, always bring in the file - rsync will be very efficient + // when files are the same on the local and remote end of the connection + if (this->GetSupportsRSync()) { - // when going over the *slow* GDB remote transfer mechanism we first check - // the hashes of the files - and only do the actual transfer if they differ - uint64_t high_local,high_remote,low_local,low_remote; - Host::CalculateMD5 (module_cache_spec, low_local, high_local); - m_remote_platform_sp->CalculateMD5(module_spec.GetFileSpec(), low_remote, high_remote); - if (low_local != low_remote || high_local != high_remote) + Error err = BringInRemoteFile (this, module_spec, module_cache_spec); + if (err.Fail()) + return err; + if (module_cache_spec.Exists()) { - // bring in the remote file Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); if (log) - log->Printf("[%s] module %s/%s needs to be replaced from remote copy", + log->Printf("[%s] module %s/%s was rsynced and is now there", (IsHost() ? "host" : "remote"), module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); - Error err = BringInRemoteFile (this, module_spec, module_cache_spec); - if (err.Fail()) - return err; + ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); + module_sp.reset(new Module(local_spec)); + module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); + return Error(); } } - ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); - module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); - Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); - if (log) - log->Printf("[%s] module %s/%s was found in the cache", - (IsHost() ? "host" : "remote"), - module_spec.GetFileSpec().GetDirectory().AsCString(), - module_spec.GetFileSpec().GetFilename().AsCString()); - return Error(); - } - - // bring in the remote module file - if (log) - log->Printf("[%s] module %s/%s needs to come in remotely", - (IsHost() ? "host" : "remote"), - module_spec.GetFileSpec().GetDirectory().AsCString(), - module_spec.GetFileSpec().GetFilename().AsCString()); - Error err = BringInRemoteFile (this, module_spec, module_cache_spec); - if (err.Fail()) - return err; - if (module_cache_spec.Exists()) - { - Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); + // try to find the module in the cache + if (module_cache_spec.Exists()) + { + // get the local and remote MD5 and compare + if (m_remote_platform_sp) + { + // when going over the *slow* GDB remote transfer mechanism we first check + // the hashes of the files - and only do the actual transfer if they differ + uint64_t high_local,high_remote,low_local,low_remote; + Host::CalculateMD5 (module_cache_spec, low_local, high_local); + m_remote_platform_sp->CalculateMD5(module_spec.GetFileSpec(), low_remote, high_remote); + if (low_local != low_remote || high_local != high_remote) + { + // bring in the remote file + Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); + if (log) + log->Printf("[%s] module %s/%s needs to be replaced from remote copy", + (IsHost() ? "host" : "remote"), + module_spec.GetFileSpec().GetDirectory().AsCString(), + module_spec.GetFileSpec().GetFilename().AsCString()); + Error err = BringInRemoteFile (this, module_spec, module_cache_spec); + if (err.Fail()) + return err; + } + } + + ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); + module_sp.reset(new Module(local_spec)); + module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); + Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); + if (log) + log->Printf("[%s] module %s/%s was found in the cache", + (IsHost() ? "host" : "remote"), + module_spec.GetFileSpec().GetDirectory().AsCString(), + module_spec.GetFileSpec().GetFilename().AsCString()); + return Error(); + } + + // bring in the remote module file if (log) - log->Printf("[%s] module %s/%s is now cached and fine", + log->Printf("[%s] module %s/%s needs to come in remotely", (IsHost() ? "host" : "remote"), module_spec.GetFileSpec().GetDirectory().AsCString(), module_spec.GetFileSpec().GetFilename().AsCString()); - ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); - module_sp.reset(new Module(local_spec)); - module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); - return Error(); + Error err = BringInRemoteFile (this, module_spec, module_cache_spec); + if (err.Fail()) + return err; + if (module_cache_spec.Exists()) + { + Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM)); + if (log) + log->Printf("[%s] module %s/%s is now cached and fine", + (IsHost() ? "host" : "remote"), + module_spec.GetFileSpec().GetDirectory().AsCString(), + module_spec.GetFileSpec().GetFilename().AsCString()); + ModuleSpec local_spec(module_cache_spec, module_spec.GetArchitecture()); + module_sp.reset(new Module(local_spec)); + module_sp->SetPlatformFileSpec(module_spec.GetFileSpec()); + return Error(); + } + else + return Error("unable to obtain valid module file"); } else - return Error("unable to obtain valid module file"); + return Error("no cache path"); } Error diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index 4418a03a689..b7867c385e8 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -635,7 +635,7 @@ DynamicRegisterInfo::Dump () const s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " registers:\n", this, (uint64_t)num_regs); for (size_t i=0; i<num_regs; ++i) { - s.Printf("[%3" PRId64 "] name = %-10s", i, m_regs[i].name); + s.Printf("[%3" PRIu64 "] name = %-10s", (uint64_t)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, diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 0a350a2e1c1..14c133913ac 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 %" PRId64 "", m_start_line); + s->Printf (" from line %" PRIu64 "", (uint64_t)m_start_line); if (m_type == eLineEndSpecified) - s->Printf ("to line %" PRId64 "", m_end_line); + s->Printf ("to line %" PRIu64 "", (uint64_t)m_end_line); else s->Printf ("to end"); } else if (m_type == eLineEndSpecified) { - s->Printf (" from start to line %" PRId64 "", m_end_line); + s->Printf (" from start to line %" PRIu64 "", (uint64_t)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 %" PRId64 "", m_start_line); + s->Printf ("From line %" PRIu64 "", (uint64_t)m_start_line); if (m_type == eLineEndSpecified) - s->Printf ("to line %" PRId64 "", m_end_line); + s->Printf ("to line %" PRIu64 "", (uint64_t)m_end_line); else s->Printf ("to end"); s->Printf (".\n"); } else if (m_type == eLineEndSpecified) { - s->Printf ("From start to line %" PRId64 ".\n", m_end_line); + s->Printf ("From start to line %" PRIu64 ".\n", (uint64_t)m_end_line); } if (m_type == eFunctionSpecified) diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index b27cd782fe6..c61002d9961 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 = %" PRId64 "", + s->Printf("Symtab, file = %s%s%s%s, num_symbols = %" PRIu64, file_spec.GetPath().c_str(), object_name ? "(" : "", object_name ? object_name : "", object_name ? ")" : "", - m_symbols.size()); + (uint64_t)m_symbols.size()); else - s->Printf("Symtab, num_symbols = %" PRId64 "", m_symbols.size()); + s->Printf("Symtab, num_symbols = %" PRIu64 "", (uint64_t)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 %" PRId64 " symbol indexes (%" PRId64 " symbols total):\n", indexes.size(), m_symbols.size()); + s->Printf("Symtab %" PRIu64 " symbol indexes (%" PRIu64 " symbols total):\n", (uint64_t)indexes.size(), (uint64_t)m_symbols.size()); s->IndentMore(); if (!indexes.empty()) diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index c7bd0438b08..cc4fc83b2ad 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4934,6 +4934,14 @@ Process::SetSTDIOFileDescriptor (int fd) } bool +Process::ProcessIOHandlerIsActive () +{ + IOHandlerSP io_handler_sp (m_process_input_reader); + if (io_handler_sp) + return m_target.GetDebugger().IsTopIOHandler (io_handler_sp); + return false; +} +bool Process::PushProcessIOHandler () { IOHandlerSP io_handler_sp (m_process_input_reader); diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 4b55f98c139..62357419b14 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 %" PRId64 " is not supported", size); + error.SetErrorStringWithFormat("watch size of %" PRIu64 " is not supported", (uint64_t)size); } wp_sp.reset(); } |