aganea created this revision.
aganea added reviewers: JDevlieghere, aleksandr.urakov, asmith, mgorny.
aganea added a project: LLDB.
Herald added subscribers: lldb-commits, abidh, aprantl.

Ditto. Please see warnings list:

  [2660/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\GetOptInc.cpp.obj
  F:\svn\lldb\source\Host\common\GetOptInc.cpp(100,17): warning: cast from 
'char *const *' to 'char **' drops const qualifier [-Wcast-qual]
        ((char **)nargv)[pos] = nargv[cstart];
                  ^
  F:\svn\lldb\source\Host\common\GetOptInc.cpp(102,17): warning: cast from 
'char *const *' to 'char **' drops const qualifier [-Wcast-qual]
        ((char **)nargv)[cstart] = swap;
                  ^
  2 warnings generated.
  [2677/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\MainLoop.cpp.obj
  F:\svn\lldb\source\Host\common\MainLoop.cpp(64,13): warning: unused function 
'SignalHandler' [-Wunused-function]
  static void SignalHandler(int signo, siginfo_t *info, void *) {
              ^
  1 warning generated.
  [2694/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\Socket.cpp.obj
  F:\svn\lldb\source\Host\common\Socket.cpp(398,17): warning: format specifies 
type 'int' but the argument has type 'lldb_private::NativeSocket' (aka 
'unsigned long long') [-Wformat]
                  m_socket);
                  ^~~~~~~~
  1 warning generated.
  [2704/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\windows\Windows.cpp.obj
  F:\svn\lldb\source\Host\windows\Windows.cpp(87,19): warning: cast from 'const 
char *' to 'char *' drops const qualifier [-Wcast-qual]
    return ((char *)s);
                    ^
  1 warning generated.
  [2706/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\windows\ProcessLauncherWindows.cpp.obj
  F:\svn\lldb\source\Host\windows\ProcessLauncherWindows.cpp(33,43): warning: 
cast from 'const wchar_t *' to 'char *' drops const qualifier [-Wcast-qual]
        buffer.insert(buffer.end(), (char *)warg.c_str(),
                                            ^
  F:\svn\lldb\source\Host\windows\ProcessLauncherWindows.cpp(34,29): warning: 
cast from 'const wchar_t *' to 'char *' drops const qualifier [-Wcast-qual]
                      (char *)(warg.c_str() + warg.size() + 1));
                              ^
  2 warnings generated.
  [2944/3259] Building CXX object 
tools\lldb\source\Plugins\Process\Windows\Common...eFiles\lldbPluginProcessWindowsCommon.dir\x64\RegisterContextWindows_x64.cpp.obj
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(69,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(74,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(79,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(84,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(89,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(94,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(99,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(104,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(109,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(114,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(119,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(124,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(129,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(134,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(139,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(144,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(149,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(154,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
       nullptr},
              ^
  18 warnings generated.
  [2953/3259] Building CXX object 
tools\lldb\source\Plugins\Process\Windows\Common\CMakeFiles\lldbPluginProcessWindowsCommon.dir\TargetThreadWindows.cpp.obj
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\TargetThreadWindows.cpp(86,7):
 warning: unannotated fall-through between switch labels 
[-Wimplicit-fallthrough]
        default:
        ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\TargetThreadWindows.cpp(86,7):
 note: insert 'break;' to avoid fall-through
        default:
        ^
        break;
  1 warning generated.
  [2968/3259] Building CXX object 
tools\lldb\source\Plugins\Process\Windows\Common\CMakeFiles\lldbPluginProcessWindowsCommon.dir\ProcessWindows.cpp.obj
  F:\svn\lldb\source\Plugins\Process\Windows\Common\ProcessWindows.cpp(637,3): 
warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
    default: {
    ^
  F:\svn\lldb\source\Plugins\Process\Windows\Common\ProcessWindows.cpp(637,3): 
note: insert 'LLVM_FALLTHROUGH;' to silence this warning
    default: {
    ^
    LLVM_FALLTHROUGH;
  F:\svn\lldb\source\Plugins\Process\Windows\Common\ProcessWindows.cpp(637,3): 
note: insert 'break;' to avoid fall-through
    default: {
    ^
    break;
  1 warning generated.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D62021

Files:
  source/Host/common/GetOptInc.cpp
  source/Host/common/MainLoop.cpp
  source/Host/common/Socket.cpp
  source/Host/windows/ProcessLauncherWindows.cpp
  source/Host/windows/Windows.cpp
  source/Plugins/Process/Windows/Common/ProcessWindows.cpp
  source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
  source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp

Index: source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
===================================================================
--- source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
+++ source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
@@ -66,92 +66,128 @@
      {dwarf_rax_x86_64, dwarf_rax_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_rax_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rbx, nullptr),
      {dwarf_rbx_x86_64, dwarf_rbx_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_rbx_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rcx, nullptr),
      {dwarf_rcx_x86_64, dwarf_rcx_x86_64, LLDB_REGNUM_GENERIC_ARG1,
       LLDB_INVALID_REGNUM, lldb_rcx_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rdx, nullptr),
      {dwarf_rdx_x86_64, dwarf_rdx_x86_64, LLDB_REGNUM_GENERIC_ARG2,
       LLDB_INVALID_REGNUM, lldb_rdx_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rdi, nullptr),
      {dwarf_rdi_x86_64, dwarf_rdi_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_rdi_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rsi, nullptr),
      {dwarf_rsi_x86_64, dwarf_rsi_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_rsi_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rbp, "fp"),
      {dwarf_rbp_x86_64, dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP,
       LLDB_INVALID_REGNUM, lldb_rbp_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rsp, "sp"),
      {dwarf_rsp_x86_64, dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP,
       LLDB_INVALID_REGNUM, lldb_rsp_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r8, nullptr),
      {dwarf_r8_x86_64, dwarf_r8_x86_64, LLDB_REGNUM_GENERIC_ARG3,
       LLDB_INVALID_REGNUM, lldb_r8_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r9, nullptr),
      {dwarf_r9_x86_64, dwarf_r9_x86_64, LLDB_REGNUM_GENERIC_ARG4,
       LLDB_INVALID_REGNUM, lldb_r9_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r10, nullptr),
      {dwarf_r10_x86_64, dwarf_r10_x86_64, LLDB_REGNUM_GENERIC_ARG5,
       LLDB_INVALID_REGNUM, lldb_r10_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r11, nullptr),
      {dwarf_r11_x86_64, dwarf_r11_x86_64, LLDB_REGNUM_GENERIC_ARG6,
       LLDB_INVALID_REGNUM, lldb_r11_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r12, nullptr),
      {dwarf_r12_x86_64, dwarf_r12_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_r12_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r13, nullptr),
      {dwarf_r13_x86_64, dwarf_r13_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_r13_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r14, nullptr),
      {dwarf_r14_x86_64, dwarf_r14_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_r14_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(r15, nullptr),
      {dwarf_r15_x86_64, dwarf_r15_x86_64, LLDB_INVALID_REGNUM,
       LLDB_INVALID_REGNUM, lldb_r15_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR(rip, "pc"),
      {dwarf_rip_x86_64, dwarf_rip_x86_64, LLDB_REGNUM_GENERIC_PC,
       LLDB_INVALID_REGNUM, lldb_rip_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
     {DEFINE_GPR_BIN(eflags, "flags"),
      {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_FLAGS,
       LLDB_INVALID_REGNUM, lldb_rflags_x86_64},
      nullptr,
-     nullptr},
+     nullptr,
+     nullptr,
+     0},
 };
 
 static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
Index: source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
===================================================================
--- source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
+++ source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
@@ -83,6 +83,7 @@
 #else
         LLDB_LOG(log, "LLDB is 32-bit, but the target process is 64-bit.");
 #endif
+        LLVM_FALLTHROUGH;
       default:
         break;
       }
Index: source/Plugins/Process/Windows/Common/ProcessWindows.cpp
===================================================================
--- source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -631,6 +631,7 @@
                "Creating stop info with the exception.");
       // FALLTHROUGH:  We'll treat this as a generic exception record in the
       // default case.
+      LLVM_FALLTHROUGH;
     }
   }
 
Index: source/Host/windows/Windows.cpp
===================================================================
--- source/Host/windows/Windows.cpp
+++ source/Host/windows/Windows.cpp
@@ -84,7 +84,7 @@
     } while (strncasecmp(s, find, len) != 0);
     s--;
   }
-  return ((char *)s);
+  return const_cast<char *>(s);
 }
 
 char *realpath(const char *name, char *resolved) {
Index: source/Host/windows/ProcessLauncherWindows.cpp
===================================================================
--- source/Host/windows/ProcessLauncherWindows.cpp
+++ source/Host/windows/ProcessLauncherWindows.cpp
@@ -30,8 +30,11 @@
   for (const auto &KV : env) {
     std::wstring warg;
     if (llvm::ConvertUTF8toWide(Environment::compose(KV), warg)) {
-      buffer.insert(buffer.end(), (char *)warg.c_str(),
-                    (char *)(warg.c_str() + warg.size() + 1));
+      buffer.insert(
+          buffer.end(),
+          reinterpret_cast<char *>(const_cast<wchar_t *>(warg.c_str())),
+          reinterpret_cast<char *>(
+              const_cast<wchar_t *>(warg.c_str() + warg.size() + 1)));
     }
   }
   // One null wchar_t (to end the block) is two null bytes
Index: source/Host/common/Socket.cpp
===================================================================
--- source/Host/common/Socket.cpp
+++ source/Host/common/Socket.cpp
@@ -394,8 +394,8 @@
 
   Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
   if (log)
-    log->Printf("%p Socket::Close (fd = %i)", static_cast<void *>(this),
-                m_socket);
+    log->Printf("%p Socket::Close (fd = %" PRIu64 ")",
+                static_cast<void *>(this), static_cast<uint64_t>(m_socket));
 
 #if defined(_WIN32)
   bool success = !!closesocket(m_socket);
Index: source/Host/common/MainLoop.cpp
===================================================================
--- source/Host/common/MainLoop.cpp
+++ source/Host/common/MainLoop.cpp
@@ -61,10 +61,12 @@
 
 static sig_atomic_t g_signal_flags[NSIG];
 
+#ifndef SIGNAL_POLLING_UNSUPPORTED
 static void SignalHandler(int signo, siginfo_t *info, void *) {
   assert(signo < NSIG);
   g_signal_flags[signo] = 1;
 }
+#endif
 
 class MainLoop::RunImpl {
 public:
Index: source/Host/common/GetOptInc.cpp
===================================================================
--- source/Host/common/GetOptInc.cpp
+++ source/Host/common/GetOptInc.cpp
@@ -97,9 +97,9 @@
         pos += nopts;
       swap = nargv[pos];
       /* LINTED const cast */
-      ((char **)nargv)[pos] = nargv[cstart];
+      const_cast<char **>(nargv)[pos] = nargv[cstart];
       /* LINTED const cast */
-      ((char **)nargv)[cstart] = swap;
+      const_cast<char **>(nargv)[cstart] = swap;
     }
   }
 }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to