[Lldb-commits] [lldb] r306765 - Fix some type-based warnings

Tim Hammerquist via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 29 16:33:41 PDT 2017


Author: penryu
Date: Thu Jun 29 16:33:40 2017
New Revision: 306765

URL: http://llvm.org/viewvc/llvm-project?rev=306765&view=rev
Log:
Fix some type-based warnings

Modified:
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
    lldb/trunk/tools/debugserver/source/debugserver.cpp

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=306765&r1=306764&r2=306765&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Jun 29 16:33:40 2017
@@ -209,7 +209,7 @@ protected:
     Process *process = m_exe_ctx.GetProcessPtr();
     Thread *thread = process->GetThreadList().FindThreadByID(tid).get();
     if (thread == nullptr) {
-      result.AppendErrorWithFormat("Failed to process thread# %lu.\n", tid);
+      result.AppendErrorWithFormat("Failed to process thread# %llu.\n", tid);
       result.SetStatus(eReturnStatusFailed);
       return false;
     }

Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=306765&r1=306764&r2=306765&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Thu Jun 29 16:33:40 2017
@@ -517,11 +517,11 @@ bool lldb_private::formatters::NSNumberS
 
         bool is_preserved_number = cfinfoa & 0x8;
         if (is_preserved_number) {
-          lldbassert(!"We should handle preserved numbers!");
+          lldbassert(!static_cast<bool>("We should handle preserved numbers!"));
           return false;
         }
 
-        type_code = (TypeCodes)(cfinfoa & 0x7);
+        type_code = static_cast<TypeCodes>(cfinfoa & 0x7);
       } else {
         uint8_t data_type =
         process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, 1,

Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=306765&r1=306764&r2=306765&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/debugserver.cpp (original)
+++ lldb/trunk/tools/debugserver/source/debugserver.cpp Thu Jun 29 16:33:40 2017
@@ -876,8 +876,8 @@ static struct option g_long_options[] =
      'u'}, // If we need to handshake with our parent process, an option will be
            // passed down that specifies a unix socket name to use
     {"fd", required_argument, NULL,
-     'FDSC'}, // A file descriptor was passed to this process when spawned that
-              // is already open and ready for communication
+     '2'}, // A file descriptor was passed to this process when spawned that
+           // is already open and ready for communication
     {"named-pipe", required_argument, NULL, 'P'},
     {"reverse-connect", no_argument, NULL, 'R'},
     {"env", required_argument, NULL,
@@ -1261,7 +1261,7 @@ int main(int argc, char *argv[]) {
       }
       break;
 
-    case 'FDSC':
+    case '2':
       // File descriptor passed to this process during fork/exec and is already
       // open and ready for communication.
       communication_fd = atoi(optarg);




More information about the lldb-commits mailing list