[Lldb-commits] [lldb] r227931 - Add missing switch cases to silence warnings.

Chaoren Lin chaorenl at google.com
Mon Feb 2 17:51:51 PST 2015


Author: chaoren
Date: Mon Feb  2 19:51:50 2015
New Revision: 227931

URL: http://llvm.org/viewvc/llvm-project?rev=227931&view=rev
Log:
Add missing switch cases to silence warnings.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=227931&r1=227930&r2=227931&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Mon Feb  2 19:51:50 2015
@@ -3018,6 +3018,7 @@ GDBRemoteCommunicationClient::SendGDBSto
             case eWatchpointWrite:      m_supports_z2 = false; break;
             case eWatchpointRead:       m_supports_z3 = false; break;
             case eWatchpointReadWrite:  m_supports_z4 = false; break;
+            case eStoppointInvalid:     return UINT8_MAX;
             }
         }
     }

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=227931&r1=227930&r2=227931&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Mon Feb  2 19:51:50 2015
@@ -366,8 +366,8 @@ public:
         case eWatchpointWrite:      return m_supports_z2;
         case eWatchpointRead:       return m_supports_z3;
         case eWatchpointReadWrite:  return m_supports_z4;
+        case eStoppointInvalid:     return false;
         }
-        return false;
     }
     uint8_t
     SendGDBStoppointTypePacket (GDBStoppointType type,   // Type of breakpoint or watchpoint

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=227931&r1=227930&r2=227931&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Mon Feb  2 19:51:50 2015
@@ -978,6 +978,12 @@ GDBRemoteCommunicationServer::SendStopRe
     case eStopReasonExec:
         reason_str = "exec";
         break;
+    case eStopReasonInstrumentation:
+    case eStopReasonInvalid:
+    case eStopReasonPlanComplete:
+    case eStopReasonThreadExiting:
+    case eStopReasonNone:
+        break;
     }
     if (reason_str != nullptr)
     {
@@ -3765,7 +3771,7 @@ GDBRemoteCommunicationServer::Handle_Z (
             want_hardware = true;  want_breakpoint = false; break;
         case eWatchpointReadWrite:
             want_hardware = true;  want_breakpoint = false; break;
-        default:
+        case eStoppointInvalid:
             return SendIllFormedResponse(packet, "Z packet had invalid software/hardware specifier");
 
     }
@@ -3803,13 +3809,10 @@ GDBRemoteCommunicationServer::Handle_Z (
     }
     else
     {
-        uint32_t watch_flags = 0x0;
-        switch (stoppoint_type)
-        {
-            case eWatchpointWrite:     watch_flags = 0x1; break;
-            case eWatchpointRead:      watch_flags = 0x3; break;
-            case eWatchpointReadWrite: watch_flags = 0x3; break;
-        }
+        uint32_t watch_flags =
+            stoppoint_type == eWatchpointWrite
+            ? watch_flags = 0x1  // Write
+            : watch_flags = 0x3; // ReadWrite
 
         // Try to set the watchpoint.
         const Error error = m_debugged_process_sp->SetWatchpoint (





More information about the lldb-commits mailing list