[Lldb-commits] [lldb] r242913 - Fix warnings.
Bruce Mitchener
bruce.mitchener at gmail.com
Wed Jul 22 10:31:45 PDT 2015
Author: brucem
Date: Wed Jul 22 12:31:44 2015
New Revision: 242913
URL: http://llvm.org/viewvc/llvm-project?rev=242913&view=rev
Log:
Fix warnings.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11404
Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Symbol/ClangASTImporter.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/tools/debugserver/source/CMakeLists.txt
lldb/trunk/tools/debugserver/source/DNB.cpp
lldb/trunk/tools/debugserver/source/DNBArch.cpp
lldb/trunk/tools/debugserver/source/DNBArch.h
lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.h
lldb/trunk/tools/debugserver/source/RNBServices.cpp
lldb/trunk/tools/debugserver/source/RNBSocket.cpp
lldb/trunk/tools/debugserver/source/libdebugserver.cpp
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp Wed Jul 22 12:31:44 2015
@@ -133,6 +133,7 @@ GDBRemoteCommunicationServerPlatform::Ha
int platform_port;
std::string platform_path;
bool ok = UriParser::Parse(GetConnection()->GetURI().c_str(), platform_scheme, platform_ip, platform_port, platform_path);
+ (void)ok;
assert(ok);
Error error = StartDebugserverProcess (
platform_ip.c_str(),
Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Wed Jul 22 12:31:44 2015
@@ -623,6 +623,7 @@ ClangASTImporter::Minion::ExecuteDeportW
m_decls_to_deport->erase(decl);
DeclOrigin &origin = to_context_md->m_origins[decl];
+ (void)origin;
assert (origin.ctx == m_source_ctx); // otherwise we should never have added this
// because it doesn't need to be deported
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Jul 22 12:31:44 2015
@@ -2843,6 +2843,7 @@ Process::WriteMemory (addr_t addr, const
size_t intersect_size;
size_t opcode_offset;
const bool intersects = bp->IntersectsRange(addr, size, &intersect_addr, &intersect_size, &opcode_offset);
+ (void)intersects;
assert(intersects);
assert(addr <= intersect_addr && intersect_addr < addr + size);
assert(addr < intersect_addr + intersect_size && intersect_addr + intersect_size <= addr + size);
Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Wed Jul 22 12:31:44 2015
@@ -10,6 +10,30 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/../resources/lldb-debugserver-Info.plist")
endif()
+check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments"
+ CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
+if (CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
+endif ()
+
+check_cxx_compiler_flag("-Wno-vla-extension"
+ CXX_SUPPORTS_NO_VLA_EXTENSION)
+if (CXX_SUPPORTS_NO_VLA_EXTENSION)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
+endif ()
+
+check_cxx_compiler_flag("-Wno-zero-length-array"
+ CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY)
+if (CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array")
+endif ()
+
+check_cxx_compiler_flag("-Wno-extended-offsetof"
+ CXX_SUPPORTS_NO_EXTENDED_OFFSETOF)
+if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof")
+endif ()
+
add_definitions(
-DDEBUGSERVER_VERSION_STR="${LLDB_VERSION}"
)
Modified: lldb/trunk/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNB.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNB.cpp Wed Jul 22 12:31:44 2015
@@ -446,6 +446,7 @@ DNBProcessLaunch (const char *path,
else
{
bool res = AddProcessToMap(pid, processSP);
+ (void)res;
assert(res && "Couldn't add process to map!");
return pid;
}
@@ -494,6 +495,7 @@ DNBProcessAttach (nub_process_t attach_p
if (pid != INVALID_NUB_PROCESS)
{
bool res = AddProcessToMap(pid, processSP);
+ (void)res;
assert(res && "Couldn't add process to map!");
spawn_waitpid_thread(pid);
}
Modified: lldb/trunk/tools/debugserver/source/DNBArch.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBArch.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBArch.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBArch.cpp Wed Jul 22 12:31:44 2015
@@ -86,7 +86,7 @@ DNBArchProtocol::Create (MachThread *thr
}
-const uint8_t * const
+const uint8_t *
DNBArchProtocol::GetBreakpointOpcode (nub_size_t byte_size)
{
const DNBArchPluginInfo *arch_info = GetArchInfo ();
Modified: lldb/trunk/tools/debugserver/source/DNBArch.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBArch.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBArch.h (original)
+++ lldb/trunk/tools/debugserver/source/DNBArch.h Wed Jul 22 12:31:44 2015
@@ -27,7 +27,7 @@ class MachThread;
typedef DNBArchProtocol * (* DNBArchCallbackCreate)(MachThread *thread);
typedef const DNBRegisterSetInfo * (* DNBArchCallbackGetRegisterSetInfo)(nub_size_t *num_reg_sets);
-typedef const uint8_t * const (* DNBArchCallbackGetBreakpointOpcode)(nub_size_t byte_size);
+typedef const uint8_t * (* DNBArchCallbackGetBreakpointOpcode)(nub_size_t byte_size);
typedef struct DNBArchPluginInfoTag
{
@@ -49,7 +49,7 @@ public:
static const DNBRegisterSetInfo *
GetRegisterSetInfo (nub_size_t *num_reg_sets);
- static const uint8_t * const
+ static const uint8_t *
GetBreakpointOpcode (nub_size_t byte_size);
static void
@@ -94,7 +94,7 @@ public:
virtual uint32_t EnableHardwareWatchpoint (nub_addr_t addr, nub_size_t size, bool read, bool write, bool also_set_on_task) { return INVALID_NUB_HW_INDEX; }
virtual bool DisableHardwareBreakpoint (uint32_t hw_index) { return false; }
virtual bool DisableHardwareWatchpoint (uint32_t hw_index, bool also_set_on_task) { return false; }
- virtual uint32_t GetHardwareWatchpointHit() { return INVALID_NUB_HW_INDEX; }
+ virtual uint32_t GetHardwareWatchpointHit(nub_addr_t &addr) { return INVALID_NUB_HW_INDEX; }
virtual bool StepNotComplete () { return false; }
protected:
Modified: lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBDataRef.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBDataRef.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBDataRef.cpp Wed Jul 22 12:31:44 2015
@@ -334,7 +334,7 @@ DNBDataRef::Dump
uint32_t count;
char str[1024];
str[0] = '\0';
- int str_offset = 0;
+ size_t str_offset = 0;
for (offset = startOffset, count = 0; ValidOffset(offset) && offset < endOffset; ++count)
{
Modified: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp Wed Jul 22 12:31:44 2015
@@ -45,7 +45,6 @@ DNBRegisterValueClass::Dump(const char *
{
if (info.name != NULL)
{
- int i;
char str[1024];
char *pos;
char *end = str + sizeof(str);
@@ -62,7 +61,7 @@ DNBRegisterValueClass::Dump(const char *
default:
strncpy(str, "0x", 3);
pos = str + 2;
- for (i=0; i<info.size; ++i)
+ for (uint32_t i=0; i<info.size; ++i)
{
if (pos < end)
pos += snprintf(pos, end - pos, "%2.2x", (uint32_t)value.v_uint8[i]);
@@ -113,7 +112,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfSInt8:
snprintf(str, sizeof(str), "%s", "sint8 { ");
pos = str + strlen(str);
- for (i=0; i<info.size; ++i)
+ for (uint32_t i=0; i<info.size; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -127,7 +126,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfUInt8:
snprintf(str, sizeof(str), "%s", "uint8 { ");
pos = str + strlen(str);
- for (i=0; i<info.size; ++i)
+ for (uint32_t i=0; i<info.size; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -138,7 +137,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfSInt16:
snprintf(str, sizeof(str), "%s", "sint16 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/2; ++i)
+ for (uint32_t i=0; i<info.size/2; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -149,7 +148,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfUInt16:
snprintf(str, sizeof(str), "%s", "uint16 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/2; ++i)
+ for (uint32_t i=0; i<info.size/2; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -160,7 +159,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfSInt32:
snprintf(str, sizeof(str), "%s", "sint32 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/4; ++i)
+ for (uint32_t i=0; i<info.size/4; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -171,7 +170,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfUInt32:
snprintf(str, sizeof(str), "%s", "uint32 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/4; ++i)
+ for (uint32_t i=0; i<info.size/4; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -182,7 +181,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfFloat32:
snprintf(str, sizeof(str), "%s", "float32 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/4; ++i)
+ for (uint32_t i=0; i<info.size/4; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
@@ -193,7 +192,7 @@ DNBRegisterValueClass::Dump(const char *
case VectorOfUInt128:
snprintf(str, sizeof(str), "%s", "uint128 { ");
pos = str + strlen(str);
- for (i=0; i<info.size/16; ++i)
+ for (uint32_t i=0; i<info.size/16; ++i)
{
PRINT_COMMA_SEPARATOR;
if (pos < end)
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Jul 22 12:31:44 2015
@@ -158,16 +158,16 @@ MachProcess::MachProcess() :
m_stdio_thread (0),
m_stdio_mutex (PTHREAD_MUTEX_RECURSIVE),
m_stdout_data (),
- m_thread_actions (),
m_profile_enabled (false),
m_profile_interval_usec (0),
m_profile_thread (0),
m_profile_data_mutex(PTHREAD_MUTEX_RECURSIVE),
m_profile_data (),
- m_thread_list (),
- m_activities (),
+ m_thread_actions (),
m_exception_messages (),
m_exception_messages_mutex (PTHREAD_MUTEX_RECURSIVE),
+ m_thread_list (),
+ m_activities (),
m_state (eStateUnloaded),
m_state_mutex (PTHREAD_MUTEX_RECURSIVE),
m_events (0, kAllEventsMask),
@@ -376,7 +376,7 @@ MachProcess::GetLoadedDynamicLibrariesIn
info.pathname += strbuf;
pathname_ptr += sizeof (strbuf) - 1;
// Stop if we found nul byte indicating the end of the string
- for (int i = 0; i < sizeof(strbuf) - 1; i++)
+ for (size_t i = 0; i < sizeof(strbuf) - 1; i++)
{
if (strbuf[i] == '\0')
{
@@ -1032,6 +1032,7 @@ MachProcess::WriteMemory (nub_addr_t add
DNBBreakpoint *bp = bps[i];
const bool intersects = bp->IntersectsRange(addr, size, &intersect_addr, &intersect_size, &opcode_offset);
+ (void)intersects;
assert(intersects);
assert(addr <= intersect_addr && intersect_addr < addr + size);
assert(addr < intersect_addr + intersect_size && intersect_addr + intersect_size <= addr + size);
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Wed Jul 22 12:31:44 2015
@@ -266,7 +266,7 @@ static void get_threads_profile_data(DNB
if (kr != KERN_SUCCESS)
return;
- for (int i = 0; i < tcnt; i++)
+ for (mach_msg_type_number_t i = 0; i < tcnt; i++)
{
thread_identifier_info_data_t identifier_info;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
@@ -431,7 +431,7 @@ MachTask::GetProfileData (DNBProfileData
// Make sure that thread name doesn't interfere with our delimiter.
profile_data_stream << RAW_HEXBASE << std::setw(2);
const uint8_t *ubuf8 = (const uint8_t *)(thread_name);
- for (int j=0; j<len; j++)
+ for (size_t j=0; j<len; j++)
{
profile_data_stream << (uint32_t)(ubuf8[j]);
}
@@ -720,7 +720,7 @@ MachTask::ShutDownExcecptionThread()
// NULL our our exception port and let our exception thread exit
mach_port_t exception_port = m_exception_port;
- m_exception_port = NULL;
+ m_exception_port = 0;
err.SetError(::pthread_cancel(m_exception_thread), DNBError::POSIX);
if (DNBLogCheckLogBit(LOG_TASK) || err.Fail())
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp Wed Jul 22 12:31:44 2015
@@ -539,7 +539,7 @@ MachThread::SetState(nub_state_t state)
}
nub_size_t
-MachThread::GetNumRegistersInSet(int regSet) const
+MachThread::GetNumRegistersInSet(nub_size_t regSet) const
{
if (regSet < m_num_reg_sets)
return m_reg_sets[regSet].num_registers;
@@ -547,7 +547,7 @@ MachThread::GetNumRegistersInSet(int reg
}
const char *
-MachThread::GetRegisterSetName(int regSet) const
+MachThread::GetRegisterSetName(nub_size_t regSet) const
{
if (regSet < m_num_reg_sets)
return m_reg_sets[regSet].name;
@@ -555,7 +555,7 @@ MachThread::GetRegisterSetName(int regSe
}
const DNBRegisterInfo *
-MachThread::GetRegisterInfo(int regSet, int regIndex) const
+MachThread::GetRegisterInfo(nub_size_t regSet, nub_size_t regIndex) const
{
if (regSet < m_num_reg_sets)
if (regIndex < m_reg_sets[regSet].num_registers)
@@ -563,7 +563,7 @@ MachThread::GetRegisterInfo(int regSet,
return NULL;
}
void
-MachThread::DumpRegisterState(int regSet)
+MachThread::DumpRegisterState(nub_size_t regSet)
{
if (regSet == REGISTER_SET_ALL)
{
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h Wed Jul 22 12:31:44 2015
@@ -83,11 +83,11 @@ public:
bool NotifyException(MachException::Data& exc);
const MachException::Data& GetStopException() { return m_stop_exception; }
- nub_size_t GetNumRegistersInSet(int regSet) const;
- const char * GetRegisterSetName(int regSet) const;
+ nub_size_t GetNumRegistersInSet(nub_size_t regSet) const;
+ const char * GetRegisterSetName(nub_size_t regSet) const;
const DNBRegisterInfo *
- GetRegisterInfo(int regSet, int regIndex) const;
- void DumpRegisterState(int regSet);
+ GetRegisterInfo(nub_size_t regSet, nub_size_t regIndex) const;
+ void DumpRegisterState(nub_size_t regSet);
const DNBRegisterSetInfo *
GetRegisterSetInfo(nub_size_t *num_reg_sets ) const;
bool GetRegisterValue ( uint32_t reg_set_idx, uint32_t reg_idx, DNBRegisterValue *reg_value );
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp Wed Jul 22 12:31:44 2015
@@ -474,7 +474,7 @@ MachVMMemory::Read(task_t task, nub_addr
{
mach_vm_size_t curr_size = MaxBytesLeftInPage(task, curr_addr, data_count - total_bytes_read);
mach_msg_type_number_t curr_bytes_read = 0;
- vm_offset_t vm_memory = NULL;
+ vm_offset_t vm_memory = 0;
m_err = ::mach_vm_read (task, curr_addr, curr_size, &vm_memory, &curr_bytes_read);
if (DNBLogCheckLogBit(LOG_MEMORY))
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Wed Jul 22 12:31:44 2015
@@ -139,7 +139,7 @@ DNBArchMachARM::Create (MachThread *thre
return obj;
}
-const uint8_t * const
+const uint8_t *
DNBArchMachARM::SoftwareBreakpointOpcode (nub_size_t byte_size)
{
switch (byte_size)
@@ -2060,6 +2060,7 @@ DNBArchMachARM::GetRegisterContext (void
p += sizeof(m_state.context.exc);
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
}
@@ -2093,6 +2094,7 @@ DNBArchMachARM::SetRegisterContext (cons
p += sizeof(m_state.context.exc);
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
if (SetGPRState() | SetVFPState() | SetEXCState())
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h Wed Jul 22 12:31:44 2015
@@ -72,7 +72,7 @@ public:
virtual bool NotifyException(MachException::Data& exc);
static DNBArchProtocol *Create (MachThread *thread);
- static const uint8_t * const SoftwareBreakpointOpcode (nub_size_t byte_size);
+ static const uint8_t * SoftwareBreakpointOpcode (nub_size_t byte_size);
static uint32_t GetCPUType();
virtual uint32_t NumSupportedHardwareBreakpoints();
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp Wed Jul 22 12:31:44 2015
@@ -84,7 +84,7 @@ DNBArchMachARM64::Create (MachThread *th
return obj;
}
-const uint8_t * const
+const uint8_t *
DNBArchMachARM64::SoftwareBreakpointOpcode (nub_size_t byte_size)
{
return g_arm_breakpoint_opcode;
@@ -1995,6 +1995,7 @@ DNBArchMachARM64::GetRegisterContext (vo
p += sizeof(m_state.context.exc);
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
}
DNBLogThreadedIf (LOG_THREAD, "DNBArchMachARM64::GetRegisterContext (buf = %p, len = %zu) => %zu", buf, buf_len, size);
@@ -2027,6 +2028,7 @@ DNBArchMachARM64::SetRegisterContext (co
p += sizeof(m_state.context.exc);
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
SetGPRState();
SetVFPState();
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h Wed Jul 22 12:31:44 2015
@@ -67,7 +67,7 @@ public:
virtual bool NotifyException(MachException::Data& exc);
static DNBArchProtocol *Create (MachThread *thread);
- static const uint8_t * const SoftwareBreakpointOpcode (nub_size_t byte_size);
+ static const uint8_t * SoftwareBreakpointOpcode (nub_size_t byte_size);
static uint32_t GetCPUType();
virtual uint32_t NumSupportedHardwareWatchpoints();
Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp Wed Jul 22 12:31:44 2015
@@ -1246,7 +1246,7 @@ DNBArchImplI386::Create (MachThread *thr
return obj;
}
-const uint8_t * const
+const uint8_t *
DNBArchImplI386::SoftwareBreakpointOpcode (nub_size_t byte_size)
{
static const uint8_t g_breakpoint_opcode[] = { 0xCC };
@@ -1703,6 +1703,7 @@ DNBArchImplI386::GetRegisterContext (voi
// make sure we end up with exactly what we think we should have
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
}
}
@@ -1788,6 +1789,7 @@ DNBArchImplI386::SetRegisterContext (con
// make sure we end up with exactly what we think we should have
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
kern_return_t kret;
if ((kret = SetGPRState()) != KERN_SUCCESS)
Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h Wed Jul 22 12:31:44 2015
@@ -221,7 +221,7 @@ protected:
static DNBArchProtocol *
Create (MachThread *thread);
- static const uint8_t * const
+ static const uint8_t *
SoftwareBreakpointOpcode (nub_size_t byte_size);
static const DNBRegisterSetInfo *
Modified: lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp Wed Jul 22 12:31:44 2015
@@ -27,7 +27,7 @@
static const uint8_t g_breakpoint_opcode[] = { 0x7F, 0xC0, 0x00, 0x08 };
-const uint8_t * const
+const uint8_t *
DNBArchMachPPC::SoftwareBreakpointOpcode (nub_size_t size)
{
if (size == 4)
Modified: lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h Wed Jul 22 12:31:44 2015
@@ -46,7 +46,7 @@ public:
virtual bool ThreadWillResume();
virtual bool ThreadDidStop();
- static const uint8_t * const SoftwareBreakpointOpcode (nub_size_t byte_size);
+ static const uint8_t * SoftwareBreakpointOpcode (nub_size_t byte_size);
static uint32_t GetCPUType();
protected:
Modified: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Wed Jul 22 12:31:44 2015
@@ -1566,7 +1566,7 @@ DNBArchImplX86_64::Create (MachThread *t
return obj;
}
-const uint8_t * const
+const uint8_t *
DNBArchImplX86_64::SoftwareBreakpointOpcode (nub_size_t byte_size)
{
static const uint8_t g_breakpoint_opcode[] = { 0xCC };
@@ -2089,6 +2089,7 @@ DNBArchImplX86_64::GetRegisterContext (v
// make sure we end up with exactly what we think we should have
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
}
@@ -2176,6 +2177,7 @@ DNBArchImplX86_64::SetRegisterContext (c
// make sure we end up with exactly what we think we should have
size_t bytes_written = p - (uint8_t *)buf;
+ (void)bytes_written;
assert (bytes_written == size);
kern_return_t kret;
Modified: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h Wed Jul 22 12:31:44 2015
@@ -227,7 +227,7 @@ protected:
static DNBArchProtocol *
Create (MachThread *thread);
- static const uint8_t * const
+ static const uint8_t *
SoftwareBreakpointOpcode (nub_size_t byte_size);
static const DNBRegisterSetInfo *
Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Wed Jul 22 12:31:44 2015
@@ -542,7 +542,7 @@ RNBRemote::SendPacket (const std::string
}
else
{
- for (int i = 0; i != s_compressed.size(); ++i)
+ for (size_t i = 0; i != s_compressed.size(); ++i)
cksum += s_compressed[i];
snprintf (hexbuf, sizeof hexbuf, "%02x", cksum & 0xff);
sendpacket += hexbuf;
@@ -1076,7 +1076,7 @@ decode_binary_data (const char *str, siz
{
return bytes;
}
- if (len == -1)
+ if (len == (size_t)-1)
len = strlen (str);
while (len--)
@@ -2454,7 +2454,7 @@ append_hex_value (std::ostream& ostrm, c
}
else
{
- for (i = 0; i < buf_size; i++)
+ for (size_t i = 0; i < buf_size; i++)
ostrm << RAWHEX8(p[i]);
}
}
@@ -2676,7 +2676,7 @@ RNBRemote::SendStopReplyPacketForThread
// the thread name contains special chars, send as hex bytes
ostrm << std::hex << "hexname:";
uint8_t *u_thread_name = (uint8_t *)thread_name;
- for (int i = 0; i < thread_name_len; i++)
+ for (size_t i = 0; i < thread_name_len; i++)
ostrm << RAWHEX8(u_thread_name[i]);
ostrm << ';';
}
@@ -2787,7 +2787,7 @@ RNBRemote::SendStopReplyPacketForThread
{
ostrm << "metype:" << std::hex << tid_stop_info.details.exception.type << ';';
ostrm << "mecount:" << std::hex << tid_stop_info.details.exception.data_count << ';';
- for (int i = 0; i < tid_stop_info.details.exception.data_count; ++i)
+ for (nub_size_t i = 0; i < tid_stop_info.details.exception.data_count; ++i)
ostrm << "medata:" << std::hex << tid_stop_info.details.exception.data[i] << ';';
}
@@ -3026,7 +3026,7 @@ RNBRemote::HandlePacket_m (const char *p
length = bytes_read;
std::ostringstream ostrm;
- for (int i = 0; i < length; i++)
+ for (unsigned long i = 0; i < length; i++)
ostrm << RAWHEX8(buf[i]);
return SendPacket (ostrm.str ());
}
@@ -3093,7 +3093,7 @@ RNBRemote::HandlePacket_x (const char *p
std::vector<uint8_t> buf_quoted;
buf_quoted.reserve (bytes_read + 30);
- for (int i = 0; i < bytes_read; i++)
+ for (nub_size_t i = 0; i < bytes_read; i++)
{
if (buf[i] == '#' || buf[i] == '$' || buf[i] == '}' || buf[i] == '*')
{
@@ -3108,7 +3108,7 @@ RNBRemote::HandlePacket_x (const char *p
length = buf_quoted.size();
std::ostringstream ostrm;
- for (int i = 0; i < length; i++)
+ for (unsigned long i = 0; i < length; i++)
ostrm << buf_quoted[i];
return SendPacket (ostrm.str ());
@@ -3471,6 +3471,7 @@ RNBRemote::HandlePacket_qSupported (cons
// By default, don't enable compression. It's only worth doing when we are working
// with a low speed communication channel.
bool enable_compression = false;
+ (void)enable_compression;
// Enable compression when debugserver is running on a watchOS device where communication may be over Bluetooth.
#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
@@ -3907,7 +3908,7 @@ RNBRemote::HandlePacket_p (const char *p
DNBLogError("RNBRemote::HandlePacket_p(%s): unknown register number %u requested\n", p, reg);
ostrm << "00000000";
}
- else if (reg_entry->nub_info.reg == -1)
+ else if (reg_entry->nub_info.reg == (uint32_t)-1)
{
if (reg_entry->nub_info.size > 0)
{
@@ -3966,7 +3967,7 @@ RNBRemote::HandlePacket_P (const char *p
reg_entry = &g_reg_entries[reg];
- if (reg_entry->nub_info.set == -1 && reg_entry->nub_info.reg == -1)
+ if (reg_entry->nub_info.set == (uint32_t)-1 && reg_entry->nub_info.reg == (uint32_t)-1)
{
DNBLogError("RNBRemote::HandlePacket_P(%s): unknown register number %u requested\n", p, reg);
return SendPacket("E48");
@@ -4389,7 +4390,7 @@ RNBRemote::HandlePacket_s (const char *p
// Hardware supported stepping not supported on arm
nub_thread_t tid = GetContinueThread ();
- if (tid == 0 || tid == -1)
+ if (tid == 0 || tid == (nub_thread_t)-1)
tid = GetCurrentThread();
if (tid == INVALID_NUB_THREAD)
@@ -4437,7 +4438,7 @@ RNBRemote::HandlePacket_S (const char *p
}
action.tid = GetContinueThread ();
- if (action.tid == 0 || action.tid == -1)
+ if (action.tid == 0 || action.tid == (nub_thread_t)-1)
return SendPacket ("E40");
nub_state_t tstate = DNBThreadGetState (pid, action.tid);
Modified: lldb/trunk/tools/debugserver/source/RNBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.h?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.h (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.h Wed Jul 22 12:31:44 2015
@@ -161,7 +161,7 @@ public:
nub_thread_t GetCurrentThread () const
{
- if (m_thread == 0 || m_thread == -1)
+ if (m_thread == 0 || m_thread == (nub_thread_t)-1)
return DNBProcessGetCurrentThread (m_ctx.ProcessID());
return m_thread;
}
Modified: lldb/trunk/tools/debugserver/source/RNBServices.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBServices.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBServices.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBServices.cpp Wed Jul 22 12:31:44 2015
@@ -11,21 +11,21 @@
//
//===----------------------------------------------------------------------===//
-#import "RNBServices.h"
+#include "RNBServices.h"
-#import <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CoreFoundation.h>
#include <libproc.h>
-#import <unistd.h>
+#include <unistd.h>
#include <sys/sysctl.h>
#include "CFString.h"
#include <vector>
-#import "DNBLog.h"
+#include "DNBLog.h"
#include "MacOSX/CFUtils.h"
// For now only SpringBoard has a notion of "Applications" that it can list for us.
// So we have to use the SpringBoard API's here.
#if defined (WITH_SPRINGBOARD) || defined (WITH_BKS)
-#import <SpringBoardServices/SpringBoardServices.h>
+#include <SpringBoardServices/SpringBoardServices.h>
#endif
// From DNB.cpp
Modified: lldb/trunk/tools/debugserver/source/RNBSocket.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBSocket.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBSocket.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBSocket.cpp Wed Jul 22 12:31:44 2015
@@ -395,7 +395,7 @@ RNBSocket::Write (const void *buffer, si
if (bytessent < 0)
return rnb_err;
- if (bytessent != length)
+ if ((size_t)bytessent != length)
return rnb_err;
DNBLogThreadedIf(LOG_RNB_PACKETS, "putpkt: %*s", (int)length, (char *)buffer); // All data is string based in debugserver, so this is safe
Modified: lldb/trunk/tools/debugserver/source/libdebugserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/libdebugserver.cpp?rev=242913&r1=242912&r2=242913&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/libdebugserver.cpp (original)
+++ lldb/trunk/tools/debugserver/source/libdebugserver.cpp Wed Jul 22 12:31:44 2015
@@ -189,18 +189,18 @@ HandleProcessStateChange (RNBRemoteSP &r
if (ctx.GetProcessStopCount() == 1)
{
- DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? no, first stop...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
+ DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? no, first stop...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
}
else
{
- DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? YES!!!", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
+ DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? YES!!!", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
remote->NotifyThatProcessStopped ();
}
}
else
{
- DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? skipping...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
+ DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? skipping...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
}
}
return eRNBRunLoopModeInferiorExecuting;
More information about the lldb-commits
mailing list