This revision was automatically updated to reflect the committed changes.
Closed by commit rL242913: Fix warnings. (authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D11404?vs=30315&id=30364#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11404

Files:
  
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

Index: lldb/trunk/source/Symbol/ClangASTImporter.cpp
===================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp
@@ -623,6 +623,7 @@
         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
Index: lldb/trunk/source/Target/Process.cpp
===================================================================
--- lldb/trunk/source/Target/Process.cpp
+++ lldb/trunk/source/Target/Process.cpp
@@ -2843,6 +2843,7 @@
                     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);
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -133,6 +133,7 @@
     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(),
Index: lldb/trunk/tools/debugserver/source/DNBArch.h
===================================================================
--- lldb/trunk/tools/debugserver/source/DNBArch.h
+++ lldb/trunk/tools/debugserver/source/DNBArch.h
@@ -27,7 +27,7 @@
 
 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 @@
     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 @@
     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:
Index: lldb/trunk/tools/debugserver/source/libdebugserver.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/libdebugserver.cpp
+++ lldb/trunk/tools/debugserver/source/libdebugserver.cpp
@@ -189,18 +189,18 @@
 					
 					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; 
Index: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp
@@ -542,7 +542,7 @@
     }
     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 @@
     {
         return bytes;
     }
-    if (len == -1)
+    if (len == (size_t)-1)
         len = strlen (str);
 
     while (len--)
@@ -2454,7 +2454,7 @@
     }
     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 @@
                 // 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 @@
         {
             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 @@
     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 @@
 
     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 @@
     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 @@
     // 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 @@
         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 @@
 
     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 @@
 
     // 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 @@
     }
 
     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);
Index: lldb/trunk/tools/debugserver/source/RNBSocket.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/RNBSocket.cpp
+++ lldb/trunk/tools/debugserver/source/RNBSocket.cpp
@@ -395,7 +395,7 @@
     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
Index: lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
+++ lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
@@ -334,7 +334,7 @@
     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)
     {
Index: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
@@ -45,7 +45,6 @@
 {
     if (info.name != NULL)
     {
-        int i;
         char str[1024];
         char *pos;
         char *end = str + sizeof(str);
@@ -62,7 +61,7 @@
             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 @@
                     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 @@
                     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 @@
                     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 @@
                     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 @@
                     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 @@
                     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 @@
                     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 @@
                     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)
Index: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
@@ -227,7 +227,7 @@
     static DNBArchProtocol *
     Create (MachThread *thread);
     
-    static const uint8_t * const
+    static const uint8_t *
     SoftwareBreakpointOpcode (nub_size_t byte_size);
 
     static const DNBRegisterSetInfo *
Index: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -1566,7 +1566,7 @@
     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 @@
             
             // 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 @@
         
         // 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;
Index: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
@@ -221,7 +221,7 @@
     static DNBArchProtocol *
     Create (MachThread *thread);
     
-    static const uint8_t * const
+    static const uint8_t *
     SoftwareBreakpointOpcode (nub_size_t byte_size);
 
     static const DNBRegisterSetInfo *
Index: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
@@ -1246,7 +1246,7 @@
     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 @@
             
             // 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 @@
         
         // 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)
Index: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
@@ -67,7 +67,7 @@
     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();
Index: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
@@ -84,7 +84,7 @@
     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 @@
         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 @@
         p += sizeof(m_state.context.exc);
         
         size_t bytes_written = p - (uint8_t *)buf;
+        (void)bytes_written;
         assert (bytes_written == size);
         SetGPRState();
         SetVFPState();
Index: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
@@ -539,31 +539,31 @@
 }
 
 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;
     return 0;
 }
 
 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;
     return NULL;
 }
 
 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)
             return &m_reg_sets[regSet].registers[regIndex];
     return NULL;
 }
 void
-MachThread::DumpRegisterState(int regSet)
+MachThread::DumpRegisterState(nub_size_t regSet)
 {
     if (regSet == REGISTER_SET_ALL)
     {
Index: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -158,16 +158,16 @@
     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 @@
                 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 @@
         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);
Index: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
@@ -266,7 +266,7 @@
     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 @@
                         // 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 @@
 
     // 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())
Index: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
@@ -83,11 +83,11 @@
     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 );
Index: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
@@ -474,7 +474,7 @@
     {
         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))
Index: lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
@@ -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)
Index: lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
@@ -46,7 +46,7 @@
     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:
Index: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -139,7 +139,7 @@
     return obj;
 }
 
-const uint8_t * const
+const uint8_t *
 DNBArchMachARM::SoftwareBreakpointOpcode (nub_size_t byte_size)
 {
     switch (byte_size)
@@ -2060,6 +2060,7 @@
         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 @@
         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())
Index: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
@@ -72,7 +72,7 @@
     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();
Index: lldb/trunk/tools/debugserver/source/DNB.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/DNB.cpp
+++ lldb/trunk/tools/debugserver/source/DNB.cpp
@@ -446,6 +446,7 @@
             else
             {
                 bool res = AddProcessToMap(pid, processSP);
+                (void)res;
                 assert(res && "Couldn't add process to map!");
                 return pid;
             }
@@ -494,6 +495,7 @@
         if (pid != INVALID_NUB_PROCESS)
         {
             bool res = AddProcessToMap(pid, processSP);
+            (void)res;
             assert(res && "Couldn't add process to map!");
             spawn_waitpid_thread(pid);
         }
Index: lldb/trunk/tools/debugserver/source/RNBRemote.h
===================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.h
+++ lldb/trunk/tools/debugserver/source/RNBRemote.h
@@ -161,7 +161,7 @@
 
     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;
                     }
Index: lldb/trunk/tools/debugserver/source/DNBArch.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/DNBArch.cpp
+++ lldb/trunk/tools/debugserver/source/DNBArch.cpp
@@ -86,7 +86,7 @@
 
 }
 
-const uint8_t * const 
+const uint8_t *
 DNBArchProtocol::GetBreakpointOpcode (nub_size_t byte_size)
 {
     const DNBArchPluginInfo *arch_info = GetArchInfo ();
Index: lldb/trunk/tools/debugserver/source/CMakeLists.txt
===================================================================
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt
@@ -10,6 +10,30 @@
   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}"
   )
Index: lldb/trunk/tools/debugserver/source/RNBServices.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/RNBServices.cpp
+++ lldb/trunk/tools/debugserver/source/RNBServices.cpp
@@ -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
_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to