diff --git a/source/Host/common/NativeBreakpointList.cpp b/source/Host/common/NativeBreakpointList.cpp index 52b9baf..c3afba6 100644 --- a/source/Host/common/NativeBreakpointList.cpp +++ b/source/Host/common/NativeBreakpointList.cpp @@ -27,7 +27,7 @@ NativeBreakpointList::AddRef (lldb::addr_t addr, size_t size_hint, bool hardware { Log *log (GetLogIfAnyCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); if (log) - log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64 ", size_hint = %lu, hardware = %s", __FUNCTION__, addr, size_hint, hardware ? "true" : "false"); + log->Printf ("NativeBreakpointList::%s addr = 0x%" PRIx64 ", size_hint = %" PRIx64 ", hardware = %s", __FUNCTION__, addr, (uint64_t)size_hint, hardware ? "true" : "false"); Mutex::Locker locker (m_mutex); @@ -45,14 +45,14 @@ NativeBreakpointList::AddRef (lldb::addr_t addr, size_t size_hint, bool hardware // Create a new breakpoint using the given create func. if (log) - log->Printf ("NativeBreakpointList::%s creating breakpoint for addr = 0x%" PRIx64 ", size_hint = %lu, hardware = %s", __FUNCTION__, addr, size_hint, hardware ? "true" : "false"); + log->Printf ("NativeBreakpointList::%s creating breakpoint for addr = 0x%" PRIx64 ", size_hint = %" PRIu64 ", hardware = %s", __FUNCTION__, addr, (uint64_t)size_hint, hardware ? "true" : "false"); NativeBreakpointSP breakpoint_sp; Error error = create_func (addr, size_hint, hardware, breakpoint_sp); if (error.Fail ()) { if (log) - log->Printf ("NativeBreakpointList::%s creating breakpoint for addr = 0x%" PRIx64 ", size_hint = %lu, hardware = %s -- FAILED: %s", __FUNCTION__, addr, size_hint, hardware ? "true" : "false", error.AsCString ()); + log->Printf ("NativeBreakpointList::%s creating breakpoint for addr = 0x%" PRIx64 ", size_hint = %" PRIu64 ", hardware = %s -- FAILED: %s", __FUNCTION__, addr, (uint64_t)size_hint, hardware ? "true" : "false", error.AsCString ()); return error; } diff --git a/source/Host/common/SoftwareBreakpoint.cpp b/source/Host/common/SoftwareBreakpoint.cpp index 5a6f783..f8445b7 100644 --- a/source/Host/common/SoftwareBreakpoint.cpp +++ b/source/Host/common/SoftwareBreakpoint.cpp @@ -57,8 +57,8 @@ SoftwareBreakpoint::CreateSoftwareBreakpoint (NativeProcessProtocol &process, ll if (bp_opcode_size > MAX_TRAP_OPCODE_SIZE) { if (log) - log->Printf ("SoftwareBreakpoint::%s cannot support %lu trapcode bytes, max size is %lu", __FUNCTION__, bp_opcode_size, MAX_TRAP_OPCODE_SIZE); - return Error ("SoftwareBreakpoint::GetSoftwareBreakpointTrapOpcode() returned too many trap opcode bytes: requires %lu but we only support a max of %lu", bp_opcode_size, MAX_TRAP_OPCODE_SIZE); + log->Printf ("SoftwareBreakpoint::%s cannot support %" PRIu64 " trapcode bytes, max size is %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)MAX_TRAP_OPCODE_SIZE); + return Error ("SoftwareBreakpoint::GetSoftwareBreakpointTrapOpcode() returned too many trap opcode bytes: requires %" PRIu64 " but we only support a max of %" PRIu64, (uint64_t)bp_opcode_size, (uint64_t)MAX_TRAP_OPCODE_SIZE); } // Validate that we received opcodes. @@ -115,8 +115,8 @@ SoftwareBreakpoint::EnableSoftwareBreakpoint (NativeProcessProtocol &process, ll if (bytes_read != bp_opcode_size) { if (log) - log->Printf ("SoftwareBreakpoint::%s failed to read memory while attempting to set breakpoint: attempted to read %lu bytes but only read %" PRIu64, __FUNCTION__, bp_opcode_size, (uint64_t)bytes_read); - return Error ("SoftwareBreakpoint::%s failed to read memory while attempting to set breakpoint: attempted to read %lu bytes but only read %" PRIu64, __FUNCTION__, bp_opcode_size, (uint64_t)bytes_read); + log->Printf ("SoftwareBreakpoint::%s failed to read memory while attempting to set breakpoint: attempted to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)bytes_read); + return Error ("SoftwareBreakpoint::%s failed to read memory while attempting to set breakpoint: attempted to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)bytes_read); } // Log what we read. @@ -144,7 +144,7 @@ SoftwareBreakpoint::EnableSoftwareBreakpoint (NativeProcessProtocol &process, ll // Ensure we wrote as many bytes as we expected. if (bytes_written != bp_opcode_size) { - error.SetErrorStringWithFormat("SoftwareBreakpoint::%s failed write memory while attempting to set breakpoint: attempted to write %lu bytes but only wrote %" PRIu64, __FUNCTION__, bp_opcode_size, (uint64_t)bytes_written); + error.SetErrorStringWithFormat("SoftwareBreakpoint::%s failed write memory while attempting to set breakpoint: attempted to write %" PRIu64 " bytes but only wrote %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)bytes_written); if (log) log->PutCString (error.AsCString ()); return error; @@ -164,8 +164,8 @@ SoftwareBreakpoint::EnableSoftwareBreakpoint (NativeProcessProtocol &process, ll if (verify_bytes_read != bp_opcode_size) { if (log) - log->Printf ("SoftwareBreakpoint::%s failed to read memory while attempting to verify breakpoint: attempted to read %lu bytes but only read %" PRIu64, __FUNCTION__, bp_opcode_size, (uint64_t)verify_bytes_read); - return Error ("SoftwareBreakpoint::%s failed to read memory while attempting to verify breakpoint: attempted to read %lu bytes but only read %" PRIu64, __FUNCTION__, bp_opcode_size, (uint64_t)verify_bytes_read); + log->Printf ("SoftwareBreakpoint::%s failed to read memory while attempting to verify breakpoint: attempted to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)verify_bytes_read); + return Error ("SoftwareBreakpoint::%s failed to read memory while attempting to verify breakpoint: attempted to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, (uint64_t)bp_opcode_size, (uint64_t)verify_bytes_read); } if (::memcmp(bp_opcode_bytes, verify_bp_opcode_bytes, bp_opcode_size) != 0) @@ -229,7 +229,7 @@ SoftwareBreakpoint::DoDisable () error = m_process.ReadMemory (m_addr, curr_break_op, m_opcode_size, bytes_read); if (error.Success() && bytes_read < m_opcode_size) { - error.SetErrorStringWithFormat ("SoftwareBreakpointr::%s addr=0x%" PRIx64 ": tried to read %lu bytes but only read %" PRIu64, __FUNCTION__, m_addr, m_opcode_size, (uint64_t)bytes_read); + error.SetErrorStringWithFormat ("SoftwareBreakpointr::%s addr=0x%" PRIx64 ": tried to read %" PRIu64 " bytes but only read %" PRIu64, __FUNCTION__, m_addr, (uint64_t)m_opcode_size, (uint64_t)bytes_read); } if (error.Success ()) { @@ -244,7 +244,7 @@ SoftwareBreakpoint::DoDisable () error = m_process.WriteMemory (m_addr, m_saved_opcodes, m_opcode_size, bytes_written); if (error.Success() && bytes_written < m_opcode_size) { - error.SetErrorStringWithFormat ("SoftwareBreakpoint::%s addr=0x%" PRIx64 ": tried to write %lu bytes but only wrote %" PRIu64, __FUNCTION__, m_addr, m_opcode_size, (uint64_t)bytes_written); + error.SetErrorStringWithFormat ("SoftwareBreakpoint::%s addr=0x%" PRIx64 ": tried to write %" PRIu64 " bytes but only wrote %" PRIu64, __FUNCTION__, m_addr, (uint64_t)m_opcode_size, (uint64_t)bytes_written); } if (error.Success ()) { @@ -268,7 +268,7 @@ SoftwareBreakpoint::DoDisable () error = m_process.ReadMemory (m_addr, verify_opcode, m_opcode_size, verify_bytes_read); if (error.Success() && verify_bytes_read < m_opcode_size) { - error.SetErrorStringWithFormat ("SoftwareBreakpoint::%s addr=0x%" PRIx64 ": tried to read %lu verification bytes but only read %" PRIu64, __FUNCTION__, m_addr, m_opcode_size, (uint64_t)verify_bytes_read); + error.SetErrorStringWithFormat ("SoftwareBreakpoint::%s addr=0x%" PRIx64 ": tried to read %" PRIu64 " verification bytes but only read %" PRIu64, __FUNCTION__, m_addr, (uint64_t)m_opcode_size, (uint64_t)verify_bytes_read); } if (error.Success ()) { diff --git a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 7497b98..3f21137 100644 --- a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -168,7 +168,7 @@ ObjectContainerUniversalMachO::Dump (Stream *s) const s->Indent(); const size_t num_archs = GetNumArchitectures(); const size_t num_objects = GetNumObjects(); - s->Printf("ObjectContainerUniversalMachO, num_archs = %lu, num_objects = %lu", num_archs, num_objects); + s->Printf("ObjectContainerUniversalMachO, num_archs = %" PRIu64 ", num_objects = %" PRIu64, (uint64_t)num_archs, (uint64_t)num_objects); uint32_t i; ArchSpec arch; s->IndentMore(); diff --git a/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index a556b0e..9a73887 100644 --- a/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -254,7 +254,7 @@ OperatingSystemPython::CreateThreadFromThreadInfo(StructuredData::Dictionary &th std::string queue; thread_dict.GetValueForKeyAsInteger("core", core_number, UINT32_MAX); - thread_dict.GetValueForKeyAsInteger("register_data_addr", reg_data_addr, LLDB_INVALID_ADDRESS); + thread_dict.GetValueForKeyAsInteger("register_data_addr", reg_data_addr, (uint64_t)LLDB_INVALID_ADDRESS); thread_dict.GetValueForKeyAsString("name", name); thread_dict.GetValueForKeyAsString("queue", queue); diff --git a/source/Target/Memory.cpp b/source/Target/Memory.cpp index c89fd51..7f3a0a0 100644 --- a/source/Target/Memory.cpp +++ b/source/Target/Memory.cpp @@ -330,8 +330,8 @@ AllocatedBlock::ReserveBlock (uint32_t size) m_offset_to_chunk_size[last_offset] = needed_chunks; if (log) log->Printf("[2] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - " - "num_chunks %lu", - (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size()); + "num_chunks %" PRIu64, + (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, (uint64_t)m_offset_to_chunk_size.size()); addr = m_addr + last_offset; break; } @@ -348,8 +348,8 @@ AllocatedBlock::ReserveBlock (uint32_t size) m_offset_to_chunk_size[last_offset] = needed_chunks; if (log) log->Printf("[3] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - " - "num_chunks %lu", - (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size()); + "num_chunks %" PRIu64, + (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, (uint64_t)m_offset_to_chunk_size.size()); addr = m_addr + last_offset; break; } @@ -427,8 +427,8 @@ AllocatedBlock::FreeBlock (addr_t addr) } Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE)); if (log) - log->Printf("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %lu", (void *)this, (uint64_t)addr, - success, m_offset_to_chunk_size.size()); + log->Printf("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %" PRIu64, (void *)this, (uint64_t)addr, + success, (uint64_t)m_offset_to_chunk_size.size()); return success; }