[Lldb-commits] [lldb] r373144 - [LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFC.

2019-09-28 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 28 02:33:44 2019
New Revision: 373144

URL: http://llvm.org/viewvc/llvm-project?rev=373144&view=rev
Log:
[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFC.

If there's any testcases that only do demangling (I didn't find any),
they could be made available for all platforms now.

Differential Revision: https://reviews.llvm.org/D68134

Modified:
lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=373144&r1=373143&r2=373144&view=diff
==
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Sat Sep 28 02:33:44 2019
@@ -8,13 +8,6 @@
 
 #include "lldb/Core/Mangled.h"
 
-#if defined(_WIN32)
-#include "lldb/Host/windows/windows.h"
-
-#include 
-#pragma comment(lib, "dbghelp.lib")
-#endif
-
 #include "lldb/Core/RichManglingContext.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Log.h"
@@ -39,25 +32,6 @@
 #include 
 using namespace lldb_private;
 
-#if defined(_MSC_VER)
-static DWORD safeUndecorateName(const char *Mangled, char *Demangled,
-DWORD DemangledLength) {
-  static std::mutex M;
-  std::lock_guard Lock(M);
-  return ::UnDecorateSymbolName(
-  Mangled, Demangled, DemangledLength,
-  UNDNAME_NO_ACCESS_SPECIFIERS |   // Strip public, private, protected
-   // keywords
-  UNDNAME_NO_ALLOCATION_LANGUAGE | // Strip __thiscall, __stdcall,
-   // etc keywords
-  UNDNAME_NO_THROW_SIGNATURES |// Strip throw() specifications
-  UNDNAME_NO_MEMBER_TYPE | // Strip virtual, static, etc
-   // specifiers
-  UNDNAME_NO_MS_KEYWORDS   // Strip all MS extension keywords
-  );
-}
-#endif
-
 static inline Mangled::ManglingScheme cstring_mangling_scheme(const char *s) {
   if (s) {
 if (s[0] == '?')
@@ -218,28 +192,16 @@ void Mangled::SetValue(ConstString name)
 
 // Local helpers for different demangling implementations.
 static char *GetMSVCDemangledStr(const char *M) {
-#if defined(_MSC_VER)
-  const size_t demangled_length = 2048;
-  char *demangled_cstr = static_cast(::malloc(demangled_length));
-  ::ZeroMemory(demangled_cstr, demangled_length);
-  DWORD result = safeUndecorateName(M, demangled_cstr, demangled_length);
+  char *demangled_cstr = llvm::microsoftDemangle(M, nullptr, nullptr, nullptr);
 
   if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) 
{
 if (demangled_cstr && demangled_cstr[0])
   LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M, demangled_cstr);
 else
-  LLDB_LOGF(log, "demangled msvc: %s -> error: 0x%lu", M, result);
+  LLDB_LOGF(log, "demangled msvc: %s -> error", M);
   }
 
-  if (result != 0) {
-return demangled_cstr;
-  } else {
-::free(demangled_cstr);
-return nullptr;
-  }
-#else
-  return nullptr;
-#endif
+  return demangled_cstr;
 }
 
 static char *GetItaniumDemangledStr(const char *M) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r373146 - Revert "[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFC."

2019-09-28 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 28 03:25:22 2019
New Revision: 373146

URL: http://llvm.org/viewvc/llvm-project?rev=373146&view=rev
Log:
Revert "[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp 
api. NFC."

This reverts SVN r373144, as it changed the demangled output a little, see
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9306.

Modified:
lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=373146&r1=373145&r2=373146&view=diff
==
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Sat Sep 28 03:25:22 2019
@@ -8,6 +8,13 @@
 
 #include "lldb/Core/Mangled.h"
 
+#if defined(_WIN32)
+#include "lldb/Host/windows/windows.h"
+
+#include 
+#pragma comment(lib, "dbghelp.lib")
+#endif
+
 #include "lldb/Core/RichManglingContext.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Log.h"
@@ -32,6 +39,25 @@
 #include 
 using namespace lldb_private;
 
+#if defined(_MSC_VER)
+static DWORD safeUndecorateName(const char *Mangled, char *Demangled,
+DWORD DemangledLength) {
+  static std::mutex M;
+  std::lock_guard Lock(M);
+  return ::UnDecorateSymbolName(
+  Mangled, Demangled, DemangledLength,
+  UNDNAME_NO_ACCESS_SPECIFIERS |   // Strip public, private, protected
+   // keywords
+  UNDNAME_NO_ALLOCATION_LANGUAGE | // Strip __thiscall, __stdcall,
+   // etc keywords
+  UNDNAME_NO_THROW_SIGNATURES |// Strip throw() specifications
+  UNDNAME_NO_MEMBER_TYPE | // Strip virtual, static, etc
+   // specifiers
+  UNDNAME_NO_MS_KEYWORDS   // Strip all MS extension keywords
+  );
+}
+#endif
+
 static inline Mangled::ManglingScheme cstring_mangling_scheme(const char *s) {
   if (s) {
 if (s[0] == '?')
@@ -192,16 +218,28 @@ void Mangled::SetValue(ConstString name)
 
 // Local helpers for different demangling implementations.
 static char *GetMSVCDemangledStr(const char *M) {
-  char *demangled_cstr = llvm::microsoftDemangle(M, nullptr, nullptr, nullptr);
+#if defined(_MSC_VER)
+  const size_t demangled_length = 2048;
+  char *demangled_cstr = static_cast(::malloc(demangled_length));
+  ::ZeroMemory(demangled_cstr, demangled_length);
+  DWORD result = safeUndecorateName(M, demangled_cstr, demangled_length);
 
   if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) 
{
 if (demangled_cstr && demangled_cstr[0])
   LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M, demangled_cstr);
 else
-  LLDB_LOGF(log, "demangled msvc: %s -> error", M);
+  LLDB_LOGF(log, "demangled msvc: %s -> error: 0x%lu", M, result);
   }
 
-  return demangled_cstr;
+  if (result != 0) {
+return demangled_cstr;
+  } else {
+::free(demangled_cstr);
+return nullptr;
+  }
+#else
+  return nullptr;
+#endif
 }
 
 static char *GetItaniumDemangledStr(const char *M) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r374526 - [LLDB] [Driver] Use llvm::InitLLVM to do unicode argument conversion on Windows

2019-10-11 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Fri Oct 11 01:44:51 2019
New Revision: 374526

URL: http://llvm.org/viewvc/llvm-project?rev=374526&view=rev
Log:
[LLDB] [Driver] Use llvm::InitLLVM to do unicode argument conversion on Windows

This avoids the currently MSVC specific codepath of using the
wchar entry point and converting that to utf8.

Differential Revision: https://reviews.llvm.org/D68770

Modified:
lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=374526&r1=374525&r2=374526&view=diff
==
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Fri Oct 11 01:44:51 2019
@@ -19,8 +19,8 @@
 #include "lldb/API/SBStringList.h"
 
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Format.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"
@@ -807,23 +807,9 @@ llvm::Optional InitializeReproducer
   return llvm::None;
 }
 
-int
-#ifdef _MSC_VER
-wmain(int argc, wchar_t const *wargv[])
-#else
-main(int argc, char const *argv[])
-#endif
+int main(int argc, char const *argv[])
 {
-#ifdef _MSC_VER
-  // Convert wide arguments to UTF-8
-  std::vector argvStrings(argc);
-  std::vector argvPointers(argc);
-  for (int i = 0; i != argc; ++i) {
-llvm::convertWideToUTF8(wargv[i], argvStrings[i]);
-argvPointers[i] = argvStrings[i].c_str();
-  }
-  const char **argv = argvPointers.data();
-#endif
+  llvm::InitLLVM IL(argc, argv);
 
   // Print stack trace on crash.
   llvm::StringRef ToolName = llvm::sys::path::filename(argv[0]);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r374537 - [LLDB] [lldb-server] Use llvm::InitLLVM for doing unicode conversion of arguments for windows

2019-10-11 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Fri Oct 11 04:47:07 2019
New Revision: 374537

URL: http://llvm.org/viewvc/llvm-project?rev=374537&view=rev
Log:
[LLDB] [lldb-server] Use llvm::InitLLVM for doing unicode conversion of 
arguments for windows

This should allow lldb-server to operate on files with non-ascii
pathnames.

I tried looking around in lldb/tools, and this seemed like the only
other tool (other than the main lldb driver itself) that would be
used (implicitly) by an end user (which could be working in
non-ascii paths).

Differential Revision: https://reviews.llvm.org/D68864

Modified:
lldb/trunk/tools/lldb-server/lldb-server.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-server.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-server.cpp?rev=374537&r1=374536&r2=374537&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-server.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-server.cpp Fri Oct 11 04:47:07 2019
@@ -12,6 +12,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Signals.h"
@@ -48,6 +49,7 @@ static void terminate_debugger() { g_deb
 
 // main
 int main(int argc, char *argv[]) {
+  llvm::InitLLVM IL(argc, argv);
   llvm::StringRef ToolName = argv[0];
   llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
   llvm::PrettyStackTraceProgram X(argc, argv);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r374866 - [LLDB] [Windows] Initial support for ARM64 register contexts

2019-10-15 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Oct 15 01:31:52 2019
New Revision: 374866

URL: http://llvm.org/viewvc/llvm-project?rev=374866&view=rev
Log:
[LLDB] [Windows] Initial support for ARM64 register contexts

Differential Revision: https://reviews.llvm.org/D67954

Added:

lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp

lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
lldb/trunk/source/Plugins/Process/Windows/Common/arm64/

lldb/trunk/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp

lldb/trunk/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.h
lldb/trunk/test/Shell/Register/Inputs/aarch64-fp-read.cpp
lldb/trunk/test/Shell/Register/Inputs/aarch64-gp-read.cpp
lldb/trunk/test/Shell/Register/aarch64-fp-read.test
lldb/trunk/test/Shell/Register/aarch64-gp-read.test
Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt?rev=374866&r1=374865&r2=374866&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt Tue Oct 15 
01:31:52 2019
@@ -4,6 +4,7 @@ add_lldb_library(lldbPluginProcessWindow
   LocalDebugDelegate.cpp
   NativeProcessWindows.cpp
   NativeRegisterContextWindows.cpp
+  NativeRegisterContextWindows_arm64.cpp
   NativeRegisterContextWindows_i386.cpp
   NativeRegisterContextWindows_WoW64.cpp
   NativeRegisterContextWindows_x86_64.cpp
@@ -13,9 +14,10 @@ add_lldb_library(lldbPluginProcessWindow
   ProcessWindowsLog.cpp
   RegisterContextWindows.cpp
   TargetThreadWindows.cpp
+  arm64/RegisterContextWindows_arm64.cpp
   x64/RegisterContextWindows_x64.cpp
   x86/RegisterContextWindows_x86.cpp
-  # TODO add support for ARM (NT) and ARM64
+  # TODO add support for ARM (NT)
 
   LINK_LIBS
 lldbCore

Added: 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp?rev=374866&view=auto
==
--- 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
 (added)
+++ 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
 Tue Oct 15 01:31:52 2019
@@ -0,0 +1,755 @@
+//===-- NativeRegisterContextWindows_arm64.cpp --*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#if defined(__aarch64__) || defined(_M_ARM64)
+
+#include "NativeRegisterContextWindows_arm64.h"
+#include "NativeThreadWindows.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "ProcessWindowsLog.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/HostThread.h"
+#include "lldb/Host/windows/HostThreadWindows.h"
+#include "lldb/Host/windows/windows.h"
+
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/RegisterValue.h"
+#include "llvm/ADT/STLExtras.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+#define REG_CONTEXT_SIZE sizeof(::CONTEXT)
+
+namespace {
+static const uint32_t g_gpr_regnums_arm64[] = {
+gpr_x0_arm64,   gpr_x1_arm64,   gpr_x2_arm64,  gpr_x3_arm64,
+gpr_x4_arm64,   gpr_x5_arm64,   gpr_x6_arm64,  gpr_x7_arm64,
+gpr_x8_arm64,   gpr_x9_arm64,   gpr_x10_arm64, gpr_x11_arm64,
+gpr_x12_arm64,  gpr_x13_arm64,  gpr_x14_arm64, gpr_x15_arm64,
+gpr_x16_arm64,  gpr_x17_arm64,  gpr_x18_arm64, gpr_x19_arm64,
+gpr_x20_arm64,  gpr_x21_arm64,  gpr_x22_arm64, gpr_x23_arm64,
+gpr_x24_arm64,  gpr_x25_arm64,  gpr_x26_arm64, gpr_x27_arm64,
+gpr_x28_arm64,  gpr_fp_arm64,   gpr_lr_arm64,  gpr_sp_arm64,
+gpr_pc_arm64,   gpr_cpsr_arm64, gpr_w0_arm64,  gpr_w1_arm64,
+gpr_w2_arm64,   gpr_w3_arm64,   gpr_w4_arm64,  gpr_w5_arm64,
+gpr_w6_arm64,   gpr_w7_arm64,   gpr_w8_arm64,  gpr_w9_arm64,
+gpr_w10_arm64,  gpr_w11_arm64,  gpr_w12_arm64, gpr_w13_arm64,
+gpr_w14_arm64,  gpr_w15_arm64,  gpr_w16_arm64, gpr_w17_arm64,
+gpr_w18_arm64,  gpr_w19_arm64,  gpr_w20_arm64, gpr_w21_arm64,
+gpr_w22_arm64,  gpr_w23_arm64,  gpr_w24_arm64, gpr_w25_arm64,
+gpr_w26_arm64,  gpr_w27_arm64,  gpr_w28_arm64,
+LLDB_INVALID_REGNUM // Register set mu

[Lldb-commits] [lldb] r375034 - [LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFCI.

2019-10-16 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Wed Oct 16 12:39:56 2019
New Revision: 375034

URL: http://llvm.org/viewvc/llvm-project?rev=375034&view=rev
Log:
[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. 
NFCI.

Differential Revision: https://reviews.llvm.org/D68134

Modified:
lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=375034&r1=375033&r2=375034&view=diff
==
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Wed Oct 16 12:39:56 2019
@@ -8,13 +8,6 @@
 
 #include "lldb/Core/Mangled.h"
 
-#if defined(_WIN32)
-#include "lldb/Host/windows/windows.h"
-
-#include 
-#pragma comment(lib, "dbghelp.lib")
-#endif
-
 #include "lldb/Core/RichManglingContext.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Log.h"
@@ -39,25 +32,6 @@
 #include 
 using namespace lldb_private;
 
-#if defined(_MSC_VER)
-static DWORD safeUndecorateName(const char *Mangled, char *Demangled,
-DWORD DemangledLength) {
-  static std::mutex M;
-  std::lock_guard Lock(M);
-  return ::UnDecorateSymbolName(
-  Mangled, Demangled, DemangledLength,
-  UNDNAME_NO_ACCESS_SPECIFIERS |   // Strip public, private, protected
-   // keywords
-  UNDNAME_NO_ALLOCATION_LANGUAGE | // Strip __thiscall, __stdcall,
-   // etc keywords
-  UNDNAME_NO_THROW_SIGNATURES |// Strip throw() specifications
-  UNDNAME_NO_MEMBER_TYPE | // Strip virtual, static, etc
-   // specifiers
-  UNDNAME_NO_MS_KEYWORDS   // Strip all MS extension keywords
-  );
-}
-#endif
-
 static inline Mangled::ManglingScheme cstring_mangling_scheme(const char *s) {
   if (s) {
 if (s[0] == '?')
@@ -200,28 +174,20 @@ void Mangled::SetValue(ConstString name)
 
 // Local helpers for different demangling implementations.
 static char *GetMSVCDemangledStr(const char *M) {
-#if defined(_MSC_VER)
-  const size_t demangled_length = 2048;
-  char *demangled_cstr = static_cast(::malloc(demangled_length));
-  ::ZeroMemory(demangled_cstr, demangled_length);
-  DWORD result = safeUndecorateName(M, demangled_cstr, demangled_length);
+  char *demangled_cstr = llvm::microsoftDemangle(
+  M, nullptr, nullptr, nullptr,
+  llvm::MSDemangleFlags(llvm::MSDF_NoAccessSpecifier |
+llvm::MSDF_NoCallingConvention |
+llvm::MSDF_NoMemberType));
 
   if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) 
{
 if (demangled_cstr && demangled_cstr[0])
   LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M, demangled_cstr);
 else
-  LLDB_LOGF(log, "demangled msvc: %s -> error: 0x%lu", M, result);
+  LLDB_LOGF(log, "demangled msvc: %s -> error", M);
   }
 
-  if (result != 0) {
-return demangled_cstr;
-  } else {
-::free(demangled_cstr);
-return nullptr;
-  }
-#else
-  return nullptr;
-#endif
+  return demangled_cstr;
 }
 
 static char *GetItaniumDemangledStr(const char *M) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r375156 - [LLDB] [test] Use %clang_cl instead of build.py in a few tests

2019-10-17 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Thu Oct 17 12:22:50 2019
New Revision: 375156

URL: http://llvm.org/viewvc/llvm-project?rev=375156&view=rev
Log:
[LLDB] [test] Use %clang_cl instead of build.py in a few tests

This allows explicitly specifying the intended target architecture,
for tests that aren't supposed to be executed, and that don't
require MSVC headers or libraries to be available.

(These tests already implicitly assumed to be built for x86; one
didn't specify anything, assuming x86_64, while the other specified
--arch=32, which only picks the 32 bit variant of the default target
architecture).

Join two comment lines in disassembly.cpp, to keep row numbers
checked in the test unchanged.

This fixes running check-lldb on arm linux.

Differential Revision: https://reviews.llvm.org/D69031

Modified:
lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp
lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp

Modified: lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp?rev=375156&r1=375155&r2=375156&view=diff
==
--- lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp (original)
+++ lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp Thu Oct 17 
12:22:50 2019
@@ -2,12 +2,12 @@
 // REQUIRES: lld
 
 // Test that we can show disassembly and source.
-// RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s 
+// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
+// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe 
-pdb:%t.pdb
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
 // RUN: %p/Inputs/disassembly.lldbinit | FileCheck %s
 
-// Some context lines before
-// the function.
+// Some context lines before the function.
 
 int foo() { return 42; }
 

Modified: 
lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp?rev=375156&r1=375155&r2=375156&view=diff
==
--- lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp 
(original)
+++ lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp 
Thu Oct 17 12:22:50 2019
@@ -1,7 +1,8 @@
 // clang-format off
 // REQUIRES: lld
 
-// RUN: %build --compiler=clang-cl --arch=32 --nodefaultlib -o %t.exe -- %s 
+// RUN: %clang_cl --target=i386-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
+// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe 
-pdb:%t.pdb
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
 // RUN: %p/Inputs/function-types-calling-conv.lldbinit | FileCheck %s
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r375163 - Revert "[LLDB] [test] Use %clang_cl instead of build.py in a few tests"

2019-10-17 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Thu Oct 17 13:14:19 2019
New Revision: 375163

URL: http://llvm.org/viewvc/llvm-project?rev=375163&view=rev
Log:
Revert "[LLDB] [test] Use %clang_cl instead of build.py in a few tests"

This reverts SVN r375156, as it seems to have broken tests when run
on macOS: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2706/console

Modified:
lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp
lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp

Modified: lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp?rev=375163&r1=375162&r2=375163&view=diff
==
--- lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp (original)
+++ lldb/trunk/test/Shell/SymbolFile/NativePDB/disassembly.cpp Thu Oct 17 
13:14:19 2019
@@ -2,12 +2,12 @@
 // REQUIRES: lld
 
 // Test that we can show disassembly and source.
-// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
-// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe 
-pdb:%t.pdb
+// RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s 
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
 // RUN: %p/Inputs/disassembly.lldbinit | FileCheck %s
 
-// Some context lines before the function.
+// Some context lines before
+// the function.
 
 int foo() { return 42; }
 

Modified: 
lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp?rev=375163&r1=375162&r2=375163&view=diff
==
--- lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp 
(original)
+++ lldb/trunk/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp 
Thu Oct 17 13:14:19 2019
@@ -1,8 +1,7 @@
 // clang-format off
 // REQUIRES: lld
 
-// RUN: %clang_cl --target=i386-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
-// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe 
-pdb:%t.pdb
+// RUN: %build --compiler=clang-cl --arch=32 --nodefaultlib -o %t.exe -- %s 
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
 // RUN: %p/Inputs/function-types-calling-conv.lldbinit | FileCheck %s
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] a59444a - [LLDB] [Windows] Initial support for ARM register contexts

2019-10-21 Thread Martin Storsjo via lldb-commits

Author: Martin Storsjo
Date: 2019-10-21T08:02:34Z
New Revision: a59444a35608988e727fe3761e34f1fad6097617

URL: 
https://github.com/llvm/llvm-project/commit/a59444a35608988e727fe3761e34f1fad6097617
DIFF: 
https://github.com/llvm/llvm-project/commit/a59444a35608988e727fe3761e34f1fad6097617.diff

LOG: [LLDB] [Windows] Initial support for ARM register contexts

Differential Revision: https://reviews.llvm.org/D69226

llvm-svn: 375392

Added: 

lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp

lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.h

lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp
lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.h
lldb/test/Shell/Register/Inputs/arm-fp-read.cpp
lldb/test/Shell/Register/Inputs/arm-gp-read.cpp
lldb/test/Shell/Register/arm-fp-read.test
lldb/test/Shell/Register/arm-gp-read.test

Modified: 
lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
lldb/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
llvm/utils/lit/lit/llvm/config.py

Removed: 




diff  --git a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt 
b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
index d0d3fcbee6f4..876bc8cab966 100644
--- a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
@@ -4,6 +4,7 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
   LocalDebugDelegate.cpp
   NativeProcessWindows.cpp
   NativeRegisterContextWindows.cpp
+  NativeRegisterContextWindows_arm.cpp
   NativeRegisterContextWindows_arm64.cpp
   NativeRegisterContextWindows_i386.cpp
   NativeRegisterContextWindows_WoW64.cpp
@@ -14,10 +15,10 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
   ProcessWindowsLog.cpp
   RegisterContextWindows.cpp
   TargetThreadWindows.cpp
+  arm/RegisterContextWindows_arm.cpp
   arm64/RegisterContextWindows_arm64.cpp
   x64/RegisterContextWindows_x64.cpp
   x86/RegisterContextWindows_x86.cpp
-  # TODO add support for ARM (NT)
 
   LINK_LIBS
 lldbCore

diff  --git 
a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
 
b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
new file mode 100644
index ..d25b08f7ecba
--- /dev/null
+++ 
b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
@@ -0,0 +1,644 @@
+//===-- NativeRegisterContextWindows_arm.cpp *- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#if defined(__arm__) || defined(_M_ARM)
+
+#include "NativeRegisterContextWindows_arm.h"
+#include "NativeThreadWindows.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "ProcessWindowsLog.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/HostThread.h"
+#include "lldb/Host/windows/HostThreadWindows.h"
+#include "lldb/Host/windows/windows.h"
+
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/RegisterValue.h"
+#include "llvm/ADT/STLExtras.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+#define REG_CONTEXT_SIZE sizeof(::CONTEXT)
+
+namespace {
+static const uint32_t g_gpr_regnums_arm[] = {
+gpr_r0_arm, gpr_r1_arm,   gpr_r2_arm,  gpr_r3_arm, gpr_r4_arm,
+gpr_r5_arm, gpr_r6_arm,   gpr_r7_arm,  gpr_r8_arm, gpr_r9_arm,
+gpr_r10_arm,gpr_r11_arm,  gpr_r12_arm, gpr_sp_arm, gpr_lr_arm,
+gpr_pc_arm, gpr_cpsr_arm,
+LLDB_INVALID_REGNUM // Register set must be terminated with this flag
+};
+static_assert(((sizeof g_gpr_regnums_arm / sizeof g_gpr_regnums_arm[0]) - 1) ==
+  k_num_gpr_registers_arm,
+  "g_gpr_regnums_arm has wrong number of register infos");
+
+static const uint32_t g_fpr_regnums_arm[] = {
+fpu_s0_arm, fpu_s1_arm,  fpu_s2_arm,  fpu_s3_arm,  fpu_s4_arm,
+fpu_s5_arm, fpu_s6_arm,  fpu_s7_arm,  fpu_s8_arm,  fpu_s9_arm,
+fpu_s10_arm,fpu_s11_arm, fpu_s12_arm, fpu_s13_arm, fpu_s14_arm,
+fpu_s15_arm,fpu_s16_arm, fpu_s17_arm, fpu_s18_arm, fpu_s19_arm,
+fpu_s20_arm,fpu_s21_arm, fpu_s22_arm, fpu_s23_arm, fpu_s24_arm,
+fpu_s25_arm,fpu_s26_arm, fpu_s27_arm, fpu_s28_arm, fpu_s29_arm,
+fpu_s30_arm,fpu_s31_arm,
+
+fpu_d0_arm, fpu_d1_arm,  fpu_d2_arm,  fpu_d3_arm,  fpu_d4_arm,
+fpu_d5_arm, fpu_d6_arm,  fpu_d7_arm,  fpu_d8_arm,  fpu_d9_arm,
+fpu_d10_arm,fpu_d11_arm, fpu_d12_arm, fpu_d13_arm, fpu_d14_arm,
+fpu_d15_arm,fpu_d16_arm, fpu_d1

[Lldb-commits] [lldb] r372483 - [LLDB] Check for the GCC/MinGW compatible arch defines for windows, in addition to MSVC defines

2019-09-21 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 21 12:09:49 2019
New Revision: 372483

URL: http://llvm.org/viewvc/llvm-project?rev=372483&view=rev
Log:
[LLDB] Check for the GCC/MinGW compatible arch defines for windows, in addition 
to MSVC defines

This matches how it is done in all other similar ifdefs throughout
lldb.

Differential Revision: https://reviews.llvm.org/D67858

Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp?rev=372483&r1=372482&r2=372483&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp 
Sat Sep 21 12:09:49 2019
@@ -84,7 +84,7 @@ bool RegisterContextWindows::AddHardware
   case 1:
   case 2:
   case 4:
-#if defined(_M_AMD64)
+#if defined(__x86_64__) || defined(_M_AMD64)
   case 8:
 #endif
 break;

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp?rev=372483&r1=372482&r2=372483&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp 
Sat Sep 21 12:09:49 2019
@@ -21,9 +21,9 @@
 #include "TargetThreadWindows.h"
 
 // TODO support _M_ARM and _M_ARM64
-#if defined(_M_AMD64)
+#if defined(__x86_64__) || defined(_M_AMD64)
 #include "x64/RegisterContextWindows_x64.h"
-#elif defined(_M_IX86)
+#elif defined(__i386__) || defined(_M_IX86)
 #include "x86/RegisterContextWindows_x86.h"
 #endif
 
@@ -77,7 +77,7 @@ TargetThreadWindows::CreateRegisterConte
 break;
 
   case llvm::Triple::x86:
-#if defined(_M_IX86)
+#if defined(__i386__) || defined(_M_IX86)
 m_thread_reg_ctx_sp.reset(
 new RegisterContextWindows_x86(*this, concrete_frame_idx));
 #else
@@ -86,7 +86,7 @@ TargetThreadWindows::CreateRegisterConte
 break;
 
   case llvm::Triple::x86_64:
-#if defined(_M_AMD64)
+#if defined(__x86_64__) || defined(_M_AMD64)
 m_thread_reg_ctx_sp.reset(
 new RegisterContextWindows_x64(*this, concrete_frame_idx));
 #else


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372482 - [LLDB] Fix compilation for MinGW, remove redundant class name on inline member

2019-09-21 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 21 12:09:43 2019
New Revision: 372482

URL: http://llvm.org/viewvc/llvm-project?rev=372482&view=rev
Log:
[LLDB] Fix compilation for MinGW, remove redundant class name on inline member

This fixes build errors like these:

NativeRegisterContextWindows.h:22:33: error: extra qualification on member 
'NativeRegisterContextWindows'
  NativeRegisterContextWindows::NativeRegisterContextWindows(
  ~~^

Differential Revision: https://reviews.llvm.org/D67856

Modified:

lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h?rev=372482&r1=372481&r2=372482&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h 
Sat Sep 21 12:09:43 2019
@@ -19,7 +19,7 @@ class NativeThreadWindows;
 
 class NativeRegisterContextWindows : public NativeRegisterContextRegisterInfo {
 public:
-  NativeRegisterContextWindows::NativeRegisterContextWindows(
+  NativeRegisterContextWindows(
   NativeThreadProtocol &native_thread,
   RegisterInfoInterface *reg_info_interface_p);
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372485 - [LLDB] Use SetErrorStringWithFormatv for cases that use LLVM style format strings

2019-09-21 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 21 12:10:00 2019
New Revision: 372485

URL: http://llvm.org/viewvc/llvm-project?rev=372485&view=rev
Log:
[LLDB] Use SetErrorStringWithFormatv for cases that use LLVM style format 
strings

SetErrorStringWithFormat only supports normal printf style format
strings.

Differential Revision: https://reviews.llvm.org/D67862

Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp?rev=372485&r1=372484&r2=372485&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp 
Sat Sep 21 12:10:00 2019
@@ -177,9 +177,9 @@ Status NativeProcessWindows::Detach() {
 else
   LLDB_LOG(log, "Detaching process error: {0}", error);
   } else {
-error.SetErrorStringWithFormat("error: process {0} in state = {1}, but "
-   "cannot detach it in this state.",
-   GetID(), state);
+error.SetErrorStringWithFormatv("error: process {0} in state = {1}, but "
+"cannot detach it in this state.",
+GetID(), state);
 LLDB_LOG(log, "error: {0}", error);
   }
   return error;

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp?rev=372485&r1=372484&r2=372485&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp Sat Sep 
21 12:10:00 2019
@@ -170,9 +170,9 @@ Status ProcessWindows::DoDetach(bool kee
 else
   LLDB_LOG(log, "Detaching process error: {0}", error);
   } else {
-error.SetErrorStringWithFormat("error: process {0} in state = {1}, but "
-   "cannot detach it in this state.",
-   GetID(), private_state);
+error.SetErrorStringWithFormatv("error: process {0} in state = {1}, but "
+"cannot detach it in this state.",
+GetID(), private_state);
 LLDB_LOG(log, "error: {0}", error);
   }
   return error;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372486 - [LLDB] Cast -1 (as invalid socket) to the socket type before comparing

2019-09-21 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 21 12:10:15 2019
New Revision: 372486

URL: http://llvm.org/viewvc/llvm-project?rev=372486&view=rev
Log:
[LLDB] Cast -1 (as invalid socket) to the socket type before comparing

This silences warnings about comparison of integers between unsigned
long long (which is what the Windows SOCKET type is) and signed int
when building in MinGW mode.

Differential Revision: https://reviews.llvm.org/D67863

Modified:
lldb/trunk/source/Host/common/Socket.cpp
lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp

Modified: lldb/trunk/source/Host/common/Socket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=372486&r1=372485&r2=372486&view=diff
==
--- lldb/trunk/source/Host/common/Socket.cpp (original)
+++ lldb/trunk/source/Host/common/Socket.cpp Sat Sep 21 12:10:15 2019
@@ -476,11 +476,11 @@ NativeSocket Socket::AcceptSocket(Native
   if (!child_processes_inherit) {
 flags |= SOCK_CLOEXEC;
   }
-  NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept4,
-  sockfd, addr, addrlen, flags);
+  NativeSocket fd = llvm::sys::RetryAfterSignal(
+  static_cast(-1), ::accept4, sockfd, addr, addrlen, flags);
 #else
-  NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept,
-  sockfd, addr, addrlen);
+  NativeSocket fd = llvm::sys::RetryAfterSignal(
+  static_cast(-1), ::accept, sockfd, addr, addrlen);
 #endif
   if (fd == kInvalidSocketValue)
 SetLastError(error);

Modified: lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp?rev=372486&r1=372485&r2=372486&view=diff
==
--- lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp Sat Sep 21 12:10:15 2019
@@ -93,8 +93,9 @@ SOCKET AcceptConnection(int portno) {
 } else {
   listen(sockfd, 5);
   socklen_t clilen = sizeof(cli_addr);
-  newsockfd = llvm::sys::RetryAfterSignal(-1, accept,
-  sockfd, (struct sockaddr *)&cli_addr, &clilen);
+  newsockfd =
+  llvm::sys::RetryAfterSignal(static_cast(-1), accept, sockfd,
+  (struct sockaddr *)&cli_addr, &clilen);
   if (newsockfd < 0)
 if (g_vsc.log)
   *g_vsc.log << "error: accept (" << strerror(errno) << ")"


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372484 - [LLDB] Use LLVM_FALLTHROUGH instead of a custom comment

2019-09-21 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Sat Sep 21 12:09:54 2019
New Revision: 372484

URL: http://llvm.org/viewvc/llvm-project?rev=372484&view=rev
Log:
[LLDB] Use LLVM_FALLTHROUGH instead of a custom comment

This fixes a warning when built with Clang in MinGW mode.

Differential Revision: https://reviews.llvm.org/D67860

Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp?rev=372484&r1=372483&r2=372484&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp 
Sat Sep 21 12:09:54 2019
@@ -479,7 +479,7 @@ NativeProcessWindows::OnDebugException(b
   return ExceptionResult::BreakInDebugger;
 }
 
-// Fall through
+LLVM_FALLTHROUGH;
   default:
 LLDB_LOG(log,
  "Debugger thread reported exception {0:x} at address {1:x} "


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372587 - [LLDB] Add a missing specification of linking against dbghelp

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:08 2019
New Revision: 372587

URL: http://llvm.org/viewvc/llvm-project?rev=372587&view=rev
Log:
[LLDB] Add a missing specification of linking against dbghelp

The PECOFF object file plugin uses the dbghelp API, but doesn't
specify that it has to be linked in anywhere.

Current MSVC based builds have probably succeeded, as other parts
in LLDB have had a "#pragma comment(lib, "dbghelp.lib")", but there's
currently no such pragma in the PECOFF plugin.

The "#pragma comment(lib, ...)" approach doesn't work in MinGW mode
(unless the compiler is given the -fms-extensions option, and even
then, it's only supported by clang/lld, not by GCC/binutils), thus
add it to be linked via CMake. (The other parts of LLDB that use
dbghelp are within _MSC_VER ifdefs.)

Differential Revision: https://reviews.llvm.org/D67885

Modified:
lldb/trunk/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt?rev=372587&r1=372586&r2=372587&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt Mon Sep 23 
05:03:08 2019
@@ -1,3 +1,10 @@
+# Dbghelp is used on windows for writing minidump files.
+if(WIN32)
+  set(DBGHELP_LINK_FILES dbghelp)
+else()
+  set(DBGHELP_LINK_FILES "")
+endif()
+
 add_lldb_library(lldbPluginObjectFilePECOFF PLUGIN
   ObjectFilePECOFF.cpp
   WindowsMiniDump.cpp
@@ -7,6 +14,7 @@ add_lldb_library(lldbPluginObjectFilePEC
 lldbHost
 lldbSymbol
 lldbTarget
+${DBGHELP_LINK_FILES}
   LINK_COMPONENTS
 BinaryFormat
 Support


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372586 - [LLDB] Use the Windows SOCKET type on all windows targets, not only MSVC

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:02:59 2019
New Revision: 372586

URL: http://llvm.org/viewvc/llvm-project?rev=372586&view=rev
Log:
[LLDB] Use the Windows SOCKET type on all windows targets, not only MSVC

Differential Revision: https://reviews.llvm.org/D67859

Modified:
lldb/trunk/include/lldb/Host/Socket.h

Modified: lldb/trunk/include/lldb/Host/Socket.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Socket.h?rev=372586&r1=372585&r2=372586&view=diff
==
--- lldb/trunk/include/lldb/Host/Socket.h (original)
+++ lldb/trunk/include/lldb/Host/Socket.h Mon Sep 23 05:02:59 2019
@@ -31,7 +31,7 @@ class StringRef;
 
 namespace lldb_private {
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 typedef SOCKET NativeSocket;
 #else
 typedef int NativeSocket;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372589 - [LLDB] Avoid a warning about an unused static variable

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:21 2019
New Revision: 372589

URL: http://llvm.org/viewvc/llvm-project?rev=372589&view=rev
Log:
[LLDB] Avoid a warning about an unused static variable

The variable is unused on windows.

Differential Revision: https://reviews.llvm.org/D67895

Modified:
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=372589&r1=372588&r2=372589&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Mon Sep 23 05:03:21 2019
@@ -108,10 +108,10 @@ static struct option g_long_options[] =
 {"fd", required_argument, nullptr, 'F'},
 {nullptr, 0, nullptr, 0}};
 
+#ifndef _WIN32
 // Watch for signals
 static int g_sighup_received_count = 0;
 
-#ifndef _WIN32
 static void sighup_handler(MainLoopBase &mainloop) {
   ++g_sighup_received_count;
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372590 - [LLDB] Add a void* cast when passing object pointers to printf %p

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:28 2019
New Revision: 372590

URL: http://llvm.org/viewvc/llvm-project?rev=372590&view=rev
Log:
[LLDB] Add a void* cast when passing object pointers to printf %p

This fixes build warnings in MinGW mode.

Also remove leftover if (log) {} around the log macro.

Differential Revision: https://reviews.llvm.org/D67896

Modified:
lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp

Modified: lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp?rev=372590&r1=372589&r2=372590&view=diff
==
--- lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp Mon Sep 23 
05:03:28 2019
@@ -245,13 +245,11 @@ finish:
 
   IncrementFilePointer(return_info.GetBytes());
   Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
-  if (log) {
-LLDB_LOGF(log,
-  "%p ConnectionGenericFile::Read()  handle = %p, dst = %p, "
-  "dst_len = %zu) => %zu, error = %s",
-  this, m_file, dst, dst_len, return_info.GetBytes(),
-  return_info.GetError().AsCString());
-  }
+  LLDB_LOGF(log,
+"%p ConnectionGenericFile::Read()  handle = %p, dst = %p, "
+"dst_len = %zu) => %zu, error = %s",
+static_cast(this), m_file, dst, dst_len,
+return_info.GetBytes(), return_info.GetError().AsCString());
 
   return return_info.GetBytes();
 }
@@ -296,13 +294,11 @@ finish:
 
   IncrementFilePointer(return_info.GetBytes());
   Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
-  if (log) {
-LLDB_LOGF(log,
-  "%p ConnectionGenericFile::Write()  handle = %p, src = %p, "
-  "src_len = %zu) => %zu, error = %s",
-  this, m_file, src, src_len, return_info.GetBytes(),
-  return_info.GetError().AsCString());
-  }
+  LLDB_LOGF(log,
+"%p ConnectionGenericFile::Write()  handle = %p, src = %p, "
+"src_len = %zu) => %zu, error = %s",
+static_cast(this), m_file, src, src_len,
+return_info.GetBytes(), return_info.GetError().AsCString());
   return return_info.GetBytes();
 }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372588 - [LLDB] Remove a stray semicolon. NFC.

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:14 2019
New Revision: 372588

URL: http://llvm.org/viewvc/llvm-project?rev=372588&view=rev
Log:
[LLDB] Remove a stray semicolon. NFC.

This fixes build warnings with at least GCC.

Modified:
lldb/trunk/source/Utility/Scalar.cpp

Modified: lldb/trunk/source/Utility/Scalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=372588&r1=372587&r2=372588&view=diff
==
--- lldb/trunk/source/Utility/Scalar.cpp (original)
+++ lldb/trunk/source/Utility/Scalar.cpp Mon Sep 23 05:03:14 2019
@@ -434,7 +434,7 @@ Scalar::Type Scalar::GetBestTypeForBitSi
 if (bit_size <= 512) return Scalar::e_uint512;
   }
   return Scalar::e_void;
-};
+}
 
 void Scalar::TruncOrExtendTo(Scalar::Type type, uint16_t bits) {
   switch (type) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372591 - [LLDB] Remove a now redundant windows specific workaround

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:33 2019
New Revision: 372591

URL: http://llvm.org/viewvc/llvm-project?rev=372591&view=rev
Log:
[LLDB] Remove a now redundant windows specific workaround

vsnprintf(NULL, 0, ...) works for measuring the needed string
size on all supported Windows variants; it's supported since
at least MSVC 2015 (and LLVM requires a newer version than that),
and works on both msvcrt.dll (since at least XP) and UCRT with MinGW.

The previous use of ifdefs was wrong as well, as __MINGW64__ only is
defined for 64 bit targets, and the define without trailing
underscores is never defined automatically (neither by clang nor
by gcc).

Differential Revision: https://reviews.llvm.org/D67861

Modified:
lldb/trunk/source/Host/windows/Windows.cpp

Modified: lldb/trunk/source/Host/windows/Windows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Windows.cpp?rev=372591&r1=372590&r2=372591&view=diff
==
--- lldb/trunk/source/Host/windows/Windows.cpp (original)
+++ lldb/trunk/source/Host/windows/Windows.cpp Mon Sep 23 05:03:33 2019
@@ -48,13 +48,8 @@ int vasprintf(char **ret, const char *fm
   size_t buflen;
   va_list ap2;
 
-#if defined(_MSC_VER) || defined(__MINGW64)
-  ap2 = ap;
-  len = _vscprintf(fmt, ap2);
-#else
   va_copy(ap2, ap);
   len = vsnprintf(NULL, 0, fmt, ap2);
-#endif
 
   if (len >= 0 &&
   (buf = (char *)malloc((buflen = (size_t)(len + 1 != NULL) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372592 - [LLDB] Check for _WIN32 instead of _MSC_VER for code specific to windows in general

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 05:03:56 2019
New Revision: 372592

URL: http://llvm.org/viewvc/llvm-project?rev=372592&view=rev
Log:
[LLDB] Check for _WIN32 instead of _MSC_VER for code specific to windows in 
general

These ifdefs contain code that isn't specific to MSVC but useful for
any windows target, like MinGW.

Differential Revision: https://reviews.llvm.org/D67893

Modified:
lldb/trunk/source/Core/IOHandler.cpp
lldb/trunk/source/Host/common/UDPSocket.cpp
lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
lldb/trunk/source/Utility/SelectHelper.cpp
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/source/Core/IOHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=372592&r1=372591&r2=372592&view=diff
==
--- lldb/trunk/source/Core/IOHandler.cpp (original)
+++ lldb/trunk/source/Core/IOHandler.cpp Mon Sep 23 05:03:56 2019
@@ -579,7 +579,7 @@ void IOHandlerEditline::PrintAsync(Strea
   else
 #endif
   {
-#ifdef _MSC_VER
+#ifdef _WIN32
 const char *prompt = GetPrompt();
 if (prompt) {
   // Back up over previous prompt using Windows API
@@ -594,7 +594,7 @@ void IOHandlerEditline::PrintAsync(Strea
 }
 #endif
 IOHandler::PrintAsync(stream, s, len);
-#ifdef _MSC_VER
+#ifdef _WIN32
 if (prompt)
   IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt,
 strlen(prompt));

Modified: lldb/trunk/source/Host/common/UDPSocket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/UDPSocket.cpp?rev=372592&r1=372591&r2=372592&view=diff
==
--- lldb/trunk/source/Host/common/UDPSocket.cpp (original)
+++ lldb/trunk/source/Host/common/UDPSocket.cpp Mon Sep 23 05:03:56 2019
@@ -80,7 +80,7 @@ Status UDPSocket::Connect(llvm::StringRe
   &service_info_list);
   if (err != 0) {
 error.SetErrorStringWithFormat(
-#if defined(_MSC_VER) && defined(UNICODE)
+#if defined(_WIN32) && defined(UNICODE)
 "getaddrinfo(%s, %s, &hints, &info) returned error %i (%S)",
 #else
 "getaddrinfo(%s, %s, &hints, &info) returned error %i (%s)",

Modified: lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp?rev=372592&r1=372591&r2=372592&view=diff
==
--- lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp Mon Sep 23 
05:03:56 2019
@@ -564,7 +564,7 @@ ConnectionFileDescriptor::BytesAvailable
   select_helper.SetTimeout(*timeout);
 
 select_helper.FDSetRead(handle);
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 // select() won't accept pipes on Windows.  The entire Windows codepath
 // needs to be converted over to using WaitForMultipleObjects and event
 // HANDLEs, but for now at least this will allow ::select() to not return

Modified: lldb/trunk/source/Utility/SelectHelper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SelectHelper.cpp?rev=372592&r1=372591&r2=372592&view=diff
==
--- lldb/trunk/source/Utility/SelectHelper.cpp (original)
+++ lldb/trunk/source/Utility/SelectHelper.cpp Mon Sep 23 05:03:56 2019
@@ -92,7 +92,7 @@ static void updateMaxFd(llvm::Optional(FD_SETSIZE));
 if (fd >= static_cast(FD_SETSIZE)) {
   error.SetErrorStringWithFormat("%i is too large for select()", fd);

Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=372592&r1=372591&r2=372592&view=diff
==
--- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Mon Sep 23 
05:03:56 2019
@@ -31,7 +31,7 @@
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/FileSpec.h"
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 #include "lldb/Host/windows/windows.h"
 #include 
 #endif
@@ -46,7 +46,7 @@ public:
 // Initialize and TearDown the plugin every time, so we get a brand new
 // AST every time so that modifications to the AST from each test don't
 // leak into the next test.
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 ::CoInitializeEx(nullptr, COINIT_MULTITHREADED);
 #endif
 
@@ -69,7 +69,7 @@ public:
 HostInfo::Terminate();
 FileSystem::Terminate();
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 ::CoUninitialize();
 #endif
   }


___
lldb-commits mailing list
lldb-commit

[Lldb-commits] [lldb] r372656 - [LLDB] Rework a MinGW build fix from D65691

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 13:43:11 2019
New Revision: 372656

URL: http://llvm.org/viewvc/llvm-project?rev=372656&view=rev
Log:
[LLDB] Rework a MinGW build fix from D65691

That change didn't contain any explanation for this bit. There shouldn't
be any need for a check for MinGW ifdefs here, as long as the include
uses lowercase windows.h (as is used consistently elsewhere in
the llvm projects).

Differential Revision: https://reviews.llvm.org/D67894

Modified:
lldb/trunk/tools/lldb-vscode/VSCode.cpp

Modified: lldb/trunk/tools/lldb-vscode/VSCode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/VSCode.cpp?rev=372656&r1=372655&r2=372656&view=diff
==
--- lldb/trunk/tools/lldb-vscode/VSCode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/VSCode.cpp Mon Sep 23 13:43:11 2019
@@ -15,10 +15,8 @@
 #include "llvm/Support/FormatVariadic.h"
 
 #if defined(_WIN32)
-#ifndef __MINGW32__
 #define NOMINMAX
-#include 
-#endif // __MINGW32__
+#include 
 #include 
 #include 
 #endif


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372657 - [LLDB] [PECOFF] Recognize arm64 executables

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 13:43:16 2019
New Revision: 372657

URL: http://llvm.org/viewvc/llvm-project?rev=372657&view=rev
Log:
[LLDB] [PECOFF] Recognize arm64 executables

Differential Revision: https://reviews.llvm.org/D67912

Modified:
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=372657&r1=372656&r2=372657&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Mon Sep 23 
13:43:16 2019
@@ -198,6 +198,10 @@ size_t ObjectFilePECOFF::GetModuleSpecif
 spec.SetTriple("arm-pc-windows");
 specs.Append(module_spec);
 break;
+  case MachineArm64:
+spec.SetTriple("aarch64-unknown-windows");
+specs.Append(module_spec);
+break;
   default:
 break;
   }
@@ -1200,6 +1204,7 @@ ArchSpec ObjectFilePECOFF::GetArchitectu
   case llvm::COFF::IMAGE_FILE_MACHINE_ARM:
   case llvm::COFF::IMAGE_FILE_MACHINE_ARMNT:
   case llvm::COFF::IMAGE_FILE_MACHINE_THUMB:
+  case llvm::COFF::IMAGE_FILE_MACHINE_ARM64:
 ArchSpec arch;
 arch.SetArchitecture(eArchTypeCOFF, machine, LLDB_INVALID_CPUTYPE,
  IsWindowsSubsystem() ? llvm::Triple::Win32


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372658 - [LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures

2019-09-23 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Mon Sep 23 13:43:22 2019
New Revision: 372658

URL: http://llvm.org/viewvc/llvm-project?rev=372658&view=rev
Log:
[LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures

Differential Revision: https://reviews.llvm.org/D67913

Modified:
lldb/trunk/source/Host/windows/Host.cpp

Modified: lldb/trunk/source/Host/windows/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Host.cpp?rev=372658&r1=372657&r2=372658&view=diff
==
--- lldb/trunk/source/Host/windows/Host.cpp (original)
+++ lldb/trunk/source/Host/windows/Host.cpp Mon Sep 23 13:43:22 2019
@@ -56,6 +56,10 @@ bool GetTripleForProcess(const FileSpec
 triple.setArch(llvm::Triple::x86_64);
   else if (machineType == 0x14c)
 triple.setArch(llvm::Triple::x86);
+  else if (machineType == 0x1c4)
+triple.setArch(llvm::Triple::arm);
+  else if (machineType == 0xaa64)
+triple.setArch(llvm::Triple::aarch64);
 
   return true;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372700 - [LLDB] Avoid warnings about redefining posix mode defines on MinGW

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 01:39:12 2019
New Revision: 372700

URL: http://llvm.org/viewvc/llvm-project?rev=372700&view=rev
Log:
[LLDB] Avoid warnings about redefining posix mode defines on MinGW

Since these defines were added in LLVM SVN r189364 in 2013,
mingw-w64 got defines for S_I?GRP, S_IRWXG, S_I?OTH and S_IRWXO
in 2015.

Also change the existing defined(_MSC_VER) into ifndef S_IRUSR, for
consistency.

Differential Revision: https://reviews.llvm.org/D67910

Modified:
lldb/trunk/include/lldb/Host/windows/PosixApi.h

Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=372700&r1=372699&r2=372700&view=diff
==
--- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original)
+++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Tue Sep 24 01:39:12 2019
@@ -31,20 +31,30 @@
 #define SIGKILL 9
 #define SIGSTOP 20
 
-#if defined(_MSC_VER)
+#ifndef S_IRUSR
 #define S_IRUSR S_IREAD  /* read, user */
 #define S_IWUSR S_IWRITE /* write, user */
 #define S_IXUSR 0/* execute, user */
 #endif
+#ifndef S_IRGRP
 #define S_IRGRP 0 /* read, group */
 #define S_IWGRP 0 /* write, group */
 #define S_IXGRP 0 /* execute, group */
+#endif
+#ifndef S_IROTH
 #define S_IROTH 0 /* read, others */
 #define S_IWOTH 0 /* write, others */
 #define S_IXOTH 0 /* execute, others */
+#endif
+#ifndef S_IRWXU
 #define S_IRWXU 0
+#endif
+#ifndef S_IRWXG
 #define S_IRWXG 0
+#endif
+#ifndef S_IRWXO
 #define S_IRWXO 0
+#endif
 
 #if HAVE_SYS_TYPES_H
 // pyconfig.h typedefs this.  We require python headers to be included before


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372699 - [LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 01:39:06 2019
New Revision: 372699

URL: http://llvm.org/viewvc/llvm-project?rev=372699&view=rev
Log:
[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures

While debugging on those architectures might not be supported yet,
the generic code should still be buildable. This file accesses x86
specific fields in the CONTEXT struct.

Differential Revision: https://reviews.llvm.org/D67911

Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp?rev=372699&r1=372698&r2=372699&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp 
Tue Sep 24 01:39:06 2019
@@ -84,7 +84,7 @@ bool RegisterContextWindows::AddHardware
   case 1:
   case 2:
   case 4:
-#if defined(__x86_64__) || defined(_M_AMD64)
+#if defined(_WIN64)
   case 8:
 #endif
 break;
@@ -95,6 +95,7 @@ bool RegisterContextWindows::AddHardware
   if (!CacheAllRegisterValues())
 return false;
 
+#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || 
defined(_M_AMD64)
   unsigned shift = 2 * slot;
   m_context.Dr7 |= 1ULL << shift;
 
@@ -109,6 +110,12 @@ bool RegisterContextWindows::AddHardware
   m_context.Dr7 |= (read ? 3ULL : (write ? 1ULL : 0)) << shift;
 
   return ApplyAllRegisterValues();
+
+#else
+  Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_REGISTERS);
+  LLDB_LOG(log, "hardware breakpoints not currently supported on this arch");
+  return false;
+#endif
 }
 
 bool RegisterContextWindows::RemoveHardwareBreakpoint(uint32_t slot) {
@@ -118,19 +125,25 @@ bool RegisterContextWindows::RemoveHardw
   if (!CacheAllRegisterValues())
 return false;
 
+#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || 
defined(_M_AMD64)
   unsigned shift = 2 * slot;
   m_context.Dr7 &= ~(1ULL << shift);
 
   return ApplyAllRegisterValues();
+#else
+  return false;
+#endif
 }
 
 uint32_t RegisterContextWindows::GetTriggeredHardwareBreakpointSlotId() {
   if (!CacheAllRegisterValues())
 return LLDB_INVALID_INDEX32;
 
+#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || 
defined(_M_AMD64)
   for (unsigned i = 0UL; i < NUM_HARDWARE_BREAKPOINT_SLOTS; i++)
 if (m_context.Dr6 & (1ULL << i))
   return i;
+#endif
 
   return LLDB_INVALID_INDEX32;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372739 - [LLDB] [test] Add a few missing cases of REQUIRES: python

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 05:20:33 2019
New Revision: 372739

URL: http://llvm.org/viewvc/llvm-project?rev=372739&view=rev
Log:
[LLDB] [test] Add a few missing cases of REQUIRES: python

Differential Revision: https://reviews.llvm.org/D67952

Modified:
lldb/trunk/lit/Commands/command-script-import.test
lldb/trunk/lit/Reproducer/TestSynchronous.test

Modified: lldb/trunk/lit/Commands/command-script-import.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/command-script-import.test?rev=372739&r1=372738&r2=372739&view=diff
==
--- lldb/trunk/lit/Commands/command-script-import.test (original)
+++ lldb/trunk/lit/Commands/command-script-import.test Tue Sep 24 05:20:33 2019
@@ -1,3 +1,4 @@
+# REQUIRES: python
 # RUN: echo 'b main' > %t.in
 # RUN: echo 'run' >> %t.in
 # RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in

Modified: lldb/trunk/lit/Reproducer/TestSynchronous.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestSynchronous.test?rev=372739&r1=372738&r2=372739&view=diff
==
--- lldb/trunk/lit/Reproducer/TestSynchronous.test (original)
+++ lldb/trunk/lit/Reproducer/TestSynchronous.test Tue Sep 24 05:20:33 2019
@@ -1,3 +1,4 @@
+# REQUIRES: python
 # Ensure that replay happens in synchronous mode.
 
 # RUN: rm -rf %t.repro


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372741 - [LLDB] Add tests for PECOFF arm architecture identification

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 05:20:52 2019
New Revision: 372741

URL: http://llvm.org/viewvc/llvm-project?rev=372741&view=rev
Log:
[LLDB] Add tests for PECOFF arm architecture identification

Add a test case for the change from SVN r372657, and for the
preexisting ARM identification.

Add a missing ArchDefinitionEntry for PECOFF/arm64, and tweak
the ArmNt case to set the architecture to armv7 (ArmNt never ran
on anything lower than that). (This avoids a case where
ArchSpec::MergeFrom would override the arch from arm to armv7 and
ArchSpec::CoreUpdated would reset the OS to unknown at the same time.)

Differential Revision: https://reviews.llvm.org/D67951

Added:
lldb/trunk/lit/Modules/PECOFF/basic-info-arm.yaml
lldb/trunk/lit/Modules/PECOFF/basic-info-arm64.yaml
Modified:
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/trunk/source/Utility/ArchSpec.cpp

Added: lldb/trunk/lit/Modules/PECOFF/basic-info-arm.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/PECOFF/basic-info-arm.yaml?rev=372741&view=auto
==
--- lldb/trunk/lit/Modules/PECOFF/basic-info-arm.yaml (added)
+++ lldb/trunk/lit/Modules/PECOFF/basic-info-arm.yaml Tue Sep 24 05:20:52 2019
@@ -0,0 +1,86 @@
+# RUN: yaml2obj %s > %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: Plugin name: pe-coff
+# CHECK: Architecture: armv7-pc-windows-msvc
+# CHECK: UUID: 
+# CHECK: Executable: true
+# CHECK: Stripped: false
+# CHECK: Type: executable
+# CHECK: Strata: user
+# CHECK: Base VM address: 0x4
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 4097
+  ImageBase:   4194304
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, 
IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, 
IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+  ExportTable:
+RelativeVirtualAddress: 0
+Size:0
+  ImportTable:
+RelativeVirtualAddress: 0
+Size:0
+  ResourceTable:
+RelativeVirtualAddress: 0
+Size:0
+  ExceptionTable:
+RelativeVirtualAddress: 0
+Size:0
+  CertificateTable:
+RelativeVirtualAddress: 0
+Size:0
+  BaseRelocationTable:
+RelativeVirtualAddress: 0
+Size:0
+  Debug:
+RelativeVirtualAddress: 0
+Size:0
+  Architecture:
+RelativeVirtualAddress: 0
+Size:0
+  GlobalPtr:
+RelativeVirtualAddress: 0
+Size:0
+  TlsTable:
+RelativeVirtualAddress: 0
+Size:0
+  LoadConfigTable:
+RelativeVirtualAddress: 0
+Size:0
+  BoundImport:
+RelativeVirtualAddress: 0
+Size:0
+  IAT:
+RelativeVirtualAddress: 0
+Size:0
+  DelayImportDescriptor:
+RelativeVirtualAddress: 0
+Size:0
+  ClrRuntimeHeader:
+RelativeVirtualAddress: 0
+Size:0
+header:
+  Machine: IMAGE_FILE_MACHINE_ARMNT
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, 
IMAGE_SCN_MEM_READ ]
+VirtualAddress:  4096
+VirtualSize: 2
+SectionData: '7047'
+symbols: []
+...

Added: lldb/trunk/lit/Modules/PECOFF/basic-info-arm64.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/PECOFF/basic-info-arm64.yaml?rev=372741&view=auto
==
--- lldb/trunk/lit/Modules/PECOFF/basic-info-arm64.yaml (added)
+++ lldb/trunk/lit/Modules/PECOFF/basic-info-arm64.yaml Tue Sep 24 05:20:52 2019
@@ -0,0 +1,86 @@
+# RUN: yaml2obj %s > %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: Plugin name: pe-coff
+# CHECK: Architecture: aarch64-unknown-windows-msvc
+# CHECK: UUID: 
+# CHECK: Executable: true
+# CHECK: Stripped: false
+# CHECK: Type: executable
+# CHECK: Strata: user
+# CHECK: Base VM address: 0x4000
+
+--- !COFF
+OptionalHeader:
+  AddressOfEntryPoint: 4096
+  ImageBase:   1073741824
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_CUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, 
IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, 
IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+  SizeOfSta

[Lldb-commits] [lldb] r372738 - [LLDB] Fix typo in RegisterContextDarwin_arm64

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 05:20:21 2019
New Revision: 372738

URL: http://llvm.org/viewvc/llvm-project?rev=372738&view=rev
Log:
[LLDB] Fix typo in RegisterContextDarwin_arm64

In these cases, the register number should be calculated from
fpu_d0, not fpu_s0.

Differential Revision: https://reviews.llvm.org/D67892

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=372738&r1=372737&r2=372738&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
Tue Sep 24 05:20:21 2019
@@ -503,7 +503,7 @@ bool RegisterContextDarwin_arm64::ReadRe
   case fpu_d31: {
 ProcessSP process_sp(m_thread.GetProcess());
 if (process_sp.get()) {
-  DataExtractor regdata(&fpu.v[reg - fpu_s0], 8, 
process_sp->GetByteOrder(),
+  DataExtractor regdata(&fpu.v[reg - fpu_d0], 8, 
process_sp->GetByteOrder(),
 process_sp->GetAddressByteSize());
   offset_t offset = 0;
   value.SetDouble(regdata.GetDouble(&offset));


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372740 - [LLDB] [test] Allow differing order of some matches

2019-09-24 Thread Martin Storsjo via lldb-commits
Author: mstorsjo
Date: Tue Sep 24 05:20:38 2019
New Revision: 372740

URL: http://llvm.org/viewvc/llvm-project?rev=372740&view=rev
Log:
[LLDB] [test] Allow differing order of some matches

These can appear in a different order depending on the relative
layout of the source and build trees.

Differential Revision: https://reviews.llvm.org/D67953

Modified:
lldb/trunk/lit/Reproducer/TestDump.test

Modified: lldb/trunk/lit/Reproducer/TestDump.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestDump.test?rev=372740&r1=372739&r2=372740&view=diff
==
--- lldb/trunk/lit/Reproducer/TestDump.test (original)
+++ lldb/trunk/lit/Reproducer/TestDump.test Tue Sep 24 05:20:38 2019
@@ -8,8 +8,8 @@
 # RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' 
--capture --capture-path %t.repro %t/reproducer.out
 
 # RUN: %lldb -b -o 'reproducer dump -p files -f %t.repro' | FileCheck %s 
--check-prefix FILES
-# FILES: 'reproducer.out'
-# FILES: 'FileCapture.in'
+# FILES-DAG: 'reproducer.out'
+# FILES-DAG: 'FileCapture.in'
 
 # RUN: %lldb -b -o 'reproducer dump -p version -f %t.repro' | FileCheck %s 
--check-prefix VERSION
 # VERSION: lldb version


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits