[Lldb-commits] [lldb] r344746 - [SymbolFileNativePDB] Fix missing linkage to DebugInfoCodeView

2018-10-18 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Oct 18 08:39:22 2018
New Revision: 344746

URL: http://llvm.org/viewvc/llvm-project?rev=344746&view=rev
Log:
[SymbolFileNativePDB] Fix missing linkage to DebugInfoCodeView

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt?rev=344746&r1=344745&r2=344746&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt Thu Oct 18 
08:39:22 2018
@@ -11,6 +11,7 @@ add_lldb_library(lldbPluginSymbolFileNat
 lldbSymbol
  lldbUtility
   LINK_COMPONENTS
+DebugInfoCodeView
 DebugInfoPDB
 Support
   )


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


[Lldb-commits] [lldb] r334080 - [lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON

2018-06-06 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Jun  6 02:44:14 2018
New Revision: 334080

URL: http://llvm.org/viewvc/llvm-project?rev=334080&view=rev
Log:
[lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON

Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is
enabled.  Otherwise, those tests simply fail being unable to import lldb
module.

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

Modified:
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/Suite/lit.site.cfg.in
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=334080&r1=334079&r2=334080&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Wed Jun  6 02:44:14 2018
@@ -46,6 +46,7 @@ endif(BUILD_SHARED_LIBS)
 
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
+  LLDB_DISABLE_PYTHON
   LLVM_ENABLE_ZLIB)
 
 configure_lit_site_cfg(

Modified: lldb/trunk/lit/Suite/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.site.cfg.in?rev=334080&r1=334079&r2=334080&view=diff
==
--- lldb/trunk/lit/Suite/lit.site.cfg.in (original)
+++ lldb/trunk/lit/Suite/lit.site.cfg.in Wed Jun  6 02:44:14 2018
@@ -13,6 +13,7 @@ config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
 config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
+config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
 
 
 # Additional dotest arguments can be passed to lit by providing a

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=334080&r1=334079&r2=334080&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Wed Jun  6 02:44:14 2018
@@ -37,6 +37,9 @@ class LLDBTest(TestFormat):
 if litConfig.noExecute:
 return lit.Test.PASS, ''
 
+if test.config.lldb_disable_python:
+return (lit.Test.UNSUPPORTED, 'Python module disabled')
+
 if test.config.unsupported:
 return (lit.Test.UNSUPPORTED, 'Test is unsupported')
 


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


[Lldb-commits] [lldb] r321932 - [test] Use full PATH lookup for tools

2018-01-06 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Jan  6 02:20:25 2018
New Revision: 321932

URL: http://llvm.org/viewvc/llvm-project?rev=321932&view=rev
Log:
[test] Use full PATH lookup for tools

Use full PATH when looking up test tools rather than just llvm tools
directory. r320813 has added a lookup for 'lldb-test' which is part
of LLDB tools rather than LLVM, and therefore is not present
in llvm_tools_dir before LLDB is installed.

While technically we could introduce separate per-directory lookup
logic, there is no real reason not to use the PATH formed earlier here,
and this is what other tools are doing.

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

Modified:
lldb/trunk/lit/lit.cfg

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=321932&r1=321931&r2=321932&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Sat Jan  6 02:20:25 2018
@@ -91,11 +91,11 @@ for pattern in [r"\bFileCheck\b",
   pattern)
 tool_pipe = tool_match.group(2)
 tool_name = tool_match.group(4)
-tool_path = lit.util.which(tool_name, config.llvm_tools_dir)
+tool_path = lit.util.which(tool_name, config.environment['PATH'])
 if not tool_path:
 # Warn, but still provide a substitution.
 lit_config.note(
-'Did not find ' + tool_name + ' in ' + config.llvm_tools_dir)
+'Did not find ' + tool_name + ' in ' + config.environment['PATH'])
 config.substitutions.append((pattern, tool_pipe + tool_path))
 
 # Shell execution


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


[Lldb-commits] [lldb] r322081 - [test] Fix tests to use more portable LLVM_ENABLE_ZLIB

2018-01-09 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Jan  9 06:44:04 2018
New Revision: 322081

URL: http://llvm.org/viewvc/llvm-project?rev=322081&view=rev
Log:
[test] Fix tests to use more portable LLVM_ENABLE_ZLIB

The HAVE_LIBZ variable is not exported by LLVM, and therefore is not
available in stand-alone builds of other tools. Use LLVM_ENABLE_ZLIB
which is the name under which the effective value is exported.

Additional, use llvm_canonicalize_cmake_booleans() to make sure that
a correct (Python-safe) boolean value is passed down to lit.

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

Modified:
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/lit.site.cfg.in

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=322081&r1=322080&r2=322081&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Tue Jan  9 06:44:04 2018
@@ -11,6 +11,10 @@ else()
   set(ENABLE_SHARED 0)
 endif(BUILD_SHARED_LIBS)
 
+# the value is not canonicalized within LLVM
+llvm_canonicalize_cmake_booleans(
+  LLVM_ENABLE_ZLIB)
+
 configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)

Modified: lldb/trunk/lit/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.in?rev=322081&r1=322080&r2=322081&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.in (original)
+++ lldb/trunk/lit/lit.site.cfg.in Tue Jan  9 06:44:04 2018
@@ -12,7 +12,7 @@ config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.cc = "@LLDB_TEST_C_COMPILER@"
 config.cxx = "@LLDB_TEST_CXX_COMPILER@"
-config.have_zlib = @HAVE_LIBZ@
+config.have_zlib = @LLVM_ENABLE_ZLIB@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.


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


[Lldb-commits] [lldb] r323673 - [Host] Respect LLVM_LIBDIR_SUFFIX when looking for LLDB plugins on Linux

2018-01-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jan 29 10:25:06 2018
New Revision: 323673

URL: http://llvm.org/viewvc/llvm-project?rev=323673&view=rev
Log:
[Host] Respect LLVM_LIBDIR_SUFFIX when looking for LLDB plugins on Linux

Fix the Linux plugin lookup path to include appropriate libdir suffix
for the system. To accomplish this, store the value of
LLVM_LIBDIR_SUFFIX in lldb/Host/Config.h as LLDB_LIBDIR_SUFFIX,
and use this variable when defining the plugin path.

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

Modified:
lldb/trunk/include/lldb/Host/Config.h.cmake
lldb/trunk/source/Host/linux/HostInfoLinux.cpp

Modified: lldb/trunk/include/lldb/Host/Config.h.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=323673&r1=323672&r2=323673&view=diff
==
--- lldb/trunk/include/lldb/Host/Config.h.cmake (original)
+++ lldb/trunk/include/lldb/Host/Config.h.cmake Mon Jan 29 10:25:06 2018
@@ -14,6 +14,8 @@
 
 #cmakedefine LLDB_DISABLE_POSIX
 
+#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
+
 #cmakedefine01 HAVE_SYS_EVENT_H
 
 #cmakedefine01 HAVE_PPOLL

Modified: lldb/trunk/source/Host/linux/HostInfoLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostInfoLinux.cpp?rev=323673&r1=323672&r2=323673&view=diff
==
--- lldb/trunk/source/Host/linux/HostInfoLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostInfoLinux.cpp Mon Jan 29 10:25:06 2018
@@ -7,6 +7,7 @@
 //
 
//===--===//
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/linux/HostInfoLinux.h"
 #include "lldb/Utility/Log.h"
 
@@ -204,7 +205,7 @@ bool HostInfoLinux::ComputeSupportExeDir
 }
 
 bool HostInfoLinux::ComputeSystemPluginsDirectory(FileSpec &file_spec) {
-  FileSpec temp_file("/usr/lib/lldb/plugins", true);
+  FileSpec temp_file("/usr/lib" LLDB_LIBDIR_SUFFIX "/lldb/plugins", true);
   file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str());
   return true;
 }


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


[Lldb-commits] [lldb] r298776 - Expression: add missing linkage to RuntimeDyld component

2017-03-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Mar 25 13:51:29 2017
New Revision: 298776

URL: http://llvm.org/viewvc/llvm-project?rev=298776&view=rev
Log:
Expression: add missing linkage to RuntimeDyld component

Add missing linkage from lldbExpression library to LLVMRuntimeDyld.
Otherwise the build against shared LLVM libraries fails with:


lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):IRExecutionUnit.cpp:function 
llvm::RTDyldMemoryManager::deregisterEHFrames(unsigned char*, unsigned long, 
unsigned long): error: undefined reference to 
'llvm::RTDyldMemoryManager::deregisterEHFramesInProcess(unsigned char*, 
unsigned long)'

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

Modified:
lldb/trunk/source/Expression/CMakeLists.txt

Modified: lldb/trunk/source/Expression/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=298776&r1=298775&r2=298776&view=diff
==
--- lldb/trunk/source/Expression/CMakeLists.txt (original)
+++ lldb/trunk/source/Expression/CMakeLists.txt Sat Mar 25 13:51:29 2017
@@ -34,5 +34,6 @@ add_lldb_library(lldbExpression
   LINK_COMPONENTS
 Core
 ExecutionEngine
+RuntimeDyld
 Support
   )


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


[Lldb-commits] [lldb] r298777 - PluginUnwindAssemblyX86: add missing linkage to MCDisasm

2017-03-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Mar 25 13:51:37 2017
New Revision: 298777

URL: http://llvm.org/viewvc/llvm-project?rev=298777&view=rev
Log:
PluginUnwindAssemblyX86: add missing linkage to MCDisasm

Add missing linkage of the lldbPluginUnwindAssemblyX86 to LLVMMCDisasm
library. This fixes the following build failure when linking against
shared libraries:


lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function
 lldb_private::x86AssemblyInspectionEngine::instruction_length(unsigned char*, 
int&): error: undefined reference to 'LLVMDisasmInstruction'

lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function
 lldb_private::x86AssemblyInspectionEngine::~x86AssemblyInspectionEngine(): 
error: undefined reference to 'LLVMDisasmDispose'

lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function
 
lldb_private::x86AssemblyInspectionEngine::x86AssemblyInspectionEngine(lldb_private::ArchSpec
 const&): error: undefined reference to 'LLVMCreateDisasm'

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

Modified:
lldb/trunk/source/Plugins/UnwindAssembly/x86/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/CMakeLists.txt?rev=298777&r1=298776&r2=298777&view=diff
==
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/CMakeLists.txt Sat Mar 25 
13:51:37 2017
@@ -10,4 +10,5 @@ add_lldb_library(lldbPluginUnwindAssembl
   LINK_COMPONENTS
 Support
 MC
+MCDisassembler
   )


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


[Lldb-commits] [lldb] r299095 - Revert r298776 - Expression: add missing linkage to RuntimeDyld ...

2017-03-30 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Mar 30 13:24:07 2017
New Revision: 299095

URL: http://llvm.org/viewvc/llvm-project?rev=299095&view=rev
Log:
Revert r298776 - Expression: add missing linkage to RuntimeDyld ...

This needs to be addressed within LLVM itself.

Modified:
lldb/trunk/source/Expression/CMakeLists.txt

Modified: lldb/trunk/source/Expression/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=299095&r1=299094&r2=299095&view=diff
==
--- lldb/trunk/source/Expression/CMakeLists.txt (original)
+++ lldb/trunk/source/Expression/CMakeLists.txt Thu Mar 30 13:24:07 2017
@@ -34,6 +34,5 @@ add_lldb_library(lldbExpression
   LINK_COMPONENTS
 Core
 ExecutionEngine
-RuntimeDyld
 Support
   )


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


[Lldb-commits] [lldb] r311122 - [cmake] Add explicit linkage from Core to curses

2017-08-17 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Aug 17 13:33:21 2017
New Revision: 311122

URL: http://llvm.org/viewvc/llvm-project?rev=311122&view=rev
Log:
[cmake] Add explicit linkage from Core to curses

The Core library calls functions provided by the curses library. Add
an appropriate explicit LINK_LIBS to ${CURSES_LIBRARIES} to propagate
the dependency correctly within the build system.

It seems that so far the linkage was handled by some kind of implicit
magic LLDB_SYSTEM_LIBS variable. However, it stopped working for
unittests as the curses libraries are passed before the LLDBCore
library, resulting in `-Wl,--as-needed` stripping the yet-unused library
before it is required by LLDBCore, and effectively breaking the build.
I think it's better to focus on listing all the dependencies explicitly
and let CMake propagate them rather than trying to figure out why this
hack stopped working.

This is also more consistent with LLVM where the curses linkage
in LLVMSupport is expressed directly in the library rather than deferred
to the final programs.

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

Modified:
lldb/trunk/source/Core/CMakeLists.txt

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=311122&r1=311121&r2=311122&view=diff
==
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Thu Aug 17 13:33:21 2017
@@ -1,3 +1,12 @@
+set(LLDB_CURSES_LIBS)
+
+if (NOT LLDB_DISABLE_CURSES)
+  list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES})
+  if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
+list(APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS})
+  endif()
+endif()
+
 add_lldb_library(lldbCore
   Address.cpp
   AddressRange.cpp
@@ -62,6 +71,7 @@ add_lldb_library(lldbCore
 lldbPluginCPlusPlusLanguage
 lldbPluginObjCLanguage
 lldbPluginObjectFileJIT
+${LLDB_CURSES_LIBS}
 
   LINK_COMPONENTS
 BinaryFormat


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


[Lldb-commits] [lldb] r311354 - [cmake] Explicitly link dependency libraries in the Host library

2017-08-21 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Aug 21 10:41:33 2017
New Revision: 311354

URL: http://llvm.org/viewvc/llvm-project?rev=311354&view=rev
Log:
[cmake] Explicitly link dependency libraries in the Host library

Add explicit linkage to the necessary system libraries in the Host
library. Otherwise, the library fails to build with -Wl,--as-needed.
The system libraries ended up being listed on the linker command-line
before the static libraries needing them, resulting in --as-needed
stripping them.

Listing the dependent libraries explicitly is the canonical way of
declaring libraries in CMake. It guarantees that the system library
dependencies will be correctly propagated to reverse dependencies.

The code used to link libraries reuses existing EXTRA_LIBS variable,
copying code from other parts of LLDB. We might eventually remove
the direct use of system libraries in the programs; however, I would
prefer if we focused on fixing the build regressions in 5.0 branch
first, and went further after the release.

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

Modified:
lldb/trunk/source/Host/CMakeLists.txt

Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=311354&r1=311353&r2=311354&view=diff
==
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Mon Aug 21 10:41:33 2017
@@ -156,9 +156,23 @@ if (${get_python_libdir})
   endif()
 endif()
 
+set(EXTRA_LIBS)
 if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
- set(EXTRA_LIBS kvm)
+  list(APPEND EXTRA_LIBS kvm)
 endif ()
+if (APPLE)
+  list(APPEND EXTRA_LIBS xml2)
+else ()
+  if (LIBXML2_FOUND)
+list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
+  endif()
+endif ()
+if (HAVE_LIBDL)
+  list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
+endif()
+if (NOT LLDB_DISABLE_LIBEDIT)
+  list(APPEND EXTRA_LIBS edit)
+endif()
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}


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


[Lldb-commits] [lldb] r311355 - [unittests] Build LLVMTestingSupport for out-of-source builds

2017-08-21 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Aug 21 10:41:39 2017
New Revision: 311355

URL: http://llvm.org/viewvc/llvm-project?rev=311355&view=rev
Log:
[unittests] Build LLVMTestingSupport for out-of-source builds

The Process/gdb-remote test now requires the LLVMTestingSupport library
that is not installed by LLVM. As a result, when doing an out-of-source
build it fails being unable to find the library. To solve that, build
a local copy of the library when building LLDB with unittests and LLVM
sources available. This is based on how we deal with bundled gtest
sources.

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

Modified:
lldb/trunk/unittests/CMakeLists.txt

Modified: lldb/trunk/unittests/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=311355&r1=311354&r2=311355&view=diff
==
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Mon Aug 21 10:41:39 2017
@@ -19,6 +19,12 @@ if (LLDB_BUILT_STANDALONE)
   if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest AND NOT TARGET gtest)
 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
   endif()
+  # LLVMTestingSupport library is needed for Process/gdb-remote.
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
+  AND NOT TARGET LLVMTestingSupport)
+add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
+  lib/Testing/Support)
+  endif()
 endif()
 
 function(add_lldb_unittest test_name)


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


[Lldb-commits] [lldb] r352116 - [Process/NetBSD] Add missing linkage to -lutil

2019-01-24 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Jan 24 14:20:47 2019
New Revision: 352116

URL: http://llvm.org/viewvc/llvm-project?rev=352116&view=rev
Log:
[Process/NetBSD] Add missing linkage to -lutil

Add missing linkage to fix build failure with LLD:

  ld: error: undefined symbol: kinfo_getvmmap
  >>> referenced by NativeProcessNetBSD.cpp
  >>>   
NativeProcessNetBSD.cpp.o:(lldb_private::process_netbsd::NativeProcessNetBSD::PopulateMemoryRegionCache())
 in archive lib/liblldbPluginProcessNetBSD.a

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

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt?rev=352116&r1=352115&r2=352116&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt Thu Jan 24 14:20:47 
2019
@@ -11,6 +11,7 @@ add_lldb_library(lldbPluginProcessNetBSD
 lldbUtility
 lldbPluginProcessPOSIX
 lldbPluginProcessUtility
+util
   LINK_COMPONENTS
 Support
   )


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


[Lldb-commits] [lldb] r352374 - [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

2019-01-28 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jan 28 07:16:03 2019
New Revision: 352374

URL: http://llvm.org/viewvc/llvm-project?rev=352374&view=rev
Log:
[cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always

Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT,
and require the fallback to be defined explicitly
as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone
after r346888.

The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache
variable and an optional pre-definition of default value from caller
(e.g. libcxx). It included a hack to make this work by assigning
the value back and forth but it was fragile and stopped working
in libcxx.

The new logic is simpler and more transparent. Default value is
provided in a separate variable, and used only when user-specified
variable is empty (i.e. not overriden).

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

Modified:
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=352374&r1=352373&r2=352374&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Mon Jan 28 07:16:03 2019
@@ -23,7 +23,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
   set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build 
tree")
-  set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to 
llvm-lit")
+  set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH 
"Path to llvm-lit")
 
   if(CMAKE_CROSSCOMPILING)
 set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")


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


[Lldb-commits] [lldb] r353545 - [lldb] [unittests] Disable MainLoopTest::DetectsEOF on NetBSD

2019-02-08 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Feb  8 10:56:11 2019
New Revision: 353545

URL: http://llvm.org/viewvc/llvm-project?rev=353545&view=rev
Log:
[lldb] [unittests] Disable MainLoopTest::DetectsEOF on NetBSD

The NetBSD kernel currently does not support detecting closed slave pty
via kevent on master pty.  This causes the test to hang forever.
To avoid that, disable the test until the kernel is fixed.

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

Modified:
lldb/trunk/unittests/Host/MainLoopTest.cpp

Modified: lldb/trunk/unittests/Host/MainLoopTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/MainLoopTest.cpp?rev=353545&r1=353544&r2=353545&view=diff
==
--- lldb/trunk/unittests/Host/MainLoopTest.cpp (original)
+++ lldb/trunk/unittests/Host/MainLoopTest.cpp Fri Feb  8 10:56:11 2019
@@ -108,7 +108,11 @@ TEST_F(MainLoopTest, TerminatesImmediate
 }
 
 #ifdef LLVM_ON_UNIX
+// NetBSD currently does not report slave pty EOF via kevent
+// causing this test to hang forever.
+#ifndef __NetBSD__
 TEST_F(MainLoopTest, DetectsEOF) {
+
   PseudoTerminal term;
   ASSERT_TRUE(term.OpenFirstAvailableMaster(O_RDWR, nullptr, 0));
   ASSERT_TRUE(term.OpenSlave(O_RDWR | O_NOCTTY, nullptr, 0));
@@ -125,6 +129,7 @@ TEST_F(MainLoopTest, DetectsEOF) {
   ASSERT_TRUE(loop.Run().Success());
   ASSERT_EQ(1u, callback_count);
 }
+#endif
 
 TEST_F(MainLoopTest, Signal) {
   MainLoop loop;


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


[Lldb-commits] [lldb] r353675 - [lldb] [MainLoop] Initialize empty sigset_t correctly

2019-02-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Feb 11 01:18:46 2019
New Revision: 353675

URL: http://llvm.org/viewvc/llvm-project?rev=353675&view=rev
Log:
[lldb] [MainLoop] Initialize empty sigset_t correctly

Fix MainLoop::RunImpl::get_sigmask() to correctly return empty sigset_t
when SIGNAL_POLLING_UNSUPPORTED is true.  On NetBSD (and probably
on some other platforms), integers are not implicitly convertible to
sigset_t, so 'return 0' is erraneous.  Instead, sigset_t should be reset
through sigemptyset().

While at it, move common parts out of the #ifdef.

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

Modified:
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=353675&r1=353674&r2=353675&view=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Mon Feb 11 01:18:46 2019
@@ -137,18 +137,20 @@ MainLoop::RunImpl::RunImpl(MainLoop &loo
 }
 
 sigset_t MainLoop::RunImpl::get_sigmask() {
-#if SIGNAL_POLLING_UNSUPPORTED
-  return 0;
-#else
   sigset_t sigmask;
+#if defined(_WIN32)
+  sigmask = 0;
+#elif SIGNAL_POLLING_UNSUPPORTED
+  sigemptyset(&sigmask);
+#else
   int ret = pthread_sigmask(SIG_SETMASK, nullptr, &sigmask);
   assert(ret == 0);
   (void) ret;
 
   for (const auto &sig : loop.m_signals)
 sigdelset(&sigmask, sig.first);
-  return sigmask;
 #endif
+  return sigmask;
 }
 
 #ifdef __ANDROID__


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


[Lldb-commits] [lldb] r353680 - [lldb] [lldb-instr] Add missing linkage to clang libraries

2019-02-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Feb 11 02:02:26 2019
New Revision: 353680

URL: http://llvm.org/viewvc/llvm-project?rev=353680&view=rev
Log:
[lldb] [lldb-instr] Add missing linkage to clang libraries

Fix build errors against shared clang by adding all the libraries used
in the code.

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

Modified:
lldb/trunk/tools/lldb-instr/CMakeLists.txt

Modified: lldb/trunk/tools/lldb-instr/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-instr/CMakeLists.txt?rev=353680&r1=353679&r2=353680&view=diff
==
--- lldb/trunk/tools/lldb-instr/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-instr/CMakeLists.txt Mon Feb 11 02:02:26 2019
@@ -5,6 +5,9 @@ add_lldb_tool(lldb-instr
 clangAST
 clangBasic
 clangFrontend
+clangLex
+clangRewrite
+clangSerialization
 clangTooling
 
   LINK_COMPONENTS


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


[Lldb-commits] [lldb] r353700 - [lldb] [test] Skip lldb-mi test if LLDB_DISABLE_PYTHON is used

2019-02-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Feb 11 06:09:43 2019
New Revision: 353700

URL: http://llvm.org/viewvc/llvm-project?rev=353700&view=rev
Log:
[lldb] [test] Skip lldb-mi test if LLDB_DISABLE_PYTHON is used

Skip running lldb-mi tests when Python support is disabled.  This causes
lldb-mi to unconditionally fail, and therefore all the relevant tests
fail as well.

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

Added:
lldb/trunk/lit/tools/lldb-mi/lit.local.cfg
Modified:
lldb/trunk/lit/helper/toolchain.py
lldb/trunk/lit/lit.site.cfg.py.in

Modified: lldb/trunk/lit/helper/toolchain.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/toolchain.py?rev=353700&r1=353699&r2=353700&view=diff
==
--- lldb/trunk/lit/helper/toolchain.py (original)
+++ lldb/trunk/lit/helper/toolchain.py Mon Feb 11 06:09:43 2019
@@ -52,7 +52,8 @@ def use_lldb_substitutions(config):
 
 llvm_config.add_tool_substitutions(primary_tools,
[config.lldb_tools_dir])
-if lldbmi.was_resolved:
+# lldb-mi always fails without Python support
+if lldbmi.was_resolved and not config.lldb_disable_python:
 config.available_features.add('lldb-mi')
 
 def _use_msvc_substitutions(config):

Modified: lldb/trunk/lit/lit.site.cfg.py.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.py.in?rev=353700&r1=353699&r2=353700&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.py.in (original)
+++ lldb/trunk/lit/lit.site.cfg.py.in Mon Feb 11 06:09:43 2019
@@ -17,6 +17,7 @@ config.python_executable = "@PYTHON_EXEC
 config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
+config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.

Added: lldb/trunk/lit/tools/lldb-mi/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/lit.local.cfg?rev=353700&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/lit.local.cfg (added)
+++ lldb/trunk/lit/tools/lldb-mi/lit.local.cfg Mon Feb 11 06:09:43 2019
@@ -0,0 +1,2 @@
+if not "lldb-mi" in config.available_features:
+config.unsupported = True


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


[Lldb-commits] [lldb] r353701 - [lldb] [lit] Fix finding lld-link when it is not in 'compiler dir'

2019-02-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Feb 11 06:09:48 2019
New Revision: 353701

URL: http://llvm.org/viewvc/llvm-project?rev=353701&view=rev
Log:
[lldb] [lit] Fix finding lld-link when it is not in 'compiler dir'

Fix the build helper to find lld-link via PATH lookup, rather than
making a fragile assumption that it will be present in the 'compiler
directory'.  This fixes tests on Gentoo where clang and lld
are installed in different directories.

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

Modified:
lldb/trunk/lit/helper/build.py

Modified: lldb/trunk/lit/helper/build.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/build.py?rev=353701&r1=353700&r2=353701&view=diff
==
--- lldb/trunk/lit/helper/build.py (original)
+++ lldb/trunk/lit/helper/build.py Mon Feb 11 06:09:48 2019
@@ -283,19 +283,17 @@ class MsvcBuilder(Builder):
 print('Using alternate compiler "{0}" to match selected 
target.'.format(self.compiler))
 
 if self.mode == 'link' or self.mode == 'compile-and-link':
-self.linker = self._find_linker('link') if toolchain_type == 
'msvc' else self._find_linker('lld-link')
+self.linker = self._find_linker('link') if toolchain_type == 
'msvc' else self._find_linker('lld-link', args.tools_dir)
 if not self.linker:
 raise ValueError('Unable to find an appropriate linker.')
 
 self.compile_env, self.link_env = self._get_visual_studio_environment()
 
-def _find_linker(self, name):
-if sys.platform == 'win32':
-name = name + '.exe'
+def _find_linker(self, name, search_paths=[]):
 compiler_dir = os.path.dirname(self.compiler)
-linker_path = os.path.join(compiler_dir, name)
-if not os.path.exists(linker_path):
-raise ValueError('Could not find \'{}\''.format(linker_path))
+linker_path = find_executable(name, [compiler_dir] + search_paths)
+if linker_path is None:
+raise ValueError('Could not find \'{}\''.format(name))
 return linker_path
 
 def _get_vc_install_dir(self):


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


[Lldb-commits] [lldb] r353868 - [lldb] [unittest] Avoid mixing '127.0.0.1' and 'localhost'

2019-02-12 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Feb 12 10:09:00 2019
New Revision: 353868

URL: http://llvm.org/viewvc/llvm-project?rev=353868&view=rev
Log:
[lldb] [unittest] Avoid mixing '127.0.0.1' and 'localhost'

Fix the tests not to use '127.0.0.1' and 'localhost' interchangeably.
More specifically, since tests bind specifically to 127.0.0.1, connect
to that address as well; using 'localhost' can resolve to IPv6 address
which can cause issues -- for example, if the matching port happens to
be used by some other process, the tests hang forever waiting for
the client to connect.

While technically the case of randomly selected IPv4 port being taken
on IPv6 loopback is not very likely, NetBSD happens to be suffering from
some weird kernel issue where connection to that port succeeds
nevertheless.  Until we can really figure out what goes wrong there,
this saves us from the tests hanging randomly.

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

Modified:
lldb/trunk/unittests/Host/SocketTest.cpp
lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp

Modified: lldb/trunk/unittests/Host/SocketTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=353868&r1=353867&r2=353868&view=diff
==
--- lldb/trunk/unittests/Host/SocketTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketTest.cpp Tue Feb 12 10:09:00 2019
@@ -179,7 +179,7 @@ TEST_F(SocketTest, TCPListen0ConnectAcce
   [=](const TCPSocket &s) {
 char connect_remote_address[64];
 snprintf(connect_remote_address, sizeof(connect_remote_address),
- "localhost:%u", s.GetLocalPortNumber());
+ "127.0.0.1:%u", s.GetLocalPortNumber());
 return std::string(connect_remote_address);
   },
   &socket_a_up, &socket_b_up);
@@ -193,7 +193,7 @@ TEST_F(SocketTest, TCPGetAddress) {
   [=](const TCPSocket &s) {
 char connect_remote_address[64];
 snprintf(connect_remote_address, sizeof(connect_remote_address),
- "localhost:%u", s.GetLocalPortNumber());
+ "127.0.0.1:%u", s.GetLocalPortNumber());
 return std::string(connect_remote_address);
   },
   &socket_a_up, &socket_b_up);

Modified: lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp?rev=353868&r1=353867&r2=353868&view=diff
==
--- lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp Tue Feb 12 
10:09:00 2019
@@ -80,7 +80,7 @@ Expected> Te
 return status.ToError();
 
   args.AppendArgument(
-  ("localhost:" + Twine(listen_socket.GetLocalPortNumber())).str());
+  ("127.0.0.1:" + Twine(listen_socket.GetLocalPortNumber())).str());
 
   for (StringRef arg : ServerArgs)
 args.AppendArgument(arg);


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


[Lldb-commits] [lldb] r353925 - [lldb] [cmake] Use install directories for LLVM_* variables

2019-02-13 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Feb 13 00:34:46 2019
New Revision: 353925

URL: http://llvm.org/viewvc/llvm-project?rev=353925&view=rev
Log:
[lldb] [cmake] Use install directories for LLVM_* variables

Restore the previous behavior of using install directories for
LLVM_MAIN_INCLUDE_DIR, LLVM_LIBRARY_DIR and LLVM_BINARY_DIR.  The update
from llvm-config to CMake has changed the values of those values to use
LLVM_BUILD_* which is plain wrong and breaks stand-alone builds.
Instead, use the CMake counterparts of the values returned
by llvm-config.

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

Modified:
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=353925&r1=353924&r2=353925&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Wed Feb 13 00:34:46 2019
@@ -20,9 +20,9 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake 
modules")
 
   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM 
source tree")
-  set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
-  set(LLVM_LIBRARY_DIR ${LLVM_BUILD_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
-  set(LLVM_BINARY_DIR ${LLVM_BUILD_BINARY_DIR} CACHE PATH "Path to LLVM build 
tree")
+  set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to 
llvm/include")
+  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
+  set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR} CACHE PATH "Path to LLVM build tree")
   set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH 
"Path to llvm-lit")
 
   if(CMAKE_CROSSCOMPILING)


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


[Lldb-commits] [lldb] r354029 - [lldb] [MainLoop] Report errno for failed kevent()

2019-02-14 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Feb 14 05:52:31 2019
New Revision: 354029

URL: http://llvm.org/viewvc/llvm-project?rev=354029&view=rev
Log:
[lldb] [MainLoop] Report errno for failed kevent()

Modify the kevent() error reporting to use errno rather than returning
the return value.  At least on FreeBSD and NetBSD, kevent() always
returns -1 in case of error, and the actual error is returned via errno.

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

Modified:
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=354029&r1=354028&r2=354029&view=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Thu Feb 14 05:52:31 2019
@@ -108,7 +108,7 @@ Status MainLoop::RunImpl::Poll() {
   out_events, llvm::array_lengthof(out_events), nullptr);
 
   if (num_events < 0)
-return Status("kevent() failed with error %d\n", num_events);
+return Status(errno, eErrorTypePOSIX);
   return Status();
 }
 


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


[Lldb-commits] [lldb] r354030 - [lldb] [lldb-server] Catch and report errors from main loop

2019-02-14 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Feb 14 05:52:37 2019
New Revision: 354030

URL: http://llvm.org/viewvc/llvm-project?rev=354030&view=rev
Log:
[lldb] [lldb-server] Catch and report errors from main loop

Catch the possible error from lldb-gdbserver's main loop, and report
it verbosely.  Currently, if the loop fails the server exits normally,
rendering the problem indistinguishable from regular termination.

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

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=354030&r1=354029&r2=354030&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Thu Feb 14 05:52:37 2019
@@ -533,7 +533,12 @@ int main_gdbserver(int argc, char *argv[
 return 1;
   }
 
-  mainloop.Run();
+  Status ret = mainloop.Run();
+  if (ret.Fail()) {
+fprintf(stderr, "lldb-server terminating due to error: %s\n",
+ret.AsCString());
+return 1;
+  }
   fprintf(stderr, "lldb-server exiting...\n");
 
   return 0;


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


[Lldb-commits] [lldb] r354050 - [lldb] [MainLoop] Remove redundant termination clause (NFCI)

2019-02-14 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Feb 14 10:51:21 2019
New Revision: 354050

URL: http://llvm.org/viewvc/llvm-project?rev=354050&view=rev
Log:
[lldb] [MainLoop] Remove redundant termination clause (NFCI)

Remove the redundant termination clause from within the loop.  Since
the check is done at the end of the loop, it's entirely redundant
to the 'while' condition.  If termination was requested, the latter
will become false and the 'while' loop will terminate, resulting
in the 'return' statement below the loop being executed (which is
equivalent to the one used inside 'if').

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

Modified:
lldb/trunk/source/Host/common/MainLoop.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=354050&r1=354049&r2=354050&view=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Thu Feb 14 10:51:21 2019
@@ -382,9 +382,6 @@ Status MainLoop::Run() {
   return error;
 
 impl.ProcessEvents();
-
-if (m_terminate_request)
-  return Status();
   }
   return Status();
 }


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


[Lldb-commits] [lldb] r354122 - [lldb] [MainLoop] Add kevent() EINTR handling

2019-02-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Feb 15 04:13:02 2019
New Revision: 354122

URL: http://llvm.org/viewvc/llvm-project?rev=354122&view=rev
Log:
[lldb] [MainLoop] Add kevent() EINTR handling

Add missing EINTR handling for kevent() calls.  If the call is
interrupted, return from Poll() as if zero events were returned and let
the polling resume on next iteration.  This fixes test flakiness
on NetBSD.

Includes a test case suggested by Pavel Labath on D42206.

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

Modified:
lldb/trunk/source/Host/common/MainLoop.cpp
lldb/trunk/unittests/Host/MainLoopTest.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=354122&r1=354121&r2=354122&view=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Fri Feb 15 04:13:02 2019
@@ -107,8 +107,14 @@ Status MainLoop::RunImpl::Poll() {
   num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(),
   out_events, llvm::array_lengthof(out_events), nullptr);
 
-  if (num_events < 0)
-return Status(errno, eErrorTypePOSIX);
+  if (num_events < 0) {
+if (errno == EINTR) {
+  // in case of EINTR, let the main loop run one iteration
+  // we need to zero num_events to avoid assertions failing
+  num_events = 0;
+} else
+  return Status(errno, eErrorTypePOSIX);
+  }
   return Status();
 }
 

Modified: lldb/trunk/unittests/Host/MainLoopTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/MainLoopTest.cpp?rev=354122&r1=354121&r2=354122&view=diff
==
--- lldb/trunk/unittests/Host/MainLoopTest.cpp (original)
+++ lldb/trunk/unittests/Host/MainLoopTest.cpp Fri Feb 15 04:13:02 2019
@@ -141,4 +141,28 @@ TEST_F(MainLoopTest, Signal) {
   ASSERT_TRUE(loop.Run().Success());
   ASSERT_EQ(1u, callback_count);
 }
+
+// Test that a signal which is not monitored by the MainLoop does not
+// cause a premature exit.
+TEST_F(MainLoopTest, UnmonitoredSignal) {
+  MainLoop loop;
+  Status error;
+  struct sigaction sa;
+  sa.sa_sigaction = [](int, siginfo_t *, void *) { };
+  sa.sa_flags = SA_SIGINFO; // important: no SA_RESTART
+  sigemptyset(&sa.sa_mask);
+  ASSERT_EQ(0, sigaction(SIGUSR2, &sa, nullptr));
+
+  auto handle = loop.RegisterSignal(SIGUSR1, make_callback(), error);
+  ASSERT_TRUE(error.Success());
+  std::thread killer([]() {
+sleep(1);
+kill(getpid(), SIGUSR2);
+sleep(1);
+kill(getpid(), SIGUSR1);
+  });
+  ASSERT_TRUE(loop.Run().Success());
+  killer.join();
+  ASSERT_EQ(1u, callback_count);
+}
 #endif


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


[Lldb-commits] [lldb] r354466 - [lldb] [ObjectFile/ELF] Fix recognizing NetBSD images

2019-02-20 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Feb 20 06:31:06 2019
New Revision: 354466

URL: http://llvm.org/viewvc/llvm-project?rev=354466&view=rev
Log:
[lldb] [ObjectFile/ELF] Fix recognizing NetBSD images

Split the recognition into NetBSD executables & shared libraries
and core(5) files.

Introduce new owner type: "NetBSD-CORE", as core(5) files are not tagged
in the same way as regular NetBSD executables.

Stop using incorrectly ABI_TAG and ABI_SIZE.  Introduce IDENT_TAG,
IDENT_DECSZ, IDENT_NAMESZ and PROCINFO.

The new values detect correctly the NetBSD images.

The patch has been originally written by Kamil Rytarowski.  I've added
tests and applied minor code changes per review.  The work has been
sponsored by the NetBSD Foundation.

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

Added:
lldb/trunk/lit/Modules/ELF/Inputs/netbsd-amd64.core   (with props)
lldb/trunk/lit/Modules/ELF/netbsd-core-amd64.test
lldb/trunk/lit/Modules/ELF/netbsd-exec-8.99.30-amd64.yaml
Modified:
lldb/trunk/lit/Modules/lit.local.cfg
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Added: lldb/trunk/lit/Modules/ELF/Inputs/netbsd-amd64.core
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/ELF/Inputs/netbsd-amd64.core?rev=354466&view=auto
==
Binary file - no diff available.

Propchange: lldb/trunk/lit/Modules/ELF/Inputs/netbsd-amd64.core
--
svn:mime-type = application/x-coredump

Added: lldb/trunk/lit/Modules/ELF/netbsd-core-amd64.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/ELF/netbsd-core-amd64.test?rev=354466&view=auto
==
--- lldb/trunk/lit/Modules/ELF/netbsd-core-amd64.test (added)
+++ lldb/trunk/lit/Modules/ELF/netbsd-core-amd64.test Wed Feb 20 06:31:06 2019
@@ -0,0 +1,12 @@
+# Test whether NetBSD core dumps are recognized correctly.
+
+# Core dump generated by the following program:
+# int main() {
+#   void* v = 0;
+#   *v = 1;
+#   return 0;
+# }
+
+# RUN: lldb-test object-file %S/Inputs/netbsd-amd64.core | FileCheck %s
+# CHECK: Architecture: x86_64-unknown-netbsd
+# CHECK: Type: core file

Added: lldb/trunk/lit/Modules/ELF/netbsd-exec-8.99.30-amd64.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/ELF/netbsd-exec-8.99.30-amd64.yaml?rev=354466&view=auto
==
--- lldb/trunk/lit/Modules/ELF/netbsd-exec-8.99.30-amd64.yaml (added)
+++ lldb/trunk/lit/Modules/ELF/netbsd-exec-8.99.30-amd64.yaml Wed Feb 20 
06:31:06 2019
@@ -0,0 +1,22 @@
+# Test whether NetBSD executables are recognized correctly.
+
+# RUN: yaml2obj %s > %t
+# RUN: lldb-test object-file %t | FileCheck %s
+# CHECK: Architecture: x86_64--netbsd8.99.30
+# CHECK: Type: executable
+
+--- !ELF
+FileHeader:  
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_EXEC
+  Machine: EM_X86_64
+  Entry:   0x002006F0
+Sections:
+  - Name:.note.netbsd.ident
+Type:SHT_NOTE
+Flags:   [ SHF_ALLOC ]
+Address: 0x002005A8
+AddressAlign:0x0004
+Content: 0700040001004E657442534478B29535
+...

Modified: lldb/trunk/lit/Modules/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lit.local.cfg?rev=354466&r1=354465&r2=354466&view=diff
==
--- lldb/trunk/lit/Modules/lit.local.cfg (original)
+++ lldb/trunk/lit/Modules/lit.local.cfg Wed Feb 20 06:31:06 2019
@@ -1 +1 @@
-config.suffixes = ['.s', '.yaml']
+config.suffixes = ['.s', '.test', '.yaml']

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=354466&r1=354465&r2=354466&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Wed Feb 20 
06:31:06 2019
@@ -55,6 +55,7 @@ namespace {
 const char *const LLDB_NT_OWNER_FREEBSD = "FreeBSD";
 const char *const LLDB_NT_OWNER_GNU = "GNU";
 const char *const LLDB_NT_OWNER_NETBSD = "NetBSD";
+const char *const LLDB_NT_OWNER_NETBSDCORE = "NetBSD-CORE";
 const char *const LLDB_NT_OWNER_OPENBSD = "OpenBSD";
 const char *const LLDB_NT_OWNER_CSR = "csr";
 const char *const LLDB_NT_OWNER_ANDROID = "Android";
@@ -70,8 +71,10 @@ const elf_word LLDB_NT_GNU_ABI_SIZE = 16
 
 const elf_word LLDB_NT_GNU_BUILD_ID_TAG = 0x03;
 
-const elf_word LLDB_NT_NETBSD_ABI_TAG = 0x01;
-const elf_word LLDB_NT_NETBSD_ABI_SIZE = 4;
+const elf_word LLDB_NT_NETBSD_IDENT_TAG = 1;
+const elf_wo

[Lldb-commits] [lldb] r354483 - [lldb] [test] Fix expected netbsd output for TestImageListMultiArchitecture

2019-02-20 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Feb 20 09:10:34 2019
New Revision: 354483

URL: http://llvm.org/viewvc/llvm-project?rev=354483&view=rev
Log:
[lldb] [test] Fix expected netbsd output for TestImageListMultiArchitecture

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py?rev=354483&r1=354482&r2=354483&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
 Wed Feb 20 09:10:34 2019
@@ -27,7 +27,7 @@ class TestImageListMultiArchitecture(Tes
 images = {
 "hello-freebsd-10.0-x86_64-clang-3.3": 
re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
 "hello-freebsd-10.0-x86_64-gcc-4.7.3": 
re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
-"hello-netbsd-6.1-x86_64-gcc-4.5.3": 
re.compile(r"x86_64-(\*)?-netbsd(-unknown)? x86_64"),
+"hello-netbsd-6.1-x86_64-gcc-4.5.3": 
re.compile(r"x86_64-(\*)?-netbsd6.1.4(-unknown)? x86_64"),
 "hello-ubuntu-14.04-x86_64-gcc-4.8.2": 
re.compile(r"x86_64-(\*)?-linux(-unknown)? x86_64"),
 "hello-ubuntu-14.04-x86_64-clang-3.5pre": 
re.compile(r"x86_64-(\*)?-linux(-unknown)? x86_64"),
 "hello-unknown-kalimba_arch4-kcc-36": 
re.compile(r"kalimba4-csr-(unknown|\*)(-unknown)? kalimba"),


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


[Lldb-commits] [lldb] r354617 - [lldb] [test] Do not link -ldl on NetBSD

2019-02-21 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Feb 21 12:28:21 2019
New Revision: 354617

URL: http://llvm.org/viewvc/llvm-project?rev=354617&view=rev
Log:
[lldb] [test] Do not link -ldl on NetBSD

Fix the load_* using test Makefiles not to link -ldl on NetBSD.
There is no such a library on NetBSD, and dlopen() is available
without a library.  Quoting the manpage:

(These functions are not in a library.  They are included in every
dynamically linked program automatically.)

To resolve this portably, introduce a new USE_LIBDL option.  If it set
to 1, Makefile.rules automatically appends -ldl on platforms needing it.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile?rev=354617&r1=354616&r2=354617&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
Thu Feb 21 12:28:21 2019
@@ -2,8 +2,9 @@ LEVEL := ../../make
 
 LIB_PREFIX := loadunload_
 
-LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl
+LD_EXTRAS := -L. -l$(LIB_PREFIX)d
 CXX_SOURCES := main.cpp
+USE_LIBDL := 1
 
 include $(LEVEL)/Makefile.rules
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile?rev=354617&r1=354616&r2=354617&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
 Thu Feb 21 12:28:21 2019
@@ -1,7 +1,7 @@
 LEVEL := ../../make
 
 CXX_SOURCES := main.cpp
-LD_EXTRAS := -ldl
+USE_LIBDL := 1
 
 include $(LEVEL)/Makefile.rules
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=354617&r1=354616&r2=354617&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Thu Feb 21 
12:28:21 2019
@@ -415,6 +415,15 @@ ifeq (1,$(USE_LIBCPP))
 endif
 
 #--
+# Additional system libraries
+#--
+ifeq (1,$(USE_LIBDL))
+   ifneq ($(OS),NetBSD)
+   LDFLAGS += -ldl
+   endif
+endif
+
+#--
 # dylib settings
 #--
 ifneq "$(strip $(DYLIB_C_SOURCES))" ""


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


[Lldb-commits] [lldb] r354920 - [lldb] [lit] Set LD_LIBRARY_PATH or alike for Suite tests

2019-02-26 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Feb 26 11:46:29 2019
New Revision: 354920

URL: http://llvm.org/viewvc/llvm-project?rev=354920&view=rev
Log:
[lldb] [lit] Set LD_LIBRARY_PATH or alike for Suite tests

Set LD_LIBRARY_PATH or local platform's equivalent of it when running
the 'Suite' tests.  This is necessary when running tests inside build
tree with BUILD_SHARED_LIBS enabled, in order to make the LLDB modules
load freshly built LLVM libraries.

The code is copied from clang (test/Unit/lit.cfg).  SHLIBDIR
substitution is added to site-config (already present in top-level LLDB
site-config) to future-proof this into supporting stand-alone builds
with shared LLDB libraries.

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

Modified:
lldb/trunk/lit/Suite/lit.cfg
lldb/trunk/lit/Suite/lit.site.cfg.in

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=354920&r1=354919&r2=354920&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Tue Feb 26 11:46:29 2019
@@ -3,6 +3,7 @@
 # Configuration file for the 'lit' test runner.
 
 import os
+import platform
 import shlex
 
 import lit.formats
@@ -32,6 +33,28 @@ if 'Address' in config.llvm_use_sanitize
 'detect_stack_use_after_return=1'
   config.environment['DYLD_INSERT_LIBRARIES'] = runtime
 
+# Shared library build of LLVM may require LD_LIBRARY_PATH or equivalent.
+def find_shlibpath_var():
+  if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
+yield 'LD_LIBRARY_PATH'
+  elif platform.system() == 'Darwin':
+yield 'DYLD_LIBRARY_PATH'
+  elif platform.system() == 'Windows':
+yield 'PATH'
+
+for shlibpath_var in find_shlibpath_var():
+  # In stand-alone build llvm_shlib_dir specifies LLDB's lib directory
+  # while llvm_libs_dir specifies LLVM's lib directory.
+  shlibpath = os.path.pathsep.join(
+(config.llvm_shlib_dir,
+ config.llvm_libs_dir,
+ config.environment.get(shlibpath_var, '')))
+  config.environment[shlibpath_var] = shlibpath
+  break
+else:
+  lit_config.warning("unable to inject shared library path on '{}'"
+ .format(platform.system()))
+
 # Build dotest command.
 dotest_cmd = [config.dotest_path, '-q']
 dotest_cmd.extend(config.dotest_args_str.split(';'))

Modified: lldb/trunk/lit/Suite/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.site.cfg.in?rev=354920&r1=354919&r2=354920&view=diff
==
--- lldb/trunk/lit/Suite/lit.site.cfg.in (original)
+++ lldb/trunk/lit/Suite/lit.site.cfg.in Tue Feb 26 11:46:29 2019
@@ -5,6 +5,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+config.llvm_shlib_dir = "@SHLIBDIR@"
 config.llvm_build_mode = "@LLVM_BUILD_MODE@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"


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


[Lldb-commits] [lldb] r354922 - [lldb] [unittests] Use non-empty format string for Timer()

2019-02-26 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Feb 26 12:14:07 2019
New Revision: 354922

URL: http://llvm.org/viewvc/llvm-project?rev=354922&view=rev
Log:
[lldb] [unittests] Use non-empty format string for Timer()

Pass dummy '.' as format string for Timer() rather than an empty string,
in order to silence gcc warnings about empty format string
(-Wformat-zero-length).  The actual format string is irrelevant
to the test in question.

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

Modified:
lldb/trunk/unittests/Utility/TimerTest.cpp

Modified: lldb/trunk/unittests/Utility/TimerTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/TimerTest.cpp?rev=354922&r1=354921&r2=354922&view=diff
==
--- lldb/trunk/unittests/Utility/TimerTest.cpp (original)
+++ lldb/trunk/unittests/Utility/TimerTest.cpp Tue Feb 26 12:14:07 2019
@@ -17,7 +17,7 @@ TEST(TimerTest, CategoryTimes) {
   Timer::ResetCategoryTimes();
   {
 static Timer::Category tcat("CAT1");
-Timer t(tcat, "");
+Timer t(tcat, ".");
 std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;
@@ -32,10 +32,10 @@ TEST(TimerTest, CategoryTimesNested) {
   Timer::ResetCategoryTimes();
   {
 static Timer::Category tcat1("CAT1");
-Timer t1(tcat1, "");
+Timer t1(tcat1, ".");
 std::this_thread::sleep_for(std::chrono::milliseconds(10));
 // Explicitly testing the same category as above.
-Timer t2(tcat1, "");
+Timer t2(tcat1, ".");
 std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;
@@ -52,10 +52,10 @@ TEST(TimerTest, CategoryTimes2) {
   Timer::ResetCategoryTimes();
   {
 static Timer::Category tcat1("CAT1");
-Timer t1(tcat1, "");
+Timer t1(tcat1, ".");
 std::this_thread::sleep_for(std::chrono::milliseconds(100));
 static Timer::Category tcat2("CAT2");
-Timer t2(tcat2, "");
+Timer t2(tcat2, ".");
 std::this_thread::sleep_for(std::chrono::milliseconds(10));
   }
   StreamString ss;


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


[Lldb-commits] [lldb] r355273 - [lldb] [lldbtest] Fix getBuildFlags() not to use libstdc++ on NetBSD

2019-03-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Mar  2 08:46:29 2019
New Revision: 355273

URL: http://llvm.org/viewvc/llvm-project?rev=355273&view=rev
Log:
[lldb] [lldbtest] Fix getBuildFlags() not to use libstdc++ on NetBSD

Remove the code forcing -stdlib=libstdc++ on NetBSD in getBuildFlags()
method.  NetBSD uses libc++ everywhere else, and using libstdc++ here
causes lang/cpp/dynamic-value to fail to build.

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=355273&r1=355272&r2=355273&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Sat Mar  2 08:46:29 
2019
@@ -1666,7 +1666,8 @@ class Base(unittest2.TestCase):
 elif self.getPlatform() == "openbsd":
 cflags += " -stdlib=libc++"
 elif self.getPlatform() == "netbsd":
-cflags += " -stdlib=libstdc++"
+# NetBSD defaults to libc++
+pass
 elif "clang" in self.getCompiler():
 cflags += " -stdlib=libstdc++"
 


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


[Lldb-commits] [lldb] r355274 - [lldb] [lit] Pass -pthread on NetBSD as well

2019-03-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Mar  2 08:48:44 2019
New Revision: 355274

URL: http://llvm.org/viewvc/llvm-project?rev=355274&view=rev
Log:
[lldb] [lit] Pass -pthread on NetBSD as well

Modified:
lldb/trunk/lit/helper/toolchain.py

Modified: lldb/trunk/lit/helper/toolchain.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/toolchain.py?rev=355274&r1=355273&r2=355274&view=diff
==
--- lldb/trunk/lit/helper/toolchain.py (original)
+++ lldb/trunk/lit/helper/toolchain.py Sat Mar  2 08:48:44 2019
@@ -96,7 +96,7 @@ def use_support_substitutions(config):
 sdk_path = lit.util.to_string(out)
 llvm_config.lit_config.note('using SDKROOT: %r' % sdk_path)
 flags = ['-isysroot', sdk_path]
-elif platform.system() in ['OpenBSD', 'Linux']:
+elif platform.system() in ['NetBSD', 'OpenBSD', 'Linux']:
 flags = ['-pthread']
 
 


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


[Lldb-commits] [lldb] r355285 - [lldb] [Process/gdb-remote] Use '127.0.0.1' in ConnectLocally()

2019-03-03 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun Mar  3 04:42:43 2019
New Revision: 355285

URL: http://llvm.org/viewvc/llvm-project?rev=355285&view=rev
Log:
[lldb] [Process/gdb-remote] Use '127.0.0.1' in ConnectLocally()

Use '127.0.0.1' instead of 'localhost' in ConnectLocally() function
as this is the specific address the server is bound to.  Using
'localhost' may involve trying IPv6 first which may accidentally be used
by another service.

While technically it might be interesting to support IPv6 here, it would
need to be supported properly, with the connection copying family
and address from the listening socket, and possibly without relying
on existence of 'localhost' at all.

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

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=355285&r1=355284&r2=355285&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Sun 
Mar  3 04:42:43 2019
@@ -1283,7 +1283,7 @@ GDBRemoteCommunication::ConnectLocally(G
 
   llvm::SmallString<32> remote_addr;
   llvm::raw_svector_ostream(remote_addr)
-  << "connect://localhost:" << listen_socket.GetLocalPortNumber();
+  << "connect://127.0.0.1:" << listen_socket.GetLocalPortNumber();
 
   std::unique_ptr conn_up(
   new ConnectionFileDescriptor());


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


[Lldb-commits] [lldb] r355502 - [lldb] [test] Pass appropriate -L&-Wl, -rpath for libc++ on NetBSD

2019-03-06 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Mar  6 06:03:18 2019
New Revision: 355502

URL: http://llvm.org/viewvc/llvm-project?rev=355502&view=rev
Log:
[lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD

Pass appropriate -L and -Wl,-rpath flags pointing out to the LLVM
library directory on NetBSD.  This is necessary since clang on NetBSD
requires libc++ but it is not installed as part of the system
by default.  For the purpose of running buildbot, we want LLDB to use
just-built libc++.

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

Modified:
lldb/trunk/lit/BuildScript/toolchain-clang.test
lldb/trunk/lit/Suite/lit.cfg
lldb/trunk/lit/helper/build.py
lldb/trunk/lit/helper/toolchain.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/lit/BuildScript/toolchain-clang.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/BuildScript/toolchain-clang.test?rev=355502&r1=355501&r2=355502&view=diff
==
--- lldb/trunk/lit/BuildScript/toolchain-clang.test (original)
+++ lldb/trunk/lit/BuildScript/toolchain-clang.test Wed Mar  6 06:03:18 2019
@@ -10,5 +10,5 @@ CHECK: compiling foobar.c -> foo.exe-foo
 CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 -g -O0 -c -o {{.*}}foo.exe-foobar.o 
{{.*}}foobar.c
 CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 -g -O0 -c -o {{.*}}foo.exe-foobar.o 
{{.*}}foobar.c
 CHECK: linking foo.exe-foobar.o -> foo.exe
-CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 -o {{.*}}foo.exe {{.*}}foo.exe-foobar.o
-CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 -o {{.*}}foo.exe {{.*}}foo.exe-foobar.o
+CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 {{(-L.*)? (-Wl,-rpath,.*)?}} -o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o
+CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 {{(-L.*)? (-Wl,-rpath,.*)?}} -o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=355502&r1=355501&r2=355502&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Wed Mar  6 06:03:18 2019
@@ -65,6 +65,10 @@ dotest_cmd.extend(config.dotest_args_str
 if config.dotest_lit_args_str:
   dotest_cmd.extend(shlex.split(config.dotest_lit_args_str))
 
+# Library path may be needed to locate just-built clang.
+if config.llvm_libs_dir:
+  dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
+
 # Load LLDB test format.
 sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
 import lldbtest

Modified: lldb/trunk/lit/helper/build.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/build.py?rev=355502&r1=355501&r2=355502&view=diff
==
--- lldb/trunk/lit/helper/build.py (original)
+++ lldb/trunk/lit/helper/build.py Wed Mar  6 06:03:18 2019
@@ -35,6 +35,13 @@ parser.add_argument('--compiler',
 required=True,
 help='Path to a compiler executable, or one of the values 
[any, msvc, clang-cl, gcc, clang]')
 
+parser.add_argument('--libs-dir',
+metavar='directory',
+dest='libs_dir',
+required=False,
+action='append',
+help='If specified, a path to linked libraries to be 
passed via -L')
+
 parser.add_argument('--tools-dir',
 metavar='directory',
 dest='tools_dir',
@@ -225,6 +232,7 @@ class Builder(object):
 self.nodefaultlib = args.nodefaultlib
 self.verbose = args.verbose
 self.obj_ext = obj_ext
+self.lib_paths = args.libs_dir
 
 def _exe_file_name(self):
 assert self.mode != 'compile'
@@ -650,6 +658,9 @@ class GccBuilder(Builder):
 if sys.platform == 'darwin':
 main_symbol = '_main'
 args.append('-Wl,-e,' + main_symbol)
+if sys.platform.startswith('netbsd'):
+for x in self.lib_paths:
+args += ['-L' + x, '-Wl,-rpath,' + x]
 args.extend(['-o', self._exe_file_name()])
 args.extend(self._obj_file_names())
 

Modified: lldb/trunk/lit/helper/toolchain.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/toolchain.py?rev=355502&r1=355501&r2=355502&view=diff
==
--- lldb/trunk/lit/helper/toolchain.py (original)
+++ lldb/trunk/lit/helper/toolchain.py Wed Mar  6 06:03:18 2019
@@ -31,6 +31,8 @@ def use_lldb_substitutions(config):
 
build_script_args.append('--tools-dir={0}'.format(config.lldb_lit_tools_dir))
 if config.lldb_tools_dir:
 
build_script_args.append('--tools-dir={0}'.format(config.lldb_tools_dir))
+if config.llvm_libs_dir:
+build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir))
 
 primary_tools 

[Lldb-commits] [lldb] r355510 - [lldb] [lit] Attempt to fix regex in toolchain-clang.test

2019-03-06 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Mar  6 06:49:48 2019
New Revision: 355510

URL: http://llvm.org/viewvc/llvm-project?rev=355510&view=rev
Log:
[lldb] [lit] Attempt to fix regex in toolchain-clang.test

Modified:
lldb/trunk/lit/BuildScript/toolchain-clang.test

Modified: lldb/trunk/lit/BuildScript/toolchain-clang.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/BuildScript/toolchain-clang.test?rev=355510&r1=355509&r2=355510&view=diff
==
--- lldb/trunk/lit/BuildScript/toolchain-clang.test (original)
+++ lldb/trunk/lit/BuildScript/toolchain-clang.test Wed Mar  6 06:49:48 2019
@@ -10,5 +10,5 @@ CHECK: compiling foobar.c -> foo.exe-foo
 CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 -g -O0 -c -o {{.*}}foo.exe-foobar.o 
{{.*}}foobar.c
 CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 -g -O0 -c -o {{.*}}foo.exe-foobar.o 
{{.*}}foobar.c
 CHECK: linking foo.exe-foobar.o -> foo.exe
-CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 {{(-L.*)? (-Wl,-rpath,.*)?}} -o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o
-CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 {{(-L.*)? (-Wl,-rpath,.*)?}} -o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o
+CHECK-32: {{.*}}clang++{{(.exe)?}} -m32 {{(-L.* )?(-Wl,-rpath,.* )?}}-o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o
+CHECK-64: {{.*}}clang++{{(.exe)?}} -m64 {{(-L.* )?(-Wl,-rpath,.* )?}}-o 
{{.*}}foo.exe {{.*}}foo.exe-foobar.o


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


[Lldb-commits] [lldb] r355736 - [lldb] [Process] Add proper support for NetBSD core files with threads

2019-03-08 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Mar  8 13:10:43 2019
New Revision: 355736

URL: http://llvm.org/viewvc/llvm-project?rev=355736&view=rev
Log:
[lldb] [Process] Add proper support for NetBSD core files with threads

Improve the support for processing NetBSD cores.  Fix reading process
identifier, thread information and associating the terminating signal
with the correct thread.

Includes test cases for single-threaded program receiving SIGSEGV,
and two dual-threaded programs: one where thread receives the signal,
and the other one when the whole process is signalled.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.amd64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.amd64.core
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/GNUmakefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
Modified:
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/elf-core/RegisterUtilities.h

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64?rev=355736&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64
--
svn:executable = *

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64
--
svn:mime-type = application/x-executable

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core?rev=355736&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
--
svn:mime-type = application/x-coredump

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.c?rev=355736&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.c
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.c
 Fri Mar  8 13:10:43 2019
@@ -0,0 +1,14 @@
+static void bar(char *boom) {
+  char F = 'b';
+  *boom = 47; // Frame bar
+}
+
+static void foo(char *boom, void (*boomer)(char *)) {
+  char F = 'f';
+  boomer(boom); // Frame foo
+}
+
+void main(void) {
+  char F = 'm';
+  foo(0, bar); // Frame main
+}

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64?rev=355736&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
-

[Lldb-commits] [lldb] r355747 - [lldb] [test] Do not check libc function names in NetBSD core test

2019-03-08 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Mar  8 14:32:35 2019
New Revision: 355747

URL: http://llvm.org/viewvc/llvm-project?rev=355747&view=rev
Log:
[lldb] [test] Do not check libc function names in NetBSD core test

Fix the NetBSD core test not to verify libc function names in backtrace.
This obviously requires the same libc.so as originally used to produce
the core file, and so it is going to fail everywhere except on my
system.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py?rev=355747&r1=355746&r2=355747&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 Fri Mar  8 14:32:35 2019
@@ -130,8 +130,8 @@ class NetBSDCoreCommonTestCase(TestBase)
 for i in range(len(backtrace)):
 frame = thread.GetFrameAtIndex(i)
 self.assertTrue(frame)
-self.assertEqual(frame.GetFunctionName(), backtrace[i])
 if not backtrace[i].startswith('_'):
+self.assertEqual(frame.GetFunctionName(), backtrace[i])
 self.assertEqual(frame.GetLineEntry().GetLine(),
  line_number(src, "Frame " + backtrace[i]))
 self.assertEqual(


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


[Lldb-commits] [lldb] r355750 - [lldb] [test] Skip broken NetBSD core test

2019-03-08 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Mar  8 14:41:14 2019
New Revision: 355750

URL: http://llvm.org/viewvc/llvm-project?rev=355750&view=rev
Log:
[lldb] [test] Skip broken NetBSD core test

Apparently the problem is harder than anticipated.  Skip the test for
now to fix buildbots.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py?rev=355750&r1=355749&r2=355750&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 Fri Mar  8 14:41:14 2019
@@ -219,6 +219,7 @@ class NetBSD2LWPProcessSigCoreTestCase(N
 self.assertEqual(thread.GetStopReasonDataCount(), 1)
 self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
 
+@skipIf  # TODO: fails with non-netbsd libc
 @skipIfLLVMTargetMissing("X86")
 def test_amd64(self):
 """Test double-threaded amd64 core dump where process is signalled."""


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


[Lldb-commits] [lldb] r355774 - [lldb] [test] Adjust XFAIL list to match buildbot results

2019-03-09 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Mar  9 04:47:38 2019
New Revision: 355774

URL: http://llvm.org/viewvc/llvm-project?rev=355774&view=rev
Log:
[lldb] [test] Adjust XFAIL list to match buildbot results

Adjust the XFAIL-ing tests to match consistent results from buildbot.
I'm going to work on differences between them and my local results
following this.

Modified:
lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s

lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py

Modified: lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/debug-line-basic.s Sat Mar  9 04:47:38 2019
@@ -1,5 +1,4 @@
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: 
lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s 
(original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s 
Sat Mar  9 04:47:38 2019
@@ -3,7 +3,6 @@
 # style, so we will just treat them as native host paths.
 
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s Sat Mar  9 
04:47:38 2019
@@ -2,7 +2,6 @@
 # compile unit does not have a DW_AT_comp_dir attribute.
 
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-posix.s Sat Mar  9 04:47:38 
2019
@@ -2,7 +2,6 @@
 # separator does not match the separator of the compile unit.
 
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dir-separator-windows.s Sat Mar  9 04:47:38 
2019
@@ -2,7 +2,6 @@
 # separator does not match the separator of the compile unit.
 
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s?rev=355774&r1=355773&r2=355774&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-inline-method.s Sat Mar  9 04:47:38 
2019
@@ -1,5 +1,4 @@
 # REQUIRES: lld
-# XFAIL: system-netbsd
 
 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
 # RUN: ld.lld %t.o -o %t

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Pyth

[Lldb-commits] [lldb] r355786 - [lldb] [test] Make 2lwp_process_SIGSEGV test more portable

2019-03-10 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun Mar 10 01:50:36 2019
New Revision: 355786

URL: http://llvm.org/viewvc/llvm-project?rev=355786&view=rev
Log:
[lldb] [test] Make 2lwp_process_SIGSEGV test more portable

Fix 2lwp_process_SIGSEGV NetBSD core test to terminate inside regular
function rather than libc call, in order to get reproducible backtrace
on different platforms.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64?rev=355786&r1=355785&r2=355786&view=diff
==
Binary files - no diff available.

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core?rev=355786&r1=355785&r2=355786&view=diff
==
Binary files - no diff available.

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c?rev=355786&r1=355785&r2=355786&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
 Sun Mar 10 01:50:36 2019
@@ -4,9 +4,12 @@
 #include 
 #include 
 
+volatile int sem = 0;
+
 static void bar() {
   char F = 'b';
-  kill(getpid(), SIGSEGV); // Frame bar
+  sem = 1;
+  while (1) continue; // Frame bar
 }
 
 static void foo(void (*boomer)()) {
@@ -28,5 +31,7 @@ int main(int argc, char **argv) {
   stack = malloc(ssize);
   _lwp_makecontext(&uc, lwp_main, NULL, NULL, stack, ssize);
   _lwp_create(&uc, 0, &lid);
+  while (sem != 1) continue;
+  kill(getpid(), SIGSEGV);
   _lwp_wait(lid, NULL);
 }

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py?rev=355786&r1=355785&r2=355786&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
 Sun Mar 10 01:50:36 2019
@@ -206,11 +206,10 @@ class NetBSD2LWPProcessSigCoreTestCase(N
 thread = process.GetSelectedThread()
 self.assertTrue(thread)
 self.assertEqual(thread.GetThreadID(), 2)
-self.assertEqual(thread.GetThreadID(), 2)
 self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)
 self.assertEqual(thread.GetStopReasonDataCount(), 1)
 self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
-backtrace = ["_kill", "bar", "foo", "lwp_main"]
+backtrace = ["bar", "foo", "lwp_main"]
 self.check_backtrace(thread, filename, backtrace)
 
 # thread 1 should have the same signal
@@ -219,8 +218,7 @@ class NetBSD2LWPProcessSigCoreTestCase(N
 self.assertEqual(thread.GetStopReasonDataCount(), 1)
 self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
 
-@skipIf  # TODO: fails with non-netbsd libc
 @skipIfLLVMTargetMissing("X86")
 def test_amd64(self):
 """Test double-threaded amd64 core dump where process is signalled."""
-self.do_test("2lwp_process_SIGSEGV.amd64", pid=141, region_count=24)
+self.do_test("2lwp_process_SIGSEGV.amd64", pid=665, region_count=24)


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


[Lldb-commits] [lldb] r355830 - [lldb] [test] Mark a few tests flakey on NetBSD

2019-03-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Mar 11 08:46:07 2019
New Revision: 355830

URL: http://llvm.org/viewvc/llvm-project?rev=355830&view=rev
Log:
[lldb] [test] Mark a few tests flakey on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py?rev=355830&r1=355829&r2=355830&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py 
Mon Mar 11 08:46:07 2019
@@ -102,6 +102,7 @@ class BasicExprCommandsTestCase(TestBase
 # (const char *) $8 = 0x... 
"/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out"
 
 @add_test_categories(['pyapi'])
+@expectedFlakeyNetBSD
 def test_evaluate_expression_python(self):
 """Test SBFrame.EvaluateExpression() API for evaluating an 
expression."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py?rev=355830&r1=355829&r2=355830&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 Mon Mar 11 08:46:07 2019
@@ -13,6 +13,7 @@ class BreakpointSetRestart(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 BREAKPOINT_TEXT = 'Set a breakpoint here'
 
+@expectedFlakeyNetBSD
 def test_breakpoint_set_restart(self):
 self.build()
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py?rev=355830&r1=355829&r2=355830&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
 Mon Mar 11 08:46:07 2019
@@ -23,6 +23,7 @@ class CategoriesDataFormatterTestCase(Te
 # Find the line number to break at.
 self.line = line_number('main.cpp', '// Set break point at this line.')
 
+@expectedFlakeyNetBSD
 def test_with_run_command(self):
 """Test that that file and class static variables display correctly."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py?rev=355830&r1=355829&r2=355830&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
 Mon Mar 11 08:46:07 2019
@@ -42,6 +42,7 @@ class LoadUsingPathsTestCase(TestBase):
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @not_remote_testsuite_ready
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
+@expectedFlakeyNetBSD
 def test_load_using_paths(self):
 """Test that we can load a module by providing a set of search 
paths."""
 if self.platformIsDarwin():

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/lo

[Lldb-commits] [lldb] r355838 - [lldb] [test] Mark more tests flakey on NetBSD

2019-03-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Mar 11 10:01:31 2019
New Revision: 355838

URL: http://llvm.org/viewvc/llvm-project?rev=355838&view=rev
Log:
[lldb] [test] Mark more tests flakey on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py?rev=355838&r1=355837&r2=355838&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
 Mon Mar 11 10:01:31 2019
@@ -55,6 +55,7 @@ class UnwindFromExpressionTest(TestBase)
 
 
 @add_test_categories(['pyapi'])
+@expectedFlakeyNetBSD
 def test_unwind_expression(self):
 """Test unwinding from an expression."""
 self.build_and_run_to_bkpt()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=355838&r1=355837&r2=355838&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Mon Mar 11 10:01:31 2019
@@ -200,6 +200,7 @@ class EventAPITestCase(TestBase):
 oslist=["linux"],
 bugnumber="llvm.org/pr23617 Flaky, fails ~1/10 cases")
 @skipIfWindows # This is flakey on Windows AND when it fails, it hangs: 
llvm.org/pr38373
+@expectedFlakeyNetBSD
 def test_add_listener_to_broadcaster(self):
 """Exercise some SBBroadcaster APIs."""
 self.build()


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


[Lldb-commits] [lldb] r356703 - [lldb] Add missing EINTR handling

2019-03-21 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Mar 21 12:35:55 2019
New Revision: 356703

URL: http://llvm.org/viewvc/llvm-project?rev=356703&view=rev
Log:
[lldb] Add missing EINTR handling

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

Modified:
lldb/trunk/source/Host/common/PseudoTerminal.cpp
lldb/trunk/source/Host/common/Socket.cpp
lldb/trunk/source/Host/common/TCPSocket.cpp
lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
lldb/trunk/source/Host/posix/DomainSocket.cpp
lldb/trunk/source/Host/posix/FileSystem.cpp
lldb/trunk/source/Host/posix/LockFilePosix.cpp
lldb/trunk/source/Host/posix/PipePosix.cpp
lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/trunk/tools/lldb-mi/MIUtilFileStd.cpp
lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp

Modified: lldb/trunk/source/Host/common/PseudoTerminal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/PseudoTerminal.cpp?rev=356703&r1=356702&r2=356703&view=diff
==
--- lldb/trunk/source/Host/common/PseudoTerminal.cpp (original)
+++ lldb/trunk/source/Host/common/PseudoTerminal.cpp Thu Mar 21 12:35:55 2019
@@ -147,7 +147,7 @@ bool PseudoTerminal::OpenSlave(int oflag
   if (slave_name == nullptr)
 return false;
 
-  m_slave_fd = ::open(slave_name, oflag);
+  m_slave_fd = llvm::sys::RetryAfterSignal(-1, ::open, slave_name, oflag);
 
   if (m_slave_fd < 0) {
 if (error_str)

Modified: lldb/trunk/source/Host/common/Socket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=356703&r1=356702&r2=356703&view=diff
==
--- lldb/trunk/source/Host/common/Socket.cpp (original)
+++ lldb/trunk/source/Host/common/Socket.cpp Thu Mar 21 12:35:55 2019
@@ -18,6 +18,7 @@
 #include "lldb/Utility/RegularExpression.h"
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Errno.h"
 
 #ifndef LLDB_DISABLE_POSIX
 #include "lldb/Host/posix/DomainSocket.h"
@@ -450,9 +451,11 @@ NativeSocket Socket::AcceptSocket(Native
   if (!child_processes_inherit) {
 flags |= SOCK_CLOEXEC;
   }
-  NativeSocket fd = ::accept4(sockfd, addr, addrlen, flags);
+  NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept4,
+  sockfd, addr, addrlen, flags);
 #else
-  NativeSocket fd = ::accept(sockfd, addr, addrlen);
+  NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept,
+  sockfd, addr, addrlen);
 #endif
   if (fd == kInvalidSocketValue)
 SetLastError(error);

Modified: lldb/trunk/source/Host/common/TCPSocket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=356703&r1=356702&r2=356703&view=diff
==
--- lldb/trunk/source/Host/common/TCPSocket.cpp (original)
+++ lldb/trunk/source/Host/common/TCPSocket.cpp Thu Mar 21 12:35:55 2019
@@ -17,6 +17,7 @@
 #include "lldb/Utility/Log.h"
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Errno.h"
 #include "llvm/Support/raw_ostream.h"
 
 #ifndef LLDB_DISABLE_POSIX
@@ -150,8 +151,8 @@ Status TCPSocket::Connect(llvm::StringRe
 
 address.SetPort(port);
 
-if (-1 == ::connect(GetNativeSocket(), &address.sockaddr(),
-address.GetLength())) {
+if (-1 == llvm::sys::RetryAfterSignal(-1, ::connect,
+  GetNativeSocket(), &address.sockaddr(), address.GetLength())) {
   CLOSE_SOCKET(GetNativeSocket());
   continue;
 }

Modified: lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp?rev=356703&r1=356702&r2=356703&view=diff
==
--- lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp Thu Mar 21 
12:35:55 2019
@@ -262,7 +262,7 @@ ConnectionStatus ConnectionFileDescripto
 options.c_cc[VMIN] = 1;
 options.c_cc[VTIME] = 0;
 
-::tcsetattr(fd, TCSANOW, &options);
+llvm::sys::RetryAfterSignal(-1, ::tcsetattr, fd, TCSANOW, &options);
   }
 
   int flags = ::fcntl(fd, F_GETFL, 0);

Modified: lldb/trunk/source/Host/posix/DomainSocket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/DomainSocket.cpp?rev=356703&r1=356702&r2=356703&view=diff
==
--- lldb/trunk/source/Host/posix/DomainSocket.cpp (original)
+++ lldb/trunk/source/Host/posix/Doma

[Lldb-commits] [lldb] r356960 - [lldb] [Process/NetBSD] Use nullptr to fix template arg deduction

2019-03-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Mar 25 15:29:29 2019
New Revision: 356960

URL: http://llvm.org/viewvc/llvm-project?rev=356960&view=rev
Log:
[lldb] [Process/NetBSD] Use nullptr to fix template arg deduction

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=356960&r1=356959&r2=356960&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Mon Mar 25 
15:29:29 2019
@@ -666,7 +666,7 @@ Status NativeProcessNetBSD::Attach() {
   // Need to use WALLSIG otherwise we receive an error with errno=ECHLD At this
   // point we should have a thread stopped if waitpid succeeds.
   if ((wstatus = llvm::sys::RetryAfterSignal(-1, waitpid,
-  m_pid, NULL, WALLSIG)) < 0)
+  m_pid, nullptr, WALLSIG)) < 0)
 return Status(errno, eErrorTypePOSIX);
 
   /* Initialize threads */


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


[Lldb-commits] [lldb] r357399 - [lldb] [Process/elf-core] Support aarch64 NetBSD core dumps

2019-04-01 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr  1 08:08:24 2019
New Revision: 357399

URL: http://llvm.org/viewvc/llvm-project?rev=357399&view=rev
Log:
[lldb] [Process/elf-core] Support aarch64 NetBSD core dumps

Include support for NetBSD core dumps from evbarm/aarch64 system,
and matching test cases for them.

Based on earlier work by Kamil Rytarowski.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64
   (with props)

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64.core
   (with props)
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/elf-core/RegisterUtilities.h
lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64?rev=357399&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64
--
svn:executable = *

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64
--
svn:mime-type = application/x-executable

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core?rev=357399&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
--
svn:mime-type = application/x-coredump

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64?rev=357399&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64
--
svn:executable = *

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64
--
svn:mime-type = application/x-executable

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core?rev=357399&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
--
svn:mime-type = application/x-coredump

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64?rev=357399&view=auto
==
Binary file - no diff available.

Propchange: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/ne

[Lldb-commits] [lldb] r358178 - [lldb] [Process/NetBSD] Fix wrongly mapping mm* registers

2019-04-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 11 07:58:48 2019
New Revision: 358178

URL: http://llvm.org/viewvc/llvm-project?rev=358178&view=rev
Log:
[lldb] [Process/NetBSD] Fix wrongly mapping mm* registers

Fix mistake that mapped mm* registers into the space for xmm* registers,
rather than the one shared with st* registers.  In other words,
'register read mmN' now correctly shows the mmN register rather than
part of xmmN.

Includes a minimal lit regression test.

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

Added:
lldb/trunk/lit/Register/
lldb/trunk/lit/Register/Inputs/
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
lldb/trunk/lit/Register/x86-mm-xmm-read.test
Modified:

lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp

Added: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp?rev=358178&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp Thu Apr 11 07:58:48 2019
@@ -0,0 +1,55 @@
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  uint64_t mm0 = 0x0102030405060708;
+  uint64_t mm1 = 0x1112131415161718;
+  uint64_t mm2 = 0x2122232425262728;
+  uint64_t mm3 = 0x3132333435363738;
+  uint64_t mm4 = 0x4142434445464748;
+  uint64_t mm5 = 0x5152535455565758;
+  uint64_t mm6 = 0x6162636465666768;
+  uint64_t mm7 = 0x7172737475767778;
+
+  xmm_t xmm0[2] = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
+  xmm_t xmm1[2] = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
+  xmm_t xmm2[2] = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
+  xmm_t xmm3[2] = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
+  xmm_t xmm4[2] = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
+  xmm_t xmm5[2] = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
+  xmm_t xmm6[2] = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
+  xmm_t xmm7[2] = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
+
+  asm volatile(
+"movq%0, %%mm0\n\t"
+"movq%1, %%mm1\n\t"
+"movq%2, %%mm2\n\t"
+"movq%3, %%mm3\n\t"
+"movq%4, %%mm4\n\t"
+"movq%5, %%mm5\n\t"
+"movq%6, %%mm6\n\t"
+"movq%7, %%mm7\n\t"
+"\n\t"
+"movaps  %8, %%xmm0\n\t"
+"movaps  %9, %%xmm1\n\t"
+"movaps  %10, %%xmm2\n\t"
+"movaps  %11, %%xmm3\n\t"
+"movaps  %12, %%xmm4\n\t"
+"movaps  %13, %%xmm5\n\t"
+"movaps  %14, %%xmm6\n\t"
+"movaps  %15, %%xmm7\n\t"
+"\n\t"
+"int3"
+:
+: "g"(mm0), "g"(mm1), "g"(mm2), "g"(mm3), "g"(mm4), "g"(mm5), "g"(mm6),
+  "g"(mm7), "m"(xmm0), "m"(xmm1), "m"(xmm2), "m"(xmm3), "m"(xmm4),
+  "m"(xmm5), "m"(xmm6), "m"(xmm7)
+: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=358178&view=auto
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (added)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Thu Apr 11 07:58:48 2019
@@ -0,0 +1,22 @@
+# REQUIRES: native && (target-x86 || target-x86_64)
+# RUN: %clang++ %p/Inputs/x86-mm-xmm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: mm0 = 0x0102030405060708
+# CHECK-DAG: mm1 = 0x1112131415161718
+# CHECK-DAG: mm2 = 0x2122232425262728
+# CHECK-DAG: mm3 = 0x3132333435363738
+# CHECK-DAG: mm4 = 0x4142434445464748
+# CHECK-DAG: mm5 = 0x5152535455565758
+# CHECK-DAG: mm6 = 0x6162636465666768
+# CHECK-DAG: mm7 = 0x7172737475767778
+# CHECK-DAG: xmm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}
+# CHECK-DAG: xmm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}
+# CHECK-DAG: xmm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}
+# CHECK-DAG: xmm3 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}
+# CHECK-DAG: xmm4 = {0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}
+# CHECK-DAG: xmm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}
+# CHECK-DAG: xmm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}
+# CHECK-DAG: xmm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}

Modified: 
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp?rev=358178&r1=358177&r2=358178&view=diff
==

[Lldb-commits] [lldb] r358184 - [lldb] [lit/Register] Fix test to use %clangxx

2019-04-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 11 08:13:17 2019
New Revision: 358184

URL: http://llvm.org/viewvc/llvm-project?rev=358184&view=rev
Log:
[lldb] [lit/Register] Fix test to use %clangxx

Modified:
lldb/trunk/lit/Register/x86-mm-xmm-read.test

Modified: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=358184&r1=358183&r2=358184&view=diff
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (original)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Thu Apr 11 08:13:17 2019
@@ -1,5 +1,5 @@
 # REQUIRES: native && (target-x86 || target-x86_64)
-# RUN: %clang++ %p/Inputs/x86-mm-xmm-read.cpp -o %t
+# RUN: %clangxx %p/Inputs/x86-mm-xmm-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch
 


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


[Lldb-commits] [lldb] r358188 - [lldb] [lit/Register] Mark x86-mm-xmm-read XFAIL on Windows

2019-04-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 11 09:06:14 2019
New Revision: 358188

URL: http://llvm.org/viewvc/llvm-project?rev=358188&view=rev
Log:
[lldb] [lit/Register] Mark x86-mm-xmm-read XFAIL on Windows

Modified:
lldb/trunk/lit/Register/x86-mm-xmm-read.test

Modified: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=358188&r1=358187&r2=358188&view=diff
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (original)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Thu Apr 11 09:06:14 2019
@@ -1,3 +1,4 @@
+# XFAIL: system-windows
 # REQUIRES: native && (target-x86 || target-x86_64)
 # RUN: %clangxx %p/Inputs/x86-mm-xmm-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s


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


[Lldb-commits] [lldb] r358224 - [lldb] [lit/Register] XFAIL on Darwin

2019-04-11 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 11 13:44:40 2019
New Revision: 358224

URL: http://llvm.org/viewvc/llvm-project?rev=358224&view=rev
Log:
[lldb] [lit/Register] XFAIL on Darwin

Modified:
lldb/trunk/lit/Register/x86-mm-xmm-read.test

Modified: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=358224&r1=358223&r2=358224&view=diff
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (original)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Thu Apr 11 13:44:40 2019
@@ -1,3 +1,4 @@
+# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && (target-x86 || target-x86_64)
 # RUN: %clangxx %p/Inputs/x86-mm-xmm-read.cpp -o %t


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


[Lldb-commits] [lldb] r358329 - [lldb] [lit/SymbolFile] Avoid -nostdlib in target-symbols-add-unwind.test

2019-04-13 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Apr 13 02:49:39 2019
New Revision: 358329

URL: http://llvm.org/viewvc/llvm-project?rev=358329&view=rev
Log:
[lldb] [lit/SymbolFile] Avoid -nostdlib in target-symbols-add-unwind.test

Do not use -nostdlib in target-symbols-add-unwind.test.  NetBSD uses
startup files to provide obligatory ELF notes in executables,
and therefore using -nostdlib requires providing specially tailored
input.  Otherwise, kernel rejects the result as invalid executable.

The replacement was suggested by Pavel Labath.

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

Modified:
lldb/trunk/lit/SymbolFile/Inputs/target-symbols-add-unwind.c
lldb/trunk/lit/SymbolFile/target-symbols-add-unwind.test

Modified: lldb/trunk/lit/SymbolFile/Inputs/target-symbols-add-unwind.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/Inputs/target-symbols-add-unwind.c?rev=358329&r1=358328&r2=358329&view=diff
==
--- lldb/trunk/lit/SymbolFile/Inputs/target-symbols-add-unwind.c (original)
+++ lldb/trunk/lit/SymbolFile/Inputs/target-symbols-add-unwind.c Sat Apr 13 
02:49:39 2019
@@ -1 +1 @@
-void _start() {}
+int main() {}

Modified: lldb/trunk/lit/SymbolFile/target-symbols-add-unwind.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/target-symbols-add-unwind.test?rev=358329&r1=358328&r2=358329&view=diff
==
--- lldb/trunk/lit/SymbolFile/target-symbols-add-unwind.test (original)
+++ lldb/trunk/lit/SymbolFile/target-symbols-add-unwind.test Sat Apr 13 
02:49:39 2019
@@ -4,23 +4,23 @@
 # UNSUPPORTED: system-windows, system-darwin
 
 # RUN: cd %T
-# RUN: %clang %S/Inputs/target-symbols-add-unwind.c -nostdlib -g \
+# RUN: %clang %S/Inputs/target-symbols-add-unwind.c -g \
 # RUN:   -fno-unwind-tables -o target-symbols-add-unwind.debug
 # RUN: llvm-objcopy --strip-debug target-symbols-add-unwind.debug \
 # RUN:   target-symbols-add-unwind.stripped
 # RUN: %lldb target-symbols-add-unwind.stripped -s %s -o quit | FileCheck %s
 
 process launch --stop-at-entry
-image show-unwind -n _start
-# CHECK-LABEL: image show-unwind -n _start
+image show-unwind -n main
+# CHECK-LABEL: image show-unwind -n main
 # CHECK-NOT: debug_frame UnwindPlan:
 
 target symbols add -s target-symbols-add-unwind.stripped 
target-symbols-add-unwind.debug
 # CHECK-LABEL: target symbols add
 # CHECK: symbol file {{.*}} has been added to {{.*}}
 
-image show-unwind -n _start
-# CHECK-LABEL: image show-unwind -n _start
+image show-unwind -n main
+# CHECK-LABEL: image show-unwind -n main
 # CHECK: debug_frame UnwindPlan:
 # CHECK-NEXT: This UnwindPlan originally sourced from DWARF CFI
 # CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.


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


[Lldb-commits] [lldb] r358660 - [lldb] [test] Mark three more tests flakey/xfail on NetBSD

2019-04-18 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 18 05:31:48 2019
New Revision: 358660

URL: http://llvm.org/viewvc/llvm-project?rev=358660&view=rev
Log:
[lldb] [test] Mark three more tests flakey/xfail on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=358660&r1=358659&r2=358660&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 Thu Apr 18 05:31:48 2019
@@ -304,6 +304,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
+@expectedFlakeyNetBSD
 def test_lldbmi_break_enable_disable(self):
 """Test that 'lldb-mi --interpreter' works for enabling / disabling 
breakpoints."""
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py?rev=358660&r1=358659&r2=358660&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 Thu Apr 18 05:31:48 2019
@@ -61,6 +61,7 @@ class TestVSCode_launch(lldbvscode_testc
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
+@expectedFailureNetBSD
 @no_debug_info_test
 def test_cwd(self):
 '''
@@ -89,6 +90,7 @@ class TestVSCode_launch(lldbvscode_testc
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
+@expectedFailureNetBSD
 @no_debug_info_test
 def test_debuggerRoot(self):
 '''


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


[Lldb-commits] [lldb] r284584 - [cmake] Use LLVM_CMAKE_PATH for GetSVN script

2016-10-19 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Oct 19 07:54:28 2016
New Revision: 284584

URL: http://llvm.org/viewvc/llvm-project?rev=284584&view=rev
Log:
[cmake] Use LLVM_CMAKE_PATH for GetSVN script

Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

Modified:
lldb/trunk/source/CMakeLists.txt

Modified: lldb/trunk/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=284584&r1=284583&r2=284584&view=diff
==
--- lldb/trunk/source/CMakeLists.txt (original)
+++ lldb/trunk/source/CMakeLists.txt Wed Oct 19 07:54:28 2016
@@ -53,7 +53,7 @@ endforeach()
 
 if(DEFINED lldb_vc)
   set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
-  set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake")
+  set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
 
   # Create custom target to generate the VC revision include.
   add_custom_command(OUTPUT "${version_inc}"


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


[Lldb-commits] [lldb] r285865 - [cmake] Build gtest from LLVM when building standalone

2016-11-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Nov  2 17:57:23 2016
New Revision: 285865

URL: http://llvm.org/viewvc/llvm-project?rev=285865&view=rev
Log:
[cmake] Build gtest from LLVM when building standalone

Include the gtest utility directory from LLVM sources when performing
a stand-alone build of LLDB. This is necessary to have a correct gtest
library to link tests against, as the one used by LLVM is not installed
(and not supposed to be). This is the same approach as used in clang.

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

Modified:
lldb/trunk/unittests/CMakeLists.txt

Modified: lldb/trunk/unittests/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=285865&r1=285864&r2=285865&view=diff
==
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Wed Nov  2 17:57:23 2016
@@ -12,6 +12,14 @@ endif ()
 
 include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
 
+if (LLDB_BUILT_STANDALONE)
+  # Build the gtest library needed for unittests, if we have LLVM sources
+  # handy.
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
+  endif()
+endif()
+
 function(add_lldb_unittest test_name)
   add_unittest(LLDBUnitTests
 ${test_name}


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


[Lldb-commits] [lldb] r290819 - [unittests] Split DWARF tests out of PDB, fix standalone build

2017-01-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jan  2 12:20:33 2017
New Revision: 290819

URL: http://llvm.org/viewvc/llvm-project?rev=290819&view=rev
Log:
[unittests] Split DWARF tests out of PDB, fix standalone build

Split the PDB tests into DWARF test and actual PDB tests, the latter
requiring DIA SDK. Use the new LLVMConfig.cmake LLVM_ENABLE_DIA_SDK
symbol to enable the PDB tests rather than relying on
llvm/Config/config.h private include file that is not available when
building standalone.

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

Added:
lldb/trunk/unittests/SymbolFile/DWARF/
lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/unittests/SymbolFile/DWARF/Inputs/
lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.cpp
  - copied, changed from r290688, 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp
lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.exe
  - copied, changed from r290688, 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe
lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
Removed:
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe
Modified:
lldb/trunk/unittests/SymbolFile/CMakeLists.txt
lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/unittests/SymbolFile/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/CMakeLists.txt?rev=290819&r1=290818&r2=290819&view=diff
==
--- lldb/trunk/unittests/SymbolFile/CMakeLists.txt (original)
+++ lldb/trunk/unittests/SymbolFile/CMakeLists.txt Mon Jan  2 12:20:33 2017
@@ -1 +1,4 @@
-add_subdirectory(PDB)
+add_subdirectory(DWARF)
+if (LLVM_ENABLE_DIA_SDK)
+  add_subdirectory(PDB)
+endif()

Added: lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt?rev=290819&view=auto
==
--- lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt (added)
+++ lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt Mon Jan  2 12:20:33 
2017
@@ -0,0 +1,8 @@
+add_lldb_unittest(SymbolFileDWARFTests
+  SymbolFileDWARFTests.cpp
+  )
+
+set(test_inputs
+   test-dwarf.exe)
+
+add_unittest_inputs(SymbolFileDWARFTests "${test_inputs}")

Copied: lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.cpp (from 
r290688, lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.cpp?p2=lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.cpp&p1=lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp&r1=290688&r2=290819&rev=290819&view=diff
==
(empty)

Copied: lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.exe (from 
r290688, lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.exe?p2=lldb/trunk/unittests/SymbolFile/DWARF/Inputs/test-dwarf.exe&p1=lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.exe&r1=290688&r2=290819&rev=290819&view=diff
==
(empty)

Added: lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp?rev=290819&view=auto
==
--- lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp (added)
+++ lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp Mon Jan  2 
12:20:33 2017
@@ -0,0 +1,83 @@
+//===-- PythonDataObjectsTests.cpp --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+
+#include "lldb/Core/Address.h"
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/FileSpec.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/LineTable.h"
+#include "lldb/Symbol/SymbolVendor.h"
+
+#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
+#include "Plugins/SymbolFile/

[Lldb-commits] [lldb] r291500 - [cmake] Obtain LLVM_CMAKE_PATH from llvm-config

2017-01-09 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jan  9 17:12:37 2017
New Revision: 291500

URL: http://llvm.org/viewvc/llvm-project?rev=291500&view=rev
Log:
[cmake] Obtain LLVM_CMAKE_PATH from llvm-config

Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config instead of reconstructing it locally.

Modified:
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=291500&r1=291499&r2=291500&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Mon Jan  9 17:12:37 2017
@@ -21,7 +21,8 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   "--libdir"
   "--includedir"
   "--prefix"
-  "--src-root")
+  "--src-root"
+  "--cmakedir")
 execute_process(
   COMMAND ${CONFIG_COMMAND}
   RESULT_VARIABLE HAD_ERROR
@@ -47,6 +48,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
   list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+  list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
@@ -65,7 +67,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
   set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
   if(EXISTS ${LLVMCONFIG_FILE})
 list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")


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


[Lldb-commits] [lldb] r295621 - [test] Fix finding LLDB tools when building stand-alone

2017-02-19 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun Feb 19 16:11:38 2017
New Revision: 295621

URL: http://llvm.org/viewvc/llvm-project?rev=295621&view=rev
Log:
[test] Fix finding LLDB tools when building stand-alone

Use both LLDB- and LLVM-specific tool/library directories when LLDB is
being built stand-alone. This ensures that the freshly-built tools
(and libraries) are used correctly.

Without this patch, the test suite uses LLVM_TOOLS_DIR and LLVM_LIBS_DIR
to locate lldb, and set PATH and LD_LIBRARY_PATH. When doing
a stand-alone build, these variables represent the installed LLVM.
As a result, tests either fail due to missing lldb executable
or use an earlier installed LLDB version rather than the one being
built.

To solve this, additional LLDB_TOOLS_DIR and LLDB_LIBS_DIR variables
are added and populated using LLVM_*_OUTPUT_INTDIR. Those variables
contain directories used to output built executables and libraries.
In stand-alone builds, they represent the build-tree directories
used by LLDB. In integrated builds, they have the same values as
LLVM_*_DIR and therefore using them does not harm.

The new variables are prepended to PATH and LD_LIBRARY_PATH to ensure
that freshly built binaries are preferred over potentially earlier
installed ones. Furthermore, paths used to locate various tools are
updated to match appropriate locations.

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

Modified:
lldb/trunk/lit/lit.cfg
lldb/trunk/lit/lit.site.cfg.in

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=295621&r1=295620&r2=295621&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Sun Feb 19 16:11:38 2017
@@ -39,18 +39,24 @@ config.llvm_obj_root = getattr(config, '
 
 # Tweak the PATH to include the tools dir and the scripts dir.
 if lldb_obj_root is not None:
+lldb_tools_dir = getattr(config, 'lldb_tools_dir', None)
+if not lldb_tools_dir:
+lit_config.fatal('No LLDB tools dir set!')
 llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
 if not llvm_tools_dir:
 lit_config.fatal('No LLVM tools dir set!')
-path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
+path = os.path.pathsep.join((lldb_tools_dir, llvm_tools_dir, 
config.environment['PATH']))
 path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', 
None),'test','Scripts'),path))
 
 config.environment['PATH'] = path
 
+lldb_libs_dir = getattr(config, 'lldb_libs_dir', None)
+if not lldb_libs_dir:
+lit_config.fatal('No LLDB libs dir set!')
 llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
 if not llvm_libs_dir:
 lit_config.fatal('No LLVM libs dir set!')
-path = os.path.pathsep.join((llvm_libs_dir,
+path = os.path.pathsep.join((lldb_libs_dir, llvm_libs_dir,
  config.environment.get('LD_LIBRARY_PATH','')))
 config.environment['LD_LIBRARY_PATH'] = path
 
@@ -115,14 +121,14 @@ if config.test_exec_root is None:
 # Register substitutions
 config.substitutions.append(('%python', config.python_executable))
 
-debugserver = lit.util.which('debugserver', llvm_tools_dir)
-lldb = lit.util.which('lldb', llvm_tools_dir)
+debugserver = lit.util.which('debugserver', lldb_tools_dir)
+lldb = lit.util.which('lldb', lldb_tools_dir)
 
 if not os.path.exists(config.cc):
-config.cc = lit.util.which(config.cc, llvm_tools_dir)
+config.cc = lit.util.which(config.cc, config.environment['PATH'])
 
 if not os.path.exists(config.cxx):
-config.cxx = lit.util.which(config.cxx, llvm_tools_dir)
+config.cxx = lit.util.which(config.cxx, config.environment['PATH'])
 
 if platform.system() in ['Darwin']:
 try:

Modified: lldb/trunk/lit/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.in?rev=295621&r1=295620&r2=295621&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.in (original)
+++ lldb/trunk/lit/lit.site.cfg.in Sun Feb 19 16:11:38 2017
@@ -6,6 +6,8 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"
+config.lldb_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
+config.lldb_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.cc = "@CMAKE_C_COMPILER@"


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


[Lldb-commits] [lldb] r373734 - [lldb] [cmake] Support linking against clang-cpp dylib

2019-10-04 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Oct  4 05:03:03 2019
New Revision: 373734

URL: http://llvm.org/viewvc/llvm-project?rev=373734&view=rev
Log:
[lldb] [cmake] Support linking against clang-cpp dylib

Link against clang-cpp dylib rather than split libs when
CLANG_LINK_CLANG_DYLIB is enabled.

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

Modified:
lldb/trunk/cmake/modules/AddLLDB.cmake
lldb/trunk/source/Core/CMakeLists.txt
lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/PDB/CMakeLists.txt
lldb/trunk/source/Symbol/CMakeLists.txt
lldb/trunk/tools/lldb-instr/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=373734&r1=373733&r2=373734&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Fri Oct  4 05:03:03 2019
@@ -37,7 +37,7 @@ function(add_lldb_library name)
   cmake_parse_arguments(PARAM
 "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
 "INSTALL_PREFIX;ENTITLEMENTS"
-"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS;CLANG_LIBS"
 ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
   list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -91,6 +91,12 @@ function(add_lldb_library name)
   ${pass_ENTITLEMENTS}
   ${pass_NO_INSTALL_RPATH}
 )
+
+if(CLANG_LINK_CLANG_DYLIB)
+  target_link_libraries(${name} PRIVATE clang-cpp)
+else()
+  target_link_libraries(${name} PRIVATE ${PARAM_CLANG_LIBS})
+endif()
   endif()
 
   if(PARAM_SHARED)
@@ -136,7 +142,7 @@ function(add_lldb_executable name)
   cmake_parse_arguments(ARG
 "GENERATE_INSTALL"
 "INSTALL_PREFIX;ENTITLEMENTS"
-"LINK_LIBS;LINK_COMPONENTS"
+"LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS"
 ${ARGN}
 )
 
@@ -156,6 +162,11 @@ function(add_lldb_executable name)
   )
 
   target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})
+  if(CLANG_LINK_CLANG_DYLIB)
+target_link_libraries(${name} PRIVATE clang-cpp)
+  else()
+target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
+  endif()
   set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
 
   if(ARG_GENERATE_INSTALL)

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=373734&r1=373733&r2=373734&view=diff
==
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Fri Oct  4 05:03:03 2019
@@ -69,7 +69,6 @@ add_lldb_library(lldbCore
 clang-tablegen-targets
 
   LINK_LIBS
-clangDriver
 lldbBreakpoint
 lldbDataFormatters
 lldbExpression
@@ -82,6 +81,9 @@ add_lldb_library(lldbCore
 lldbPluginObjCLanguage
 ${LLDB_CURSES_LIBS}
 
+  CLANG_LIBS
+clangDriver
+
   LINK_COMPONENTS
 Support
 Demangle

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt?rev=373734&r1=373733&r2=373734&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/CMakeLists.txt Fri Oct  4 
05:03:03 2019
@@ -27,6 +27,16 @@ add_lldb_library(lldbPluginExpressionPar
   ${tablegen_deps}
 
   LINK_LIBS
+lldbCore
+lldbExpression
+lldbHost
+lldbInterpreter
+lldbSymbol
+lldbTarget
+lldbUtility
+lldbPluginCPlusPlusLanguage
+lldbPluginCPPRuntime
+  CLANG_LIBS
 clangAST
 clangCodeGen
 clangDriver
@@ -38,15 +48,6 @@ add_lldb_library(lldbPluginExpressionPar
 clangRewriteFrontend
 clangSema
 clangSerialization
-lldbCore
-lldbExpression
-lldbHost
-lldbInterpreter
-lldbSymbol
-lldbTarget
-lldbUtility
-lldbPluginCPlusPlusLanguage
-lldbPluginCPPRuntime
   LINK_COMPONENTS
 Core
 ExecutionEngine

Modified: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt?rev=373734&r1=373733&r2=373734&view=diff
==
--- lldb

[Lldb-commits] [lldb] r366889 - Revert "Revert "[lldb] [Process/NetBSD] Fix constructor after r363707""

2019-07-24 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Jul 24 04:44:43 2019
New Revision: 366889

URL: http://llvm.org/viewvc/llvm-project?rev=366889&view=rev
Log:
Revert "Revert "[lldb] [Process/NetBSD] Fix constructor after r363707""

The relevant changes have been reapplied, and broke build again.

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=366889&r1=366888&r2=366889&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Wed Jul 24 
04:44:43 2019
@@ -140,7 +140,7 @@ NativeProcessNetBSD::NativeProcessNetBSD
  NativeDelegate &delegate,
  const ArchSpec &arch,
  MainLoop &mainloop)
-: NativeProcessProtocol(pid, terminal_fd, delegate), m_arch(arch) {
+: NativeProcessELF(pid, terminal_fd, delegate), m_arch(arch) {
   if (m_terminal_fd != -1) {
 Status status = EnsureFDFlags(m_terminal_fd, O_NONBLOCK);
 assert(status.Success());


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


[Lldb-commits] [lldb] r367047 - [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Jul 25 13:27:40 2019
New Revision: 367047

URL: http://llvm.org/viewvc/llvm-project?rev=367047&view=rev
Log:
[lldb] [Process/NetBSD] Report stopped process on SIGSTOP

Mark the process as stopped when SIGSTOP arrives.  This is necessary
for lldb-server to generate correct response to 'process interrupt',
and therefore to prevent the whole stack crashing when process
is stopped.

Thanks to Pavel Labath for the tip.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
 Thu Jul 25 13:27:40 2019
@@ -26,7 +26,6 @@ class ExprCommandThatRestartsTestCase(Te
 @skipIfFreeBSD  # llvm.org/pr19246: intermittent failure
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
-@expectedFailureNetBSD
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
 def test(self):
 """Test calling function that hits a signal and restarts."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 Thu Jul 25 13:27:40 2019
@@ -27,7 +27,6 @@ class ExprCommandWithTimeoutsTestCase(Te
 oslist=[
 "windows"],
 bugnumber="llvm.org/pr21765")
-@expectedFailureNetBSD
 def test(self):
 """Test calling std::String member function."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
 Thu Jul 25 13:27:40 2019
@@ -26,7 +26,6 @@ class SendSignalTestCase(TestBase):
 oslist=['freebsd'],
 bugnumber="llvm.org/pr23318: does not report running state")
 @skipIfWindows  # Windows does not support signals
-@expectedFailureNetBSD
 def test_with_run_command(self):
 """Test that lldb command 'process signal SIGUSR1' sends a signal to 
the inferior process."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 Thu Jul 25 13:27:40 2019
@@ -194,7 +194,6 @@ class ThreadStateTestCase(TestBase):
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
ht

[Lldb-commits] [lldb] r367228 - [lldb] [test] Mark three new tests XFAIL on NetBSD

2019-07-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jul 29 07:32:40 2019
New Revision: 367228

URL: http://llvm.org/viewvc/llvm-project?rev=367228&view=rev
Log:
[lldb] [test] Mark three new tests XFAIL on NetBSD

Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=367228&r1=367227&r2=367228&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Mon Jul 29 07:32:40 2019
@@ -20,6 +20,7 @@ class ExecTestCase(TestBase):
 
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@expectedFailureNetBSD
 @skipIfSanitized # rdar://problem/43756823
 @skipIfWindows
 def test_hitting_exec (self):
@@ -27,6 +28,7 @@ class ExecTestCase(TestBase):
 
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@expectedFailureNetBSD
 @skipIfSanitized # rdar://problem/43756823
 @skipIfWindows
 def test_skipping_exec (self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py?rev=367228&r1=367227&r2=367228&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
 Mon Jul 29 07:32:40 2019
@@ -19,6 +19,7 @@ class HandleAbortTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
 @skipIfWindows  # signals do not exist on Windows
+@expectedFailureNetBSD
 def test_inferior_handle_sigabrt(self):
 """Inferior calls abort() and handles the resultant SIGABRT.
Stopped at a breakpoint in the handler, verify that the backtrace


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


[Lldb-commits] [lldb] r367285 - [lldb] [test] Mark newly running test XFAIL on NetBSD

2019-07-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jul 29 23:12:03 2019
New Revision: 367285

URL: http://llvm.org/viewvc/llvm-project?rev=367285&view=rev
Log:
[lldb] [test] Mark newly running test XFAIL on NetBSD

The test was not previously run due to decorator bug (fixed in r366903).
It is not a regression and is probably related to the other failing
test, so just disable it.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=367285&r1=367284&r2=367285&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Mon Jul 29 23:12:03 2019
@@ -109,6 +109,7 @@ class HelloWorldTestCase(TestBase):
 @add_test_categories(['pyapi'])
 @skipIfiOSSimulator
 @skipIfSanitized # FIXME: Hangs indefinitely.
+@expectedFailureNetBSD
 def test_with_attach_to_process_with_name_api(self):
 """Create target, spawn a process, and attach to it with process 
name."""
 exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())


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


[Lldb-commits] [lldb] r367290 - [lldb] [test/lldb-vscode] Use os.path.dirname() [NFC]

2019-07-30 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Jul 30 00:47:16 2019
New Revision: 367290

URL: http://llvm.org/viewvc/llvm-project?rev=367290&view=rev
Log:
[lldb] [test/lldb-vscode] Use os.path.dirname() [NFC]

Replace os.path.split()[0] with os.path.dirname().  Suggested by Pavel
Labath in D65432.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py?rev=367290&r1=367289&r2=367290&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 Tue Jul 30 00:47:16 2019
@@ -68,7 +68,7 @@ class TestVSCode_launch(lldbvscode_testc
 directory.
 '''
 program = self.getBuildArtifact("a.out")
-program_parent_dir = os.path.split(os.path.split(program)[0])[0]
+program_parent_dir = os.path.dirname(os.path.dirname(program))
 self.build_and_launch(program,
   cwd=program_parent_dir)
 self.continue_to_exit()
@@ -96,7 +96,7 @@ class TestVSCode_launch(lldbvscode_testc
 the lldb-vscode debug adaptor.
 '''
 program = self.getBuildArtifact("a.out")
-program_parent_dir = os.path.split(os.path.split(program)[0])[0]
+program_parent_dir = os.path.dirname(os.path.dirname(program))
 commands = ['platform shell echo cwd = $PWD']
 self.build_and_launch(program,
   debuggerRoot=program_parent_dir,
@@ -124,7 +124,7 @@ class TestVSCode_launch(lldbvscode_testc
 Tests the "sourcePath" will set the target.source-map.
 '''
 program = self.getBuildArtifact("a.out")
-program_dir = os.path.split(program)[0]
+program_dir = os.path.dirname(program)
 self.build_and_launch(program,
   sourcePath=program_dir)
 output = self.get_console()
@@ -170,7 +170,7 @@ class TestVSCode_launch(lldbvscode_testc
 enabled.
 '''
 program = self.getBuildArtifact("a.out")
-program_dir = os.path.split(program)[0]
+program_dir = os.path.dirname(program)
 glob = os.path.join(program_dir, '*.out')
 self.build_and_launch(program, args=[glob], shellExpandArguments=True)
 self.continue_to_exit()
@@ -195,7 +195,7 @@ class TestVSCode_launch(lldbvscode_testc
 disabled.
 '''
 program = self.getBuildArtifact("a.out")
-program_dir = os.path.split(program)[0]
+program_dir = os.path.dirname(program)
 glob = os.path.join(program_dir, '*.out')
 self.build_and_launch(program,
   args=[glob],


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


[Lldb-commits] [lldb] r367291 - [lldb] [test/lldb-vscode] Use realpath to match vscode behavior

2019-07-30 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Jul 30 00:47:22 2019
New Revision: 367291

URL: http://llvm.org/viewvc/llvm-project?rev=367291&view=rev
Log:
[lldb] [test/lldb-vscode] Use realpath to match vscode behavior

Compare the directory paths returned by lldb-vscode against realpaths
rather than apparent paths.  This matches lldb-vscode behavior
and therefore fixes test failures when one of the parent directories
of the source tree is a symlink.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py?rev=367291&r1=367290&r2=367291&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 Tue Jul 30 00:47:22 2019
@@ -68,7 +68,8 @@ class TestVSCode_launch(lldbvscode_testc
 directory.
 '''
 program = self.getBuildArtifact("a.out")
-program_parent_dir = os.path.dirname(os.path.dirname(program))
+program_parent_dir = os.path.realpath(
+os.path.dirname(os.path.dirname(program)))
 self.build_and_launch(program,
   cwd=program_parent_dir)
 self.continue_to_exit()
@@ -96,7 +97,8 @@ class TestVSCode_launch(lldbvscode_testc
 the lldb-vscode debug adaptor.
 '''
 program = self.getBuildArtifact("a.out")
-program_parent_dir = os.path.dirname(os.path.dirname(program))
+program_parent_dir = os.path.realpath(
+os.path.dirname(os.path.dirname(program)))
 commands = ['platform shell echo cwd = $PWD']
 self.build_and_launch(program,
   debuggerRoot=program_parent_dir,


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


[Lldb-commits] [lldb] r370748 - [lldb] Replace std::call_once() with llvm::call_once()

2019-09-03 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Sep  3 05:31:24 2019
New Revision: 370748

URL: http://llvm.org/viewvc/llvm-project?rev=370748&view=rev
Log:
[lldb] Replace std::call_once() with llvm::call_once()

Remove the single instance of std::call_once() in lldbTarget library
with llvm::call_once().  The former fails to build on NetBSD when
combined with llvm::once_flag (which replaced std::once_flag
in r369618), and combining the two is probably generally incorrect
anyway.

Modified:
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=370748&r1=370747&r2=370748&view=diff
==
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Sep  3 05:31:24 2019
@@ -5965,7 +5965,7 @@ UtilityFunction *Process::GetLoadImageUt
 llvm::function_ref()> factory) {
   if (platform != GetTarget().GetPlatform().get())
 return nullptr;
-  std::call_once(m_dlopen_utility_func_flag_once,
- [&] { m_dlopen_utility_func_up = factory(); });
+  llvm::call_once(m_dlopen_utility_func_flag_once,
+  [&] { m_dlopen_utility_func_up = factory(); });
   return m_dlopen_utility_func_up.get();
 }


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


[Lldb-commits] [lldb] r370840 - [lldb] [test] Un-mark two commands/register tests XFAIL

2019-09-03 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Sep  3 23:10:02 2019
New Revision: 370840

URL: http://llvm.org/viewvc/llvm-project?rev=370840&view=rev
Log:
[lldb] [test] Un-mark two commands/register tests XFAIL

Modified:

lldb/trunk/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py?rev=370840&r1=370839&r2=370840&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
 Tue Sep  3 23:10:02 2019
@@ -478,7 +478,6 @@ class RegisterCommandsTestCase(TestBase)
 
 @skipIfiOSSimulator
 @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
-@expectedFailureNetBSD
 def test_invalid_invocation(self):
 self.build()
 self.common_setup()
@@ -496,7 +495,6 @@ class RegisterCommandsTestCase(TestBase)
 
 @skipIfiOSSimulator
 @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
-@expectedFailureNetBSD
 def test_write_unknown_register(self):
 self.build()
 self.common_setup()


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


[Lldb-commits] [lldb] r370842 - [lldb] [test] Mark 'reenabled' tests XFAIL on NetBSD

2019-09-03 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Sep  3 23:36:53 2019
New Revision: 370842

URL: http://llvm.org/viewvc/llvm-project?rev=370842&view=rev
Log:
[lldb] [test] Mark 'reenabled' tests XFAIL on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py?rev=370842&r1=370841&r2=370842&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
 Tue Sep  3 23:36:53 2019
@@ -14,6 +14,7 @@ class ConcurrentManyBreakpoints(Concurre
 
 # Atomic sequences are not supported yet for MIPS in LLDB.
 @skipIf(triple='^mips')
+@expectedFailureNetBSD
 def test(self):
 """Test 100 breakpoints from 100 threads."""
 self.build(dictionary=self.getBuildFlags())

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py?rev=370842&r1=370841&r2=370842&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
 Tue Sep  3 23:36:53 2019
@@ -14,6 +14,7 @@ class ConcurrentManyCrash(ConcurrentEven
 
 # Atomic sequences are not supported yet for MIPS in LLDB.
 @skipIf(triple='^mips')
+@expectedFailureNetBSD
 def test(self):
 """Test 100 threads that cause a segfault."""
 self.build(dictionary=self.getBuildFlags())

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py?rev=370842&r1=370841&r2=370842&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py
 Tue Sep  3 23:36:53 2019
@@ -16,6 +16,7 @@ class ConcurrentManySignals(ConcurrentEv
 @skipIf(triple='^mips')
 # This test is flaky on Darwin.
 @skipIfDarwin
+@expectedFailureNetBSD
 def test(self):
 """Test 100 signals from 100 threads."""
 self.build(dictionary=self.getBuildFlags())

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py?rev=370842&r1=370841&r2=370842&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
 Tue Sep  3 23:36:53 2019
@@ -14,6 +14,7 @@ class ConcurrentManyWatchpoints(Concurre
 
 # Atomic sequences are not supported yet for MIPS in LLDB.
 @skipIf(triple='^mips')
+@expectedFailureNetBSD
 @add_test_categories(["watchpoint"])
 def test(self):
 """Test 100 watchpoints from 100 threads."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py?rev=370842&r1=370841&r2=370842&view=diff
===

[Lldb-commits] [lldb] r372090 - [lldb] [Process/gdb-remote] Fix defaulting signal to invalid in action list

2019-09-17 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Sep 17 02:31:00 2019
New Revision: 372090

URL: http://llvm.org/viewvc/llvm-project?rev=372090&view=rev
Log:
[lldb] [Process/gdb-remote] Fix defaulting signal to invalid in action list

Fix processing of "C" packet with signal for the whole process to
default signal value for action list to LLDB_INVALID_SIGNAL_NUMBER
rather than 0.

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

Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=372090&r1=372089&r2=372090&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 Tue Sep 17 02:31:00 2019
@@ -1383,7 +1383,8 @@ GDBRemoteCommunicationServerLLGS::Handle
   packet, "unexpected content after $C{signal-number}");
   }
 
-  ResumeActionList resume_actions(StateType::eStateRunning, 0);
+  ResumeActionList resume_actions(StateType::eStateRunning,
+  LLDB_INVALID_SIGNAL_NUMBER);
   Status error;
 
   // We have two branches: what to do if a continue thread is specified (in
@@ -3322,4 +3323,4 @@ std::string GDBRemoteCommunicationServer
 }
   }
   return result;
-}
\ No newline at end of file
+}


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


[Lldb-commits] [lldb] r372300 - [lldb] [Process/gdb-remote] Correct more missing LLDB_INVALID_SIGNAL_NUMBER

2019-09-18 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Sep 18 22:49:14 2019
New Revision: 372300

URL: http://llvm.org/viewvc/llvm-project?rev=372300&view=rev
Log:
[lldb] [Process/gdb-remote] Correct more missing LLDB_INVALID_SIGNAL_NUMBER

Correct more uses of 0 instead of LLDB_INVALID_SIGNAL_NUMBER.

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

Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=372300&r1=372299&r2=372300&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 Wed Sep 18 22:49:14 2019
@@ -1454,7 +1454,8 @@ GDBRemoteCommunicationServerLLGS::Handle
   }
 
   // Build the ResumeActionList
-  ResumeActionList actions(StateType::eStateRunning, 0);
+  ResumeActionList actions(StateType::eStateRunning,
+   LLDB_INVALID_SIGNAL_NUMBER);
 
   Status error = m_debugged_process_up->Resume(actions);
   if (error.Fail()) {
@@ -1521,7 +1522,7 @@ GDBRemoteCommunicationServerLLGS::Handle
 ResumeAction thread_action;
 thread_action.tid = LLDB_INVALID_THREAD_ID;
 thread_action.state = eStateInvalid;
-thread_action.signal = 0;
+thread_action.signal = LLDB_INVALID_SIGNAL_NUMBER;
 
 const char action = packet.GetChar();
 switch (action) {
@@ -2724,7 +2725,7 @@ GDBRemoteCommunicationServerLLGS::Handle
 return SendErrorResponse(0x33);
 
   // Create the step action for the given thread.
-  ResumeAction action = {tid, eStateStepping, 0};
+  ResumeAction action = {tid, eStateStepping, LLDB_INVALID_SIGNAL_NUMBER};
 
   // Setup the actions list.
   ResumeActionList actions;


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


[Lldb-commits] [lldb] r372755 - [lldb] [Process/NetBSD] Fix handling LLDB_INVALID_SIGNAL_NUMBER

2019-09-24 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Sep 24 06:41:54 2019
New Revision: 372755

URL: http://llvm.org/viewvc/llvm-project?rev=372755&view=rev
Log:
[lldb] [Process/NetBSD] Fix handling LLDB_INVALID_SIGNAL_NUMBER

Fix NativeProcessNetBSD::Resume() to handle LLDB_INVALID_SIGNAL_NUMBER
correctly.  Fixes breakage caused by r372090 and r372300.  I have major
rewrite of that function pending; however, the fixes to gdb-remote
were committed prior to that.

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=372755&r1=372754&r2=372755&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Tue Sep 24 
06:41:54 2019
@@ -340,12 +340,14 @@ Status NativeProcessNetBSD::Resume(const
   }
 
   Status error;
+  int signal =
+  action->signal != LLDB_INVALID_SIGNAL_NUMBER ? action->signal : 0;
 
   switch (action->state) {
   case eStateRunning: {
 // Run the thread, possibly feeding it the signal.
 error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(), (void *)1,
-   action->signal);
+   signal);
 if (!error.Success())
   return error;
 for (const auto &thread : m_threads)
@@ -356,7 +358,7 @@ Status NativeProcessNetBSD::Resume(const
   case eStateStepping:
 // Run the thread, possibly feeding it the signal.
 error = NativeProcessNetBSD::PtraceWrapper(PT_STEP, GetID(), (void *)1,
-   action->signal);
+   signal);
 if (!error.Success())
   return error;
 for (const auto &thread : m_threads)


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


[Lldb-commits] [lldb] r372835 - [lldb] [cmake] Fix installing Python modules on systems using /usr/lib

2019-09-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Sep 25 02:47:35 2019
New Revision: 372835

URL: http://llvm.org/viewvc/llvm-project?rev=372835&view=rev
Log:
[lldb] [cmake] Fix installing Python modules on systems using /usr/lib

Fix installing Python modules on systems that use /usr/lib for Python
while installing other libraries in /usr/lib64.  Rewrite CMake logic
to query correct directories from Python, similarly to how
prepare_binding_Python.py does it.  Furthermore, change the regex used
in get_relative_lib_dir.py to allow 'lib' without suffix.

I think that the code can be further improved but I'd like to take
this enterprise in smaller steps in case one of them breaks something.

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

Modified:
lldb/trunk/scripts/CMakeLists.txt
lldb/trunk/scripts/get_relative_lib_dir.py

Modified: lldb/trunk/scripts/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/CMakeLists.txt?rev=372835&r1=372834&r2=372835&view=diff
==
--- lldb/trunk/scripts/CMakeLists.txt (original)
+++ lldb/trunk/scripts/CMakeLists.txt Wed Sep 25 02:47:35 2019
@@ -42,15 +42,18 @@ add_custom_target(swig_wrapper ALL DEPEN
 )
 
 if(NOT LLDB_BUILD_FRAMEWORK)
-  if(CMAKE_SYSTEM_NAME MATCHES "Windows")
-set(swig_python_subdir site-packages)
-  else()
-set(swig_python_subdir 
python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-  endif()
-
-  set(SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${swig_python_subdir})
-  set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX})
+  execute_process(
+COMMAND ${PYTHON_EXECUTABLE}
+-c "import distutils.sysconfig, sys; 
print(distutils.sysconfig.get_python_lib(True, False, sys.argv[1]))"
+${CMAKE_BINARY_DIR}
+OUTPUT_VARIABLE SWIG_PYTHON_DIR
+OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(
+COMMAND ${PYTHON_EXECUTABLE}
+-c "import distutils.sysconfig; 
print(distutils.sysconfig.get_python_lib(True, False, ''))"
+OUTPUT_VARIABLE SWIG_INSTALL_DIR
+OUTPUT_STRIP_TRAILING_WHITESPACE)
 
   # Install the LLDB python module
-  install(DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR})
+  install(DIRECTORY ${SWIG_PYTHON_DIR}/ DESTINATION ${SWIG_INSTALL_DIR})
 endif()

Modified: lldb/trunk/scripts/get_relative_lib_dir.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/get_relative_lib_dir.py?rev=372835&r1=372834&r2=372835&view=diff
==
--- lldb/trunk/scripts/get_relative_lib_dir.py (original)
+++ lldb/trunk/scripts/get_relative_lib_dir.py Wed Sep 25 02:47:35 2019
@@ -23,7 +23,7 @@ def get_python_relative_libdir():
 # right answer always.
 arch_specific_libdir = distutils.sysconfig.get_python_lib(True, False)
 split_libdir = arch_specific_libdir.split(os.sep)
-lib_re = re.compile(r"^lib.+$")
+lib_re = re.compile(r"^lib.*$")
 
 for i in range(len(split_libdir)):
 match = lib_re.match(split_libdir[i])


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


[Lldb-commits] [lldb] r372840 - [lldb] [test] Add NetBSD to XFAIL list for thread_local test

2019-09-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed Sep 25 03:18:38 2019
New Revision: 372840

URL: http://llvm.org/viewvc/llvm-project?rev=372840&view=rev
Log:
[lldb] [test] Add NetBSD to XFAIL list for thread_local test

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py?rev=372840&r1=372839&r2=372840&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py
 Wed Sep 25 03:18:38 2019
@@ -2,4 +2,5 @@ from lldbsuite.test import lldbinline
 from lldbsuite.test import decorators
 
 lldbinline.MakeInlineTest(__file__, globals(),
-  lldbinline.expectedFailureAll(oslist=["windows", 
"linux"]))
+  lldbinline.expectedFailureAll(oslist=[
+  "windows", "linux", "netbsd"]))


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


[Lldb-commits] [lldb] r359208 - [lldb] [lit] Remove unnecessary array use in XMM reading test

2019-04-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 25 10:42:40 2019
New Revision: 359208

URL: http://llvm.org/viewvc/llvm-project?rev=359208&view=rev
Log:
[lldb] [lit] Remove unnecessary array use in XMM reading test

Remove the use of 2-element array for XMM data.  It is an accidental
leftover from previous implementation attempt, and it is unnecessary
with xmm_t.

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

Modified:
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp?rev=359208&r1=359207&r2=359208&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp Thu Apr 25 10:42:40 2019
@@ -14,14 +14,14 @@ int main() {
   uint64_t mm6 = 0x6162636465666768;
   uint64_t mm7 = 0x7172737475767778;
 
-  xmm_t xmm0[2] = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
-  xmm_t xmm1[2] = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
-  xmm_t xmm2[2] = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
-  xmm_t xmm3[2] = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
-  xmm_t xmm4[2] = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
-  xmm_t xmm5[2] = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
-  xmm_t xmm6[2] = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
-  xmm_t xmm7[2] = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
+  xmm_t xmm0 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
+  xmm_t xmm1 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
+  xmm_t xmm2 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
+  xmm_t xmm3 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
+  xmm_t xmm4 = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
+  xmm_t xmm5 = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
+  xmm_t xmm6 = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
+  xmm_t xmm7 = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
 
   asm volatile(
 "movq%0, %%mm0\n\t"


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


[Lldb-commits] [lldb] r359210 - [lldb] [lit] Add tests for reading new x86_64 registers

2019-04-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 25 10:42:49 2019
New Revision: 359210

URL: http://llvm.org/viewvc/llvm-project?rev=359210&view=rev
Log:
[lldb] [lit] Add tests for reading new x86_64 registers

Add tests covering read operations for the general-purpose and XMM
registers added in x86_64 (r8-r15 and xmm8-xmm15).

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
lldb/trunk/lit/Register/x86-64-read.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-read.cpp?rev=359210&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-read.cpp Thu Apr 25 10:42:49 2019
@@ -0,0 +1,55 @@
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  uint64_t r8 = 0x0102030405060708;
+  uint64_t r9 = 0x1112131415161718;
+  uint64_t r10 = 0x2122232425262728;
+  uint64_t r11 = 0x3132333435363738;
+  uint64_t r12 = 0x4142434445464748;
+  uint64_t r13 = 0x5152535455565758;
+  uint64_t r14 = 0x6162636465666768;
+  uint64_t r15 = 0x7172737475767778;
+
+  xmm_t xmm8 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
+  xmm_t xmm9 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
+  xmm_t xmm10 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
+  xmm_t xmm11 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
+  xmm_t xmm12 = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
+  xmm_t xmm13 = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
+  xmm_t xmm14 = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
+  xmm_t xmm15 = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
+
+  asm volatile(
+"movq%0, %%r8\n\t"
+"movq%1, %%r9\n\t"
+"movq%2, %%r10\n\t"
+"movq%3, %%r11\n\t"
+"movq%4, %%r12\n\t"
+"movq%5, %%r13\n\t"
+"movq%6, %%r14\n\t"
+"movq%7, %%r15\n\t"
+"\n\t"
+"movaps  %8, %%xmm8\n\t"
+"movaps  %9, %%xmm9\n\t"
+"movaps  %10, %%xmm10\n\t"
+"movaps  %11, %%xmm11\n\t"
+"movaps  %12, %%xmm12\n\t"
+"movaps  %13, %%xmm13\n\t"
+"movaps  %14, %%xmm14\n\t"
+"movaps  %15, %%xmm15\n\t"
+"\n\t"
+"int3"
+:
+: "g"(r8), "g"(r9), "g"(r10), "g"(r11), "g"(r12), "g"(r13), "g"(r14),
+  "g"(r15), "m"(xmm8), "m"(xmm9), "m"(xmm10), "m"(xmm11), "m"(xmm12),
+  "m"(xmm13), "m"(xmm14), "m"(xmm15)
+: "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%xmm8",
+  "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-read.test?rev=359210&view=auto
==
--- lldb/trunk/lit/Register/x86-64-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-read.test Thu Apr 25 10:42:49 2019
@@ -0,0 +1,48 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx %p/Inputs/x86-64-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: r8 = 0x0102030405060708
+# CHECK-DAG: r9 = 0x1112131415161718
+# CHECK-DAG: r10 = 0x2122232425262728
+# CHECK-DAG: r11 = 0x3132333435363738
+# CHECK-DAG: r12 = 0x4142434445464748
+# CHECK-DAG: r13 = 0x5152535455565758
+# CHECK-DAG: r14 = 0x6162636465666768
+# CHECK-DAG: r15 = 0x7172737475767778
+# CHECK-DAG: r8d = 0x05060708
+# CHECK-DAG: r9d = 0x15161718
+# CHECK-DAG: r10d = 0x25262728
+# CHECK-DAG: r11d = 0x35363738
+# CHECK-DAG: r12d = 0x45464748
+# CHECK-DAG: r13d = 0x55565758
+# CHECK-DAG: r14d = 0x65666768
+# CHECK-DAG: r15d = 0x75767778
+# CHECK-DAG: r8w = 0x0708
+# CHECK-DAG: r9w = 0x1718
+# CHECK-DAG: r10w = 0x2728
+# CHECK-DAG: r11w = 0x3738
+# CHECK-DAG: r12w = 0x4748
+# CHECK-DAG: r13w = 0x5758
+# CHECK-DAG: r14w = 0x6768
+# CHECK-DAG: r15w = 0x7778
+# CHECK-DAG: r8l = 0x08
+# CHECK-DAG: r9l = 0x18
+# CHECK-DAG: r10l = 0x28
+# CHECK-DAG: r11l = 0x38
+# CHECK-DAG: r12l = 0x48
+# CHECK-DAG: r13l = 0x58
+# CHECK-DAG: r14l = 0x68
+# CHECK-DAG: r15l = 0x78
+# CHECK-DAG: xmm8 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}
+# CHECK-DAG: xmm9 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}
+# CHECK-DAG: xmm10 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}
+# CHECK-DAG: xmm11 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}
+# CHECK-DAG: xmm12 = {0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}
+# CHECK-DAG: xmm13 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}
+# CHECK-DAG: xmm14 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}
+# CHECK-DAG: xmm15 = {0x71 0x7e 0x7c 0x

[Lldb-commits] [lldb] r359221 - [lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin

2019-04-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 25 11:38:58 2019
New Revision: 359221

URL: http://llvm.org/viewvc/llvm-project?rev=359221&view=rev
Log:
[lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin

Modified:
lldb/trunk/lit/Register/x86-64-read.test

Modified: lldb/trunk/lit/Register/x86-64-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-read.test?rev=359221&r1=359220&r2=359221&view=diff
==
--- lldb/trunk/lit/Register/x86-64-read.test (original)
+++ lldb/trunk/lit/Register/x86-64-read.test Thu Apr 25 11:38:58 2019
@@ -1,4 +1,3 @@
-# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx %p/Inputs/x86-64-read.cpp -o %t


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


[Lldb-commits] [lldb] r359228 - [lldb] [lit] Use constexpr and better constraints in Register tests

2019-04-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 25 12:56:54 2019
New Revision: 359228

URL: http://llvm.org/viewvc/llvm-project?rev=359228&view=rev
Log:
[lldb] [lit] Use constexpr and better constraints in Register tests

Use constexpr to explicitly indicate that we're dealing with integer
constants, and provoke clang to assign them straight to registers
whenever possible.  Adjust input constraints in %mmN tests to "rm"
as using integer constants is apparently disallowed there.  Also
use "i" for %rN tests, as we don't want clang to accidentally clobber
those general purpose registers while assigning to them (however
unlikely that is).

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-read.cpp?rev=359228&r1=359227&r2=359228&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-read.cpp Thu Apr 25 12:56:54 2019
@@ -5,23 +5,23 @@ struct alignas(16) xmm_t {
 };
 
 int main() {
-  uint64_t r8 = 0x0102030405060708;
-  uint64_t r9 = 0x1112131415161718;
-  uint64_t r10 = 0x2122232425262728;
-  uint64_t r11 = 0x3132333435363738;
-  uint64_t r12 = 0x4142434445464748;
-  uint64_t r13 = 0x5152535455565758;
-  uint64_t r14 = 0x6162636465666768;
-  uint64_t r15 = 0x7172737475767778;
+  constexpr uint64_t r8 = 0x0102030405060708;
+  constexpr uint64_t r9 = 0x1112131415161718;
+  constexpr uint64_t r10 = 0x2122232425262728;
+  constexpr uint64_t r11 = 0x3132333435363738;
+  constexpr uint64_t r12 = 0x4142434445464748;
+  constexpr uint64_t r13 = 0x5152535455565758;
+  constexpr uint64_t r14 = 0x6162636465666768;
+  constexpr uint64_t r15 = 0x7172737475767778;
 
-  xmm_t xmm8 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
-  xmm_t xmm9 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
-  xmm_t xmm10 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
-  xmm_t xmm11 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
-  xmm_t xmm12 = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
-  xmm_t xmm13 = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
-  xmm_t xmm14 = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
-  xmm_t xmm15 = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
+  constexpr xmm_t xmm8 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
+  constexpr xmm_t xmm9 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
+  constexpr xmm_t xmm10 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
+  constexpr xmm_t xmm11 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
+  constexpr xmm_t xmm12 = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
+  constexpr xmm_t xmm13 = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
+  constexpr xmm_t xmm14 = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
+  constexpr xmm_t xmm15 = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
 
   asm volatile(
 "movq%0, %%r8\n\t"
@@ -44,8 +44,8 @@ int main() {
 "\n\t"
 "int3"
 :
-: "g"(r8), "g"(r9), "g"(r10), "g"(r11), "g"(r12), "g"(r13), "g"(r14),
-  "g"(r15), "m"(xmm8), "m"(xmm9), "m"(xmm10), "m"(xmm11), "m"(xmm12),
+: "i"(r8), "i"(r9), "i"(r10), "i"(r11), "i"(r12), "i"(r13), "i"(r14),
+  "i"(r15), "m"(xmm8), "m"(xmm9), "m"(xmm10), "m"(xmm11), "m"(xmm12),
   "m"(xmm13), "m"(xmm14), "m"(xmm15)
 : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%xmm8",
   "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp?rev=359228&r1=359227&r2=359228&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp Thu Apr 25 12:56:54 2019
@@ -5,23 +5,23 @@ struct alignas(16) xmm_t {
 };
 
 int main() {
-  uint64_t mm0 = 0x0102030405060708;
-  uint64_t mm1 = 0x1112131415161718;
-  uint64_t mm2 = 0x2122232425262728;
-  uint64_t mm3 = 0x3132333435363738;
-  uint64_t mm4 = 0x4142434445464748;
-  uint64_t mm5 = 0x5152535455565758;
-  uint64_t mm6 = 0x6162636465666768;
-  uint64_t mm7 = 0x7172737475767778;
+  constexpr uint64_t mm0 = 0x0102030405060708;
+  constexpr uint64_t mm1 = 0x1112131415161718;
+  constexpr uint64_t mm2 = 0x2122232425262728;
+  constexpr uint64_t mm3 = 0x3132333435363738;
+  constexpr uint64_t mm4 = 0x4142434445464748;
+  constexpr uint64_t mm5 = 0x5152535455565758;
+  constexpr uint64_t mm6 = 0x6162636465666768;
+  constexpr uint64_t mm7 = 0x7172737475767778;
 
-  xmm_t xmm0 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
-  xmm_t xmm1 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
-  xmm_t xmm2 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
-  xmm_t xmm3 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
-  xmm_t xmm4 = { 0x424446484A

[Lldb-commits] [lldb] r359304 - [lldb] [lit] Add register read tests for YMM registers (AVX)

2019-04-26 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Apr 26 06:21:58 2019
New Revision: 359304

URL: http://llvm.org/viewvc/llvm-project?rev=359304&view=rev
Log:
[lldb] [lit] Add register read tests for YMM registers (AVX)

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

Added:
lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp
lldb/trunk/lit/Register/x86-64-ymm-read.test
lldb/trunk/lit/Register/x86-ymm-read.test
Modified:
lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp

Added: lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp?rev=359304&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp Fri Apr 26 06:21:58 2019
@@ -0,0 +1,81 @@
+#include 
+
+struct alignas(32) ymm_t {
+  uint64_t a, b, c, d;
+};
+
+int main() {
+  constexpr ymm_t ymm0 = { 0x020406080A0C0E01, 0x030507090B0D0F00,
+   0x838587898B8D8F80, 0x828486888A8C8E81 };
+  constexpr ymm_t ymm1 = { 0x121416181A1C1E11, 0x131517191B1D1F10,
+   0x939597999B9D9F90, 0x929496989A9C9E91 };
+  constexpr ymm_t ymm2 = { 0x222426282A2C2E21, 0x232527292B2D2F20,
+   0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1 };
+  constexpr ymm_t ymm3 = { 0x323436383A3C3E31, 0x333537393B3D3F30,
+   0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1 };
+  constexpr ymm_t ymm4 = { 0x424446484A4C4E41, 0x434547494B4D4F40,
+   0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1 };
+  constexpr ymm_t ymm5 = { 0x525456585A5C5E51, 0x535557595B5D5F50,
+   0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1 };
+  constexpr ymm_t ymm6 = { 0x626466686A6C6E61, 0x636567696B6D6F60,
+   0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1 };
+  constexpr ymm_t ymm7 = { 0x727476787A7C7E71, 0x737577797B7D7F70,
+   0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1 };
+#if defined(__x86_64__) || defined(_M_X64)
+  constexpr ymm_t ymm8 = { 0x838587898B8D8F80, 0x828486888A8C8E81,
+   0x020406080A0C0E01, 0x030507090B0D0F00 };
+  constexpr ymm_t ymm9 = { 0x939597999B9D9F90, 0x929496989A9C9E91,
+   0x121416181A1C1E11, 0x131517191B1D1F10 };
+  constexpr ymm_t ymm10 = { 0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1,
+0x222426282A2C2E21, 0x232527292B2D2F20 };
+  constexpr ymm_t ymm11 = { 0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1,
+0x323436383A3C3E31, 0x333537393B3D3F30 };
+  constexpr ymm_t ymm12 = { 0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1,
+0x424446484A4C4E41, 0x434547494B4D4F40 };
+  constexpr ymm_t ymm13 = { 0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1,
+0x525456585A5C5E51, 0x535557595B5D5F50 };
+  constexpr ymm_t ymm14 = { 0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1,
+0x626466686A6C6E61, 0x636567696B6D6F60 };
+  constexpr ymm_t ymm15 = { 0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1,
+0x727476787A7C7E71, 0x737577797B7D7F70 };
+#endif
+
+  asm volatile(
+"vmovaps  %0, %%ymm0\n\t"
+"vmovaps  %1, %%ymm1\n\t"
+"vmovaps  %2, %%ymm2\n\t"
+"vmovaps  %3, %%ymm3\n\t"
+"vmovaps  %4, %%ymm4\n\t"
+"vmovaps  %5, %%ymm5\n\t"
+"vmovaps  %6, %%ymm6\n\t"
+"vmovaps  %7, %%ymm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %8, %%ymm8\n\t"
+"vmovaps  %9, %%ymm9\n\t"
+"vmovaps  %10, %%ymm10\n\t"
+"vmovaps  %11, %%ymm11\n\t"
+"vmovaps  %12, %%ymm12\n\t"
+"vmovaps  %13, %%ymm13\n\t"
+"vmovaps  %14, %%ymm14\n\t"
+"vmovaps  %15, %%ymm15\n\t"
+#endif
+"\n\t"
+"int3"
+:
+: "m"(ymm0), "m"(ymm1), "m"(ymm2), "m"(ymm3), "m"(ymm4), "m"(ymm5),
+  "m"(ymm6), "m"(ymm7)
+#if defined(__x86_64__) || defined(_M_X64)
+  ,
+  "m"(ymm8), "m"(ymm9), "m"(ymm10), "m"(ymm11),
+  "m"(ymm12), "m"(ymm13), "m"(ymm14), "m"(ymm15)
+#endif
+: "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7"
+#if defined(__x86_64__) || defined(_M_X64)
+  ,
+  "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14",
+  "%ymm15"
+#endif
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-ymm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-read.test?rev=359304&view=auto
==
--- lldb/trunk/lit/Register/x86-64-ymm-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-ymm-read.test Fri Apr 26 06:21:58 2019
@@ -0,0 +1,39 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: xmm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x0

[Lldb-commits] [lldb] r359303 - [lldb] [lit] Add feature flags for native CPU features

2019-04-26 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri Apr 26 06:21:46 2019
New Revision: 359303

URL: http://llvm.org/viewvc/llvm-project?rev=359303&view=rev
Log:
[lldb] [lit] Add feature flags for native CPU features

Add a new lit-cpuid tool that detects CPU features used by some of
the tests, and use it to populate available_features in lit.  For now,
this means that the test for MM/XMM register read will be run only
when the host CPU support SSE instruction set.  However, this is going
to make it possible to introduce additional tests relying on AVX.

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

Added:
lldb/trunk/utils/lit-cpuid/
lldb/trunk/utils/lit-cpuid/CMakeLists.txt
lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp
Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/Register/x86-mm-xmm-read.test
lldb/trunk/lit/lit.cfg.py

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=359303&r1=359302&r2=359303&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Fri Apr 26 06:21:46 2019
@@ -138,6 +138,7 @@ if(LLDB_INCLUDE_TESTS)
   add_subdirectory(test)
   add_subdirectory(unittests)
   add_subdirectory(lit)
+  add_subdirectory(utils/lit-cpuid)
   add_subdirectory(utils/lldb-dotest)
 endif()
 

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=359303&r1=359302&r2=359303&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Fri Apr 26 06:21:46 2019
@@ -20,6 +20,7 @@ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLV
 list(APPEND LLDB_TEST_DEPS
   LLDBUnitTests
   dsymutil
+  lit-cpuid
   llc
   lldb
   lldb-test

Modified: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=359303&r1=359302&r2=359303&view=diff
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (original)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Fri Apr 26 06:21:46 2019
@@ -1,6 +1,6 @@
 # XFAIL: system-darwin
 # XFAIL: system-windows
-# REQUIRES: native && (target-x86 || target-x86_64)
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
 # RUN: %clangxx %p/Inputs/x86-mm-xmm-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=359303&r1=359302&r2=359303&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Fri Apr 26 06:21:46 2019
@@ -73,3 +73,17 @@ for i in ['module-cache-clang', 'module-
 if os.path.isdir(cachedir):
 print("Deleting module cache at %s."%cachedir)
 shutil.rmtree(cachedir)
+
+# If running tests natively, check for CPU features needed for some tests.
+
+if 'native' in config.available_features:
+cpuid_exe = lit.util.which('lit-cpuid', config.lldb_tools_dir)
+if cpuid_exe is None:
+lit_config.warning("lit-cpuid not found, tests requiring CPU 
extensions will be skipped")
+else:
+out, err, exitcode = lit.util.executeCommand([cpuid_exe])
+if exitcode == 0:
+for x in out.split():
+config.available_features.add('native-cpu-%s' % x)
+else:
+lit_config.warning("lit-cpuid failed: %s" % err)

Added: lldb/trunk/utils/lit-cpuid/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/lit-cpuid/CMakeLists.txt?rev=359303&view=auto
==
--- lldb/trunk/utils/lit-cpuid/CMakeLists.txt (added)
+++ lldb/trunk/utils/lit-cpuid/CMakeLists.txt Fri Apr 26 06:21:46 2019
@@ -0,0 +1,5 @@
+add_llvm_utility(lit-cpuid
+  lit-cpuid.cpp
+  )
+
+target_link_libraries(lit-cpuid PRIVATE LLVMSupport)

Added: lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp?rev=359303&view=auto
==
--- lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp (added)
+++ lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp Fri Apr 26 06:21:46 2019
@@ -0,0 +1,33 @@
+//===- lit-cpuid.cpp - Get CPU feature flags for lit exported features 
===//
+//
+// 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
+//
+//===--===//
+//
+// lit-cpuid obtains the feature list for the currently runnin

[Lldb-commits] [lldb] r359375 - [lldb] [lit] Cleanly terminate Register tests

2019-04-27 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat Apr 27 00:43:29 2019
New Revision: 359375

URL: http://llvm.org/viewvc/llvm-project?rev=359375&view=rev
Log:
[lldb] [lit] Cleanly terminate Register tests

Continue the Register test processes, and let them terminate cleanly
rather than implicitly terminating them along with lldb.

Modified:
lldb/trunk/lit/Register/x86-64-read.test
lldb/trunk/lit/Register/x86-64-ymm-read.test
lldb/trunk/lit/Register/x86-mm-xmm-read.test
lldb/trunk/lit/Register/x86-ymm-read.test

Modified: lldb/trunk/lit/Register/x86-64-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-read.test?rev=359375&r1=359374&r2=359375&view=diff
==
--- lldb/trunk/lit/Register/x86-64-read.test (original)
+++ lldb/trunk/lit/Register/x86-64-read.test Sat Apr 27 00:43:29 2019
@@ -45,3 +45,6 @@ register read --all
 # CHECK-DAG: xmm13 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}
 # CHECK-DAG: xmm14 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}
 # CHECK-DAG: xmm15 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-64-ymm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-read.test?rev=359375&r1=359374&r2=359375&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm-read.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm-read.test Sat Apr 27 00:43:29 2019
@@ -37,3 +37,6 @@ register read --all
 # CHECK-DAG: ymm13 = {0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 
0xda 0xd8 0xd6 0xd4 0xd2 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}
 # CHECK-DAG: ymm14 = {0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 
0xea 0xe8 0xe6 0xe4 0xe2 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}
 # CHECK-DAG: ymm15 = {0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 
0xfa 0xf8 0xf6 0xf4 0xf2 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-mm-xmm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-read.test?rev=359375&r1=359374&r2=359375&view=diff
==
--- lldb/trunk/lit/Register/x86-mm-xmm-read.test (original)
+++ lldb/trunk/lit/Register/x86-mm-xmm-read.test Sat Apr 27 00:43:29 2019
@@ -22,3 +22,6 @@ register read --all
 # CHECK-DAG: xmm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}
 # CHECK-DAG: xmm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}
 # CHECK-DAG: xmm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-ymm-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-ymm-read.test?rev=359375&r1=359374&r2=359375&view=diff
==
--- lldb/trunk/lit/Register/x86-ymm-read.test (original)
+++ lldb/trunk/lit/Register/x86-ymm-read.test Sat Apr 27 00:43:29 2019
@@ -21,3 +21,6 @@ register read --all
 # CHECK-DAG: ymm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 
0xda 0xd8 0xd6 0xd4 0xd2}
 # CHECK-DAG: ymm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 
0xea 0xe8 0xe6 0xe4 0xe2}
 # CHECK-DAG: ymm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 
0xfa 0xf8 0xf6 0xf4 0xf2}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0


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


[Lldb-commits] [lldb] r359440 - [lldb] [test] Remove duplicate YMM/ZMM dotest tests

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:17 2019
New Revision: 359440

URL: http://llvm.org/viewvc/llvm-project?rev=359440&view=rev
Log:
[lldb] [test] Remove duplicate YMM/ZMM dotest tests

Removed:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/

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


[Lldb-commits] [lldb] r359438 - [lldb] [lit] Introduce tests for reading x86 general purpose registers

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:37:58 2019
New Revision: 359438

URL: http://llvm.org/viewvc/llvm-project?rev=359438&view=rev
Log:
[lldb] [lit] Introduce tests for reading x86 general purpose registers

Introduce tests for reading the eight x86 general purpose registers,
i.e. RAX/RBX/RCX/RDX/RBP/RSP/RSI/RDI and their shorter counterparts.
The test comes in separate 32-bit and 64-bit variant, targeting
appropriate processors.

While technically the 32-bit test could run on amd64, it would be
redundant to the 64-bit version, so just run one of them on each arch.

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
lldb/trunk/lit/Register/x86-64-gp-read.test
lldb/trunk/lit/Register/x86-gp-read.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp Mon Apr 29 04:37:58 2019
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint64_t rax = 0x0102030405060708;
+  constexpr uint64_t rbx = 0x1112131415161718;
+  constexpr uint64_t rcx = 0x2122232425262728;
+  constexpr uint64_t rdx = 0x3132333435363738;
+  constexpr uint64_t rsp = 0x4142434445464748;
+  constexpr uint64_t rbp = 0x5152535455565758;
+  constexpr uint64_t rsi = 0x6162636465666768;
+  constexpr uint64_t rdi = 0x7172737475767778;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%r8\n\t"
+"movq%%rbp, %%r9\n\t"
+"\n\t"
+"movq%0, %%rax\n\t"
+"movq%1, %%rbx\n\t"
+"movq%2, %%rcx\n\t"
+"movq%3, %%rdx\n\t"
+"movq%4, %%rsp\n\t"
+"movq%5, %%rbp\n\t"
+"movq%6, %%rsi\n\t"
+"movq%7, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%r8, %%rsp\n\t"
+"movq%%r9, %%rbp"
+:
+: "i"(rax), "i"(rbx), "i"(rcx), "i"(rdx), "i"(rsp), "i"(rbp), "i"(rsi),
+  "i"(rdi)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%r8",
+  "%r9"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp Mon Apr 29 04:37:58 2019
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint32_t eax = 0x05060708;
+  constexpr uint32_t ebx = 0x15161718;
+  constexpr uint32_t ecx = 0x25262728;
+  constexpr uint32_t edx = 0x35363738;
+  constexpr uint32_t esp = 0x45464748;
+  constexpr uint32_t ebp = 0x55565758;
+  constexpr uint32_t esi = 0x65666768;
+  constexpr uint32_t edi = 0x75767778;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%0, %%eax\n\t"
+"movl%1, %%ebx\n\t"
+"movl%2, %%ecx\n\t"
+"movl%3, %%edx\n\t"
+"movl%4, %%esp\n\t"
+"movl%5, %%ebp\n\t"
+"movl%6, %%esi\n\t"
+"movl%7, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore esp & ebp
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+:
+: "i"(eax), "i"(ebx), "i"(ecx), "i"(edx), "i"(esp), "i"(ebp), "i"(esi),
+  "i"(edi)
+: "%eax", "%ebx", "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0",
+  "%mm1"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-gp-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-read.test?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/x86-64-gp-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-gp-read.test Mon Apr 29 04:37:58 2019
@@ -0,0 +1,42 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: rax = 0x0102030405060708
+# CHECK-DAG: rbx = 0x1112131415161718
+# CHECK-DAG: rcx = 0x2122232425262728
+# CHECK-DAG: rdx = 0x3132333435363738
+# CHECK-DAG: rdi = 0x7172737475767778
+# CHECK-DAG: rsi = 0x6162636465666768
+# CHECK-DAG: rbp = 0x5152535455565758
+# CHECK-DAG: rsp = 0x4142434445464748
+# CHECK-DAG: eax = 0x05060708
+# CHECK-DAG: ebx = 0x15161718
+# CHECK-DAG: ecx = 0x25262728
+# CHECK-DAG: edx = 0x35363738
+# CHECK-DAG: edi = 0x75767778
+# CHECK-DAG: esi = 0x65666768
+# CHECK-DAG: ebp = 0x55565758
+# CHECK-DAG: esp = 0x45464748
+# CHECK-DAG: ax = 0x0708
+# CHECK-DAG: bx = 0x1718
+# CHECK-D

[Lldb-commits] [lldb] r359439 - [lldb] [lit] Add tests for reading ZMM registers (AVX512)

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:10 2019
New Revision: 359439

URL: http://llvm.org/viewvc/llvm-project?rev=359439&view=rev
Log:
[lldb] [lit] Add tests for reading ZMM registers (AVX512)

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

Added:
lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
lldb/trunk/lit/Register/x86-64-zmm-read.test
lldb/trunk/lit/Register/x86-zmm-read.test
Modified:
lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp

Added: lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp?rev=359439&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp Mon Apr 29 04:38:10 2019
@@ -0,0 +1,196 @@
+#include 
+
+struct alignas(64) zmm_t {
+  uint64_t a, b, c, d, e, f, g, h;
+};
+
+int main() {
+  zmm_t zmm0 = { 0x020406080A0C0E01, 0x030507090B0D0F00,
+ 0x838587898B8D8F80, 0x828486888A8C8E81,
+ 0x424446484A4C4E41, 0x434547494B4D4F40,
+ 0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1 };
+  zmm_t zmm1 = { 0x121416181A1C1E11, 0x131517191B1D1F10,
+ 0x939597999B9D9F90, 0x929496989A9C9E91,
+ 0x525456585A5C5E51, 0x535557595B5D5F50,
+ 0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1 };
+  zmm_t zmm2 = { 0x222426282A2C2E21, 0x232527292B2D2F20,
+ 0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1,
+ 0x626466686A6C6E61, 0x636567696B6D6F60,
+ 0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1 };
+  zmm_t zmm3 = { 0x323436383A3C3E31, 0x333537393B3D3F30,
+ 0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1,
+ 0x727476787A7C7E71, 0x737577797B7D7F70,
+ 0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1 };
+  zmm_t zmm4 = { 0x424446484A4C4E41, 0x434547494B4D4F40,
+ 0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1,
+ 0x828486888A8C8E81, 0x838587898B8D8F80,
+ 0x030507090B0D0F00, 0x020406080A0C0E01 };
+  zmm_t zmm5 = { 0x525456585A5C5E51, 0x535557595B5D5F50,
+ 0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1,
+ 0x929496989A9C9E91, 0x939597999B9D9F90,
+ 0x131517191B1D1F10, 0x121416181A1C1E11 };
+  zmm_t zmm6 = { 0x626466686A6C6E61, 0x636567696B6D6F60,
+ 0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1,
+ 0xA2A4A6A8AAACAEA1, 0xA3A5A7A9ABADAFA0,
+ 0x232527292B2D2F20, 0x222426282A2C2E21 };
+  zmm_t zmm7 = { 0x727476787A7C7E71, 0x737577797B7D7F70,
+ 0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1,
+ 0xB2B4B6B8BABCBEB1, 0xB3B5B7B9BBBDBFB0,
+ 0x333537393B3D3F30, 0x323436383A3C3E31 };
+#if defined(__x86_64__) || defined(_M_X64)
+  zmm_t zmm8 = { 0x828486888A8C8E81, 0x838587898B8D8F80,
+ 0x030507090B0D0F00, 0x020406080A0C0E01,
+ 0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDCFC0,
+ 0x434547494B4D4F40, 0x424446484A4C4E41 };
+  zmm_t zmm9 = { 0x929496989A9C9E91, 0x939597999B9D9F90,
+ 0x131517191B1D1F10, 0x121416181A1C1E11,
+ 0xD2D4D6D8DADCDED1, 0xD3D5D7D9DBDDDFD0,
+ 0x535557595B5D5F50, 0x525456585A5C5E51 };
+  zmm_t zmm10 = { 0xA2A4A6A8AAACAEA1, 0xA3A5A7A9ABADAFA0,
+  0x232527292B2D2F20, 0x222426282A2C2E21,
+  0xE2E4E6E8EAECEEE1, 0xE3E5E7E9EBEDEFE0,
+  0x636567696B6D6F60, 0x626466686A6C6E61 };
+  zmm_t zmm11 = { 0xB2B4B6B8BABCBEB1, 0xB3B5B7B9BBBDBFB0,
+  0x333537393B3D3F30, 0x323436383A3C3E31,
+  0xF2F4F6F8FAFCFEF1, 0xF3F5F7F9FBFDFFF0,
+  0x737577797B7D7F70, 0x727476787A7C7E71 };
+  zmm_t zmm12 = { 0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDCFC0,
+  0x434547494B4D4F40, 0x424446484A4C4E41,
+  0x020406080A0C0E01, 0x030507090B0D0F00,
+  0x838587898B8D8F80, 0x828486888A8C8E81 };
+  zmm_t zmm13 = { 0xD2D4D6D8DADCDED1, 0xD3D5D7D9DBDDDFD0,
+  0x535557595B5D5F50, 0x525456585A5C5E51,
+  0x121416181A1C1E11, 0x131517191B1D1F10,
+  0x939597999B9D9F90, 0x929496989A9C9E91 };
+  zmm_t zmm14 = { 0xE2E4E6E8EAECEEE1, 0xE3E5E7E9EBEDEFE0,
+  0x636567696B6D6F60, 0x626466686A6C6E61,
+  0x222426282A2C2E21, 0x232527292B2D2F20,
+  0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1 };
+  zmm_t zmm15 = { 0xF2F4F6F8FAFCFEF1, 0xF3F5F7F9FBFDFFF0,
+  0x737577797B7D7F70, 0x727476787A7C7E71,
+  0x323436383A3C3E31, 0x333537393B3D3F30,
+  0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1 };
+  zmm_t zmm16 = { 0x030507090B0D0F00, 0x020406080A0C0E01,
+  0x828486888A8C8E81, 0x838587898B8D8F80,
+  0x434547494B4D4F40, 0x424446484A4C4E41,
+  0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDC

[Lldb-commits] [lldb] r359441 - [lldb] [lit] Introduce tests for writing x86 general-purpose registers

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:28 2019
New Revision: 359441

URL: http://llvm.org/viewvc/llvm-project?rev=359441&view=rev
Log:
[lldb] [lit] Introduce tests for writing x86 general-purpose registers

Introduce two initial tests for 'register write' command.  The tests
first clobber x86 general purpose registers, then call int3 to let lldb
write to them, then print the new values.  FileCheck takes care of
verifying whether correct values were written.

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp
lldb/trunk/lit/Register/x86-64-gp-write.test
lldb/trunk/lit/Register/x86-gp-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp Mon Apr 29 04:38:28 2019
@@ -0,0 +1,55 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint64_t fill = 0x0F0F0F0F0F0F0F0F;
+
+  uint64_t rax, rbx, rcx, rdx, rsp, rbp, rsi, rdi;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%mm0\n\t"
+"movq%%rbp, %%mm1\n\t"
+"\n\t"
+"movq%8, %%rax\n\t"
+"movq%8, %%rbx\n\t"
+"movq%8, %%rcx\n\t"
+"movq%8, %%rdx\n\t"
+"movq%8, %%rsp\n\t"
+"movq%8, %%rbp\n\t"
+"movq%8, %%rsi\n\t"
+"movq%8, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"movq%%rax, %0\n\t"
+"movq%%rbx, %1\n\t"
+"movq%%rcx, %2\n\t"
+"movq%%rdx, %3\n\t"
+"movq%%rsp, %4\n\t"
+"movq%%rbp, %5\n\t"
+"movq%%rsi, %6\n\t"
+"movq%%rdi, %7\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%mm0, %%rsp\n\t"
+"movq%%mm1, %%rbp\n\t"
+: "=r"(rax), "=r"(rbx), "=r"(rcx), "=r"(rdx), "=r"(rsp), "=r"(rbp),
+  "=r"(rsi), "=r"(rdi)
+: "g"(fill)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%mm0",
+  "%mm1"
+  );
+
+  printf("rax = 0x%016" PRIx64 "\n", rax);
+  printf("rbx = 0x%016" PRIx64 "\n", rbx);
+  printf("rcx = 0x%016" PRIx64 "\n", rcx);
+  printf("rdx = 0x%016" PRIx64 "\n", rdx);
+  printf("rsp = 0x%016" PRIx64 "\n", rsp);
+  printf("rbp = 0x%016" PRIx64 "\n", rbp);
+  printf("rsi = 0x%016" PRIx64 "\n", rsi);
+  printf("rdi = 0x%016" PRIx64 "\n", rdi);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp Mon Apr 29 04:38:28 2019
@@ -0,0 +1,61 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint32_t fill = 0x0F0F0F0F;
+
+  uint32_t eax, ebx, ecx, edx, esp, ebp, esi, edi;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%8, %%eax\n\t"
+"movl%8, %%ebx\n\t"
+"movl%8, %%ecx\n\t"
+"movl%8, %%edx\n\t"
+"movl%8, %%esp\n\t"
+"movl%8, %%ebp\n\t"
+"movl%8, %%esi\n\t"
+"movl%8, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// first save new esp & ebp, and restore their original values, so that
+// we can output values via memory
+"movd%%esp, %%mm2\n\t"
+"movd%%ebp, %%mm3\n\t"
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+"\n\t"
+// output values via memory
+"movl%%eax, %0\n\t"
+"movl%%ebx, %1\n\t"
+"movl%%ecx, %2\n\t"
+"movl%%edx, %3\n\t"
+"movl%%esi, %6\n\t"
+"movl%%edi, %7\n\t"
+"\n\t"
+// output saved esp & ebp
+"movd%%mm2, %4\n\t"
+"movd%%mm3, %5\n\t"
+: "=m"(eax), "=m"(ebx), "=m"(ecx), "=m"(edx), "=a"(esp), "=b"(ebp),
+  "=m"(esi), "=m"(edi)
+: "i"(fill)
+: "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0", "%mm1", "%mm2",
+  "%mm3"
+  );
+
+  printf("eax = 0x%08" PRIx32 "\n", eax);
+  printf("ebx = 0x%08" PRIx32 "\n", ebx);
+  printf("ecx = 0x%08" PRIx32 "\n", ecx);
+  printf("edx = 0x%08" PRIx32 "\n", edx);
+  printf("esp = 0x%08" PRIx32 "\n", esp);
+  printf("ebp = 0x%08" PRIx32 "\n", ebp);
+  printf("esi = 0x%08" PRIx32 "\n", esi);
+  printf("edi = 0x%08" PRIx32 "\n", edi);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-write.test?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/x86-64-gp-write.test (added)
+++ lldb/trunk/lit

[Lldb-commits] [lldb] r359572 - [lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls

2019-04-30 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue Apr 30 09:30:32 2019
New Revision: 359572

URL: http://llvm.org/viewvc/llvm-project?rev=359572&view=rev
Log:
[lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls

Fix bugs in piod_len return value processing in ReadMemory()
and WriteMemory() methods.  In particular, add support for piod_len == 0
indicating EOF, and fix summing bytes_read/bytes_written when PT_IO does
partial reads/writes.

The EOF condition could happen if LLDB attempts to read past
vm.maxaddress, e.g. as a result of RBP containing large (invalid) value.
Previously, the 0 return caused the function to retry reading via PT_IO
indefinitely, effectively deadlooping lldb-server.

Partial reads probably did not occur in practice, yet they would cause
ReadMemory() to return incorrect bytes_read and/or overwrite previously
read data.

WriteMemory() suffered from analoguous problems.

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

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=359572&r1=359571&r2=359572&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Tue Apr 30 
09:30:32 2019
@@ -695,10 +695,10 @@ Status NativeProcessNetBSD::ReadMemory(l
 io.piod_addr = dst + bytes_read;
 
 Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
-if (error.Fail())
+if (error.Fail() || io.piod_len == 0)
   return error;
 
-bytes_read = io.piod_len;
+bytes_read += io.piod_len;
 io.piod_len = size - bytes_read;
   } while (bytes_read < size);
 
@@ -723,10 +723,10 @@ Status NativeProcessNetBSD::WriteMemory(
 io.piod_offs = (void *)(addr + bytes_written);
 
 Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
-if (error.Fail())
+if (error.Fail() || io.piod_len == 0)
   return error;
 
-bytes_written = io.piod_len;
+bytes_written += io.piod_len;
 io.piod_len = size - bytes_written;
   } while (bytes_written < size);
 


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


[Lldb-commits] [lldb] r359682 - [lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers

2019-05-01 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May  1 06:55:23 2019
New Revision: 359682

URL: http://llvm.org/viewvc/llvm-project?rev=359682&view=rev
Log:
[lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/x86-64-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=359682&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Wed May  1 06:55:23 2019
@@ -0,0 +1,67 @@
+#include 
+#include 
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+
+  uint64_t r64[8];
+  xmm_t xmm[8];
+
+  asm volatile(
+"movq%2, %%r8\n\t"
+"movq%2, %%r9\n\t"
+"movq%2, %%r10\n\t"
+"movq%2, %%r11\n\t"
+"movq%2, %%r12\n\t"
+"movq%2, %%r13\n\t"
+"movq%2, %%r14\n\t"
+"movq%2, %%r15\n\t"
+"\n\t"
+"movaps  %2, %%xmm8\n\t"
+"movaps  %2, %%xmm9\n\t"
+"movaps  %2, %%xmm10\n\t"
+"movaps  %2, %%xmm11\n\t"
+"movaps  %2, %%xmm12\n\t"
+"movaps  %2, %%xmm13\n\t"
+"movaps  %2, %%xmm14\n\t"
+"movaps  %2, %%xmm15\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"movq%%r8, 0x00(%%rbx)\n\t"
+"movq%%r9, 0x08(%%rbx)\n\t"
+"movq%%r10, 0x10(%%rbx)\n\t"
+"movq%%r11, 0x18(%%rbx)\n\t"
+"movq%%r12, 0x20(%%rbx)\n\t"
+"movq%%r13, 0x28(%%rbx)\n\t"
+"movq%%r14, 0x30(%%rbx)\n\t"
+"movq%%r15, 0x38(%%rbx)\n\t"
+"\n\t"
+"lea %1, %%rbx\n\t"
+"movaps  %%xmm8, 0x00(%%rbx)\n\t"
+"movaps  %%xmm9, 0x10(%%rbx)\n\t"
+"movaps  %%xmm10, 0x20(%%rbx)\n\t"
+"movaps  %%xmm11, 0x30(%%rbx)\n\t"
+"movaps  %%xmm12, 0x40(%%rbx)\n\t"
+"movaps  %%xmm13, 0x50(%%rbx)\n\t"
+"movaps  %%xmm14, 0x60(%%rbx)\n\t"
+"movaps  %%xmm15, 0x70(%%rbx)\n\t"
+: "=m"(r64), "=m"(xmm)
+: "m"(xmm_fill)
+: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  for (int i = 0; i < 8; ++i)
+printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]);
+  for (int i = 0; i < 8; ++i)
+printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i+8, xmm[i].b, 
xmm[i].a);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-write.test?rev=359682&view=auto
==
--- lldb/trunk/lit/Register/x86-64-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-write.test Wed May  1 06:55:23 2019
@@ -0,0 +1,47 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
+# RUN: %clangxx %p/Inputs/x86-64-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write r8 0x0102030405060708
+register write r9 0x1112131415161718
+register write r10 0x2122232425262728
+register write r11 0x3132333435363738
+register write r12 0x4142434445464748
+register write r13 0x5152535455565758
+register write r14 0x6162636465666768
+register write r15 0x7172737475767778
+
+register write xmm8 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}"
+register write xmm9 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}"
+register write xmm10 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}"
+register write xmm11 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}"
+register write xmm12 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}"
+register write xmm13 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}"
+register write xmm14 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}"
+register write xmm15 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: r8 = 0x0102030405060708
+# CHECK-DAG: r9 = 0x1112131415161718
+# CHECK-DAG: r10 = 0x2122232425262728
+# CHECK-DAG: r11 = 0x3132333435363738
+# CHECK-DAG: r12 = 0x4142434445464748
+# CHECK-DAG: r13 = 0x5152535455565758
+# CHECK-DAG: r14 = 0x6162636465666768
+# CHECK-DAG: r15 = 0x7172737475767778
+
+# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: xmm9 = 0x131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: xmm10 = 0x232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: xmm11 = 0x333537393b3d3f30323436383a3c3e31

[Lldb-commits] [lldb] r359681 - [lldb] [lit] Add write tests for MM/XMM registers

2019-05-01 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May  1 06:55:13 2019
New Revision: 359681

URL: http://llvm.org/viewvc/llvm-project?rev=359681&view=rev
Log:
[lldb] [lit] Add write tests for MM/XMM registers

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

Added:
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/x86-mm-xmm-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp?rev=359681&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp Wed May  1 06:55:13 2019
@@ -0,0 +1,67 @@
+#include 
+#include 
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+
+  uint64_t mm[8];
+  xmm_t xmm[8];
+
+  asm volatile(
+"movq%2, %%mm0\n\t"
+"movq%2, %%mm1\n\t"
+"movq%2, %%mm2\n\t"
+"movq%2, %%mm3\n\t"
+"movq%2, %%mm4\n\t"
+"movq%2, %%mm5\n\t"
+"movq%2, %%mm6\n\t"
+"movq%2, %%mm7\n\t"
+"\n\t"
+"movaps  %2, %%xmm0\n\t"
+"movaps  %2, %%xmm1\n\t"
+"movaps  %2, %%xmm2\n\t"
+"movaps  %2, %%xmm3\n\t"
+"movaps  %2, %%xmm4\n\t"
+"movaps  %2, %%xmm5\n\t"
+"movaps  %2, %%xmm6\n\t"
+"movaps  %2, %%xmm7\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"movq%%mm0, 0x00(%%rbx)\n\t"
+"movq%%mm1, 0x08(%%rbx)\n\t"
+"movq%%mm2, 0x10(%%rbx)\n\t"
+"movq%%mm3, 0x18(%%rbx)\n\t"
+"movq%%mm4, 0x20(%%rbx)\n\t"
+"movq%%mm5, 0x28(%%rbx)\n\t"
+"movq%%mm6, 0x30(%%rbx)\n\t"
+"movq%%mm7, 0x38(%%rbx)\n\t"
+"\n\t"
+"lea %1, %%rbx\n\t"
+"movaps  %%xmm0, 0x00(%%rbx)\n\t"
+"movaps  %%xmm1, 0x10(%%rbx)\n\t"
+"movaps  %%xmm2, 0x20(%%rbx)\n\t"
+"movaps  %%xmm3, 0x30(%%rbx)\n\t"
+"movaps  %%xmm4, 0x40(%%rbx)\n\t"
+"movaps  %%xmm5, 0x50(%%rbx)\n\t"
+"movaps  %%xmm6, 0x60(%%rbx)\n\t"
+"movaps  %%xmm7, 0x70(%%rbx)\n\t"
+: "=m"(mm), "=m"(xmm)
+: "m"(xmm_fill)
+: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  for (int i = 0; i < 8; ++i)
+printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
+  for (int i = 0; i < 8; ++i)
+printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-mm-xmm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-write.test?rev=359681&view=auto
==
--- lldb/trunk/lit/Register/x86-mm-xmm-write.test (added)
+++ lldb/trunk/lit/Register/x86-mm-xmm-write.test Wed May  1 06:55:13 2019
@@ -0,0 +1,47 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
+# RUN: %clangxx %p/Inputs/x86-mm-xmm-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write mm0 0x0102030405060708
+register write mm1 0x1112131415161718
+register write mm2 0x2122232425262728
+register write mm3 0x3132333435363738
+register write mm4 0x4142434445464748
+register write mm5 0x5152535455565758
+register write mm6 0x6162636465666768
+register write mm7 0x7172737475767778
+
+register write xmm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}"
+register write xmm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}"
+register write xmm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}"
+register write xmm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}"
+register write xmm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}"
+register write xmm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}"
+register write xmm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}"
+register write xmm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: mm0 = 0x0102030405060708
+# CHECK-DAG: mm1 = 0x1112131415161718
+# CHECK-DAG: mm2 = 0x2122232425262728
+# CHECK-DAG: mm3 = 0x3132333435363738
+# CHECK-DAG: mm4 = 0x4142434445464748
+# CHECK-DAG: mm5 = 0x5152535455565758
+# CHECK-DAG: mm6 = 0x6162636465666768
+# CHECK-DAG: mm7 = 0x7172737475767778
+
+# CHECK-DAG: xmm0 = 0x030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: xmm1 = 0x131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: xmm2 = 0x232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: xmm3 = 0x333537393b3d3f3032343

[Lldb-commits] [lldb] r359780 - [lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 04:26:30 2019
New Revision: 359780

URL: http://llvm.org/viewvc/llvm-project?rev=359780&view=rev
Log:
[lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

Since Darwin target implements support for zmm* registers without
matching support for the respectively added xmm* and ymm* registers,
split the tests for each register group.  To reduce code duplication,
the tests are using the same source file (which sets more registers
than necessary but that should not cause any harm).

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

Added:
lldb/trunk/lit/Register/x86-64-xmm16-read.test
lldb/trunk/lit/Register/x86-64-ymm16-read.test
Modified:
lldb/trunk/lit/Register/x86-64-zmm-read.test

Added: lldb/trunk/lit/Register/x86-64-xmm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-xmm16-read.test?rev=359780&view=auto
==
--- lldb/trunk/lit/Register/x86-64-xmm16-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-xmm16-read.test Thu May  2 04:26:30 2019
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && native-cpu-avx512f
+# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: xmm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 
0x0a 0x08 0x06 0x04 0x02}
+# CHECK-DAG: xmm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 
0x1a 0x18 0x16 0x14 0x12}
+# CHECK-DAG: xmm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 
0x2a 0x28 0x26 0x24 0x22}
+# CHECK-DAG: xmm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 
0x3a 0x38 0x36 0x34 0x32}
+# CHECK-DAG: xmm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 
0x4a 0x48 0x46 0x44 0x42}
+# CHECK-DAG: xmm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 
0x5a 0x58 0x56 0x54 0x52}
+# CHECK-DAG: xmm22 = {0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0x61 0x6e 0x6c 
0x6a 0x68 0x66 0x64 0x62}
+# CHECK-DAG: xmm23 = {0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0x71 0x7e 0x7c 
0x7a 0x78 0x76 0x74 0x72}
+# CHECK-DAG: xmm24 = {0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 
0x8a 0x88 0x86 0x84 0x82}
+# CHECK-DAG: xmm25 = {0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 
0x9a 0x98 0x96 0x94 0x92}
+# CHECK-DAG: xmm26 = {0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 
0xaa 0xa8 0xa6 0xa4 0xa2}
+# CHECK-DAG: xmm27 = {0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 
0xba 0xb8 0xb6 0xb4 0xb2}
+# CHECK-DAG: xmm28 = {0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 
0xca 0xc8 0xc6 0xc4 0xc2}
+# CHECK-DAG: xmm29 = {0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 
0xda 0xd8 0xd6 0xd4 0xd2}
+# CHECK-DAG: xmm30 = {0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 
0xea 0xe8 0xe6 0xe4 0xe2}
+# CHECK-DAG: xmm31 = {0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 
0xfa 0xf8 0xf6 0xf4 0xf2}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0

Added: lldb/trunk/lit/Register/x86-64-ymm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm16-read.test?rev=359780&view=auto
==
--- lldb/trunk/lit/Register/x86-64-ymm16-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-ymm16-read.test Thu May  2 04:26:30 2019
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && native-cpu-avx512f
+# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: ymm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 
0x0a 0x08 0x06 0x04 0x02 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 
0x8b 0x89 0x87 0x85 0x83}
+# CHECK-DAG: ymm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 
0x1a 0x18 0x16 0x14 0x12 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 
0x9b 0x99 0x97 0x95 0x93}
+# CHECK-DAG: ymm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 
0x2a 0x28 0x26 0x24 0x22 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 
0xab 0xa9 0xa7 0xa5 0xa3}
+# CHECK-DAG: ymm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 
0x3a 0x38 0x36 0x34 0x32 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 
0xbb 0xb9 0xb7 0xb5 0xb3}
+# CHECK-DAG: ymm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 
0x4a 0x48 0x46 0x44 0x42 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0xc0 0xcf 0xcd 
0xcb 0xc9 0xc7 0xc5 0xc3}
+# CHECK-DAG: ymm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 
0x5a 0x58 0x56 0x54 0x52 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0xd0 0

[Lldb-commits] [lldb] r359783 - [lldb] [lit] Introduce tests for writing YMM registers

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 05:55:44 2019
New Revision: 359783

URL: http://llvm.org/viewvc/llvm-project?rev=359783&view=rev
Log:
[lldb] [lit] Introduce tests for writing YMM registers

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

Added:
lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp
lldb/trunk/lit/Register/x86-64-ymm-write.test
lldb/trunk/lit/Register/x86-ymm-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp?rev=359783&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp Thu May  2 05:55:44 2019
@@ -0,0 +1,77 @@
+#include 
+#include 
+#include 
+
+union alignas(32) ymm_t {
+  uint64_t as_uint64[4];
+  uint8_t as_uint8[32];
+};
+
+int main() {
+  constexpr ymm_t ymm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
+
+  ymm_t ymm[16];
+
+  asm volatile(
+"vmovaps  %1, %%ymm0\n\t"
+"vmovaps  %1, %%ymm1\n\t"
+"vmovaps  %1, %%ymm2\n\t"
+"vmovaps  %1, %%ymm3\n\t"
+"vmovaps  %1, %%ymm4\n\t"
+"vmovaps  %1, %%ymm5\n\t"
+"vmovaps  %1, %%ymm6\n\t"
+"vmovaps  %1, %%ymm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %1, %%ymm8\n\t"
+"vmovaps  %1, %%ymm9\n\t"
+"vmovaps  %1, %%ymm10\n\t"
+"vmovaps  %1, %%ymm11\n\t"
+"vmovaps  %1, %%ymm12\n\t"
+"vmovaps  %1, %%ymm13\n\t"
+"vmovaps  %1, %%ymm14\n\t"
+"vmovaps  %1, %%ymm15\n\t"
+#endif
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"vmovaps %%ymm0,  0x000(%%rbx)\n\t"
+"vmovaps %%ymm1,  0x020(%%rbx)\n\t"
+"vmovaps %%ymm2,  0x040(%%rbx)\n\t"
+"vmovaps %%ymm3,  0x060(%%rbx)\n\t"
+"vmovaps %%ymm4,  0x080(%%rbx)\n\t"
+"vmovaps %%ymm5,  0x0A0(%%rbx)\n\t"
+"vmovaps %%ymm6,  0x0C0(%%rbx)\n\t"
+"vmovaps %%ymm7,  0x0E0(%%rbx)\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps %%ymm8,  0x100(%%rbx)\n\t"
+"vmovaps %%ymm9,  0x120(%%rbx)\n\t"
+"vmovaps %%ymm10, 0x140(%%rbx)\n\t"
+"vmovaps %%ymm11, 0x160(%%rbx)\n\t"
+"vmovaps %%ymm12, 0x180(%%rbx)\n\t"
+"vmovaps %%ymm13, 0x1A0(%%rbx)\n\t"
+"vmovaps %%ymm14, 0x1C0(%%rbx)\n\t"
+"vmovaps %%ymm15, 0x1E0(%%rbx)\n\t"
+#endif
+: "=m"(ymm)
+: "m"(ymm_fill)
+: "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7",
+#if defined(__x86_64__) || defined(_M_X64)
+  "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14",
+  "%ymm15",
+#endif
+  "%rbx"
+  );
+
+  for (int i = 0; i < 16; ++i) {
+printf("ymm%d = { ", i);
+for (int j = 0; j < sizeof(ymm->as_uint8); ++j)
+  printf("0x%02x ", ymm[i].as_uint8[j]);
+printf("}\n");
+  }
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359783&view=auto
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 05:55:44 2019
@@ -0,0 +1,44 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write ymm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 
0x8a 0x88 0x86 0x84 0x82}"
+register write ymm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 
0x9a 0x98 0x96 0x94 0x92}"
+register write ymm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 
0xaa 0xa8 0xa6 0xa4 0xa2}"
+register write ymm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 
0xba 0xb8 0xb6 0xb4 0xb2}"
+register write ymm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 
0xca 0xc8 0xc6 0xc4 0xc2}"
+register write ymm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 
0xda 0xd8 0xd6 0xd4 0xd2}"
+register write ymm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 
0xea 0xe8 0xe6 0xe4 0xe2}"
+register write ymm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0x

[Lldb-commits] [lldb] r359784 - [lldb] [lit] Use LLDB-like output for XMM registers in write tests

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 05:55:54 2019
New Revision: 359784

URL: http://llvm.org/viewvc/llvm-project?rev=359784&view=rev
Log:
[lldb] [lit] Use LLDB-like output for XMM registers in write tests

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/x86-64-write.test
lldb/trunk/lit/Register/x86-mm-xmm-write.test

Modified: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Thu May  2 05:55:54 2019
@@ -2,12 +2,15 @@
 #include 
 #include 
 
-struct alignas(16) xmm_t {
-  uint64_t a, b;
+union alignas(16) xmm_t {
+  uint64_t as_uint64[2];
+  uint8_t as_uint8[16];
 };
 
 int main() {
-  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+  constexpr xmm_t xmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
 
   uint64_t r64[8];
   xmm_t xmm[8];
@@ -60,8 +63,12 @@ int main() {
 
   for (int i = 0; i < 8; ++i)
 printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]);
-  for (int i = 0; i < 8; ++i)
-printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i+8, xmm[i].b, 
xmm[i].a);
+  for (int i = 0; i < 8; ++i) {
+printf("xmm%d = { ", i+8);
+for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
+  printf("0x%02x ", xmm[i].as_uint8[j]);
+printf("}\n");
+  }
 
   return 0;
 }

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp Thu May  2 05:55:54 2019
@@ -2,12 +2,15 @@
 #include 
 #include 
 
-struct alignas(16) xmm_t {
-  uint64_t a, b;
+union alignas(16) xmm_t {
+  uint64_t as_uint64[2];
+  uint8_t as_uint8[16];
 };
 
 int main() {
-  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+  constexpr xmm_t xmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
 
   uint64_t mm[8];
   xmm_t xmm[8];
@@ -60,8 +63,12 @@ int main() {
 
   for (int i = 0; i < 8; ++i)
 printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
-  for (int i = 0; i < 8; ++i)
-printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a);
+  for (int i = 0; i < 8; ++i) {
+printf("xmm%d = { ", i);
+for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
+  printf("0x%02x ", xmm[i].as_uint8[j]);
+printf("}\n");
+  }
 
   return 0;
 }

Modified: lldb/trunk/lit/Register/x86-64-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-write.test?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/x86-64-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-write.test Thu May  2 05:55:54 2019
@@ -35,13 +35,13 @@ process continue
 # CHECK-DAG: r14 = 0x6162636465666768
 # CHECK-DAG: r15 = 0x7172737475767778
 
-# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01
-# CHECK-DAG: xmm9 = 0x131517191b1d1f10121416181a1c1e11
-# CHECK-DAG: xmm10 = 0x232527292b2d2f20222426282a2c2e21
-# CHECK-DAG: xmm11 = 0x333537393b3d3f30323436383a3c3e31
-# CHECK-DAG: xmm12 = 0x434547494b4d4f40424446484a4c4e41
-# CHECK-DAG: xmm13 = 0x535557595b5d5f50525456585a5c5e51
-# CHECK-DAG: xmm14 = 0x636567696b6d6f60626466686a6c6e61
-# CHECK-DAG: xmm15 = 0x737577797b7d7f70727476787a7c7e71
+# CHECK-DAG: xmm8 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03 }
+# CHECK-DAG: xmm9 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13 }
+# CHECK-DAG: xmm10 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23 }
+# CHECK-DAG: xmm11 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33 }
+# CHECK-DAG: xmm12 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43 }
+# CHECK-DAG: xmm13 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53 }
+# CHECK-DAG: xmm14 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63 }
+# CHECK-DAG: xmm15 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73 }
 
 # CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-mm-xmm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-write.test?rev=359784&r1=359783&r2=359784&view=diff
===

[Lldb-commits] [lldb] r359787 - [lldb] [lit] Mark x86-64-ymm-write XFAIL on Darwin

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 07:03:42 2019
New Revision: 359787

URL: http://llvm.org/viewvc/llvm-project?rev=359787&view=rev
Log:
[lldb] [lit] Mark x86-64-ymm-write XFAIL on Darwin

Modified:
lldb/trunk/lit/Register/x86-64-ymm-write.test

Modified: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359787&r1=359786&r2=359787&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 07:03:42 2019
@@ -1,3 +1,4 @@
+# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64 && native-cpu-avx
 # RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t


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


[Lldb-commits] [lldb] r359797 - [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 09:10:35 2019
New Revision: 359797

URL: http://llvm.org/viewvc/llvm-project?rev=359797&view=rev
Log:
[lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

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

Added:
lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp
lldb/trunk/lit/Register/x86-64-xmm16-write.test
lldb/trunk/lit/Register/x86-64-ymm16-write.test
lldb/trunk/lit/Register/x86-64-zmm-write.test
lldb/trunk/lit/Register/x86-zmm-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp?rev=359797&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp Thu May  2 09:10:35 2019
@@ -0,0 +1,113 @@
+#include 
+#include 
+#include 
+
+union alignas(64) zmm_t {
+  uint64_t as_uint64[8];
+  uint8_t as_uint8[64];
+};
+
+int main() {
+  constexpr zmm_t zmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
+
+  zmm_t zmm[32];
+
+  asm volatile(
+"vmovaps  %1, %%zmm0\n\t"
+"vmovaps  %1, %%zmm1\n\t"
+"vmovaps  %1, %%zmm2\n\t"
+"vmovaps  %1, %%zmm3\n\t"
+"vmovaps  %1, %%zmm4\n\t"
+"vmovaps  %1, %%zmm5\n\t"
+"vmovaps  %1, %%zmm6\n\t"
+"vmovaps  %1, %%zmm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %1, %%zmm8\n\t"
+"vmovaps  %1, %%zmm9\n\t"
+"vmovaps  %1, %%zmm10\n\t"
+"vmovaps  %1, %%zmm11\n\t"
+"vmovaps  %1, %%zmm12\n\t"
+"vmovaps  %1, %%zmm13\n\t"
+"vmovaps  %1, %%zmm14\n\t"
+"vmovaps  %1, %%zmm15\n\t"
+"vmovaps  %1, %%zmm16\n\t"
+"vmovaps  %1, %%zmm17\n\t"
+"vmovaps  %1, %%zmm18\n\t"
+"vmovaps  %1, %%zmm19\n\t"
+"vmovaps  %1, %%zmm20\n\t"
+"vmovaps  %1, %%zmm21\n\t"
+"vmovaps  %1, %%zmm22\n\t"
+"vmovaps  %1, %%zmm23\n\t"
+"vmovaps  %1, %%zmm24\n\t"
+"vmovaps  %1, %%zmm25\n\t"
+"vmovaps  %1, %%zmm26\n\t"
+"vmovaps  %1, %%zmm27\n\t"
+"vmovaps  %1, %%zmm28\n\t"
+"vmovaps  %1, %%zmm29\n\t"
+"vmovaps  %1, %%zmm30\n\t"
+"vmovaps  %1, %%zmm31\n\t"
+#endif
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"vmovaps %%zmm0,  0x000(%%rbx)\n\t"
+"vmovaps %%zmm1,  0x040(%%rbx)\n\t"
+"vmovaps %%zmm2,  0x080(%%rbx)\n\t"
+"vmovaps %%zmm3,  0x0C0(%%rbx)\n\t"
+"vmovaps %%zmm4,  0x100(%%rbx)\n\t"
+"vmovaps %%zmm5,  0x140(%%rbx)\n\t"
+"vmovaps %%zmm6,  0x180(%%rbx)\n\t"
+"vmovaps %%zmm7,  0x1C0(%%rbx)\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps %%zmm8,  0x200(%%rbx)\n\t"
+"vmovaps %%zmm9,  0x240(%%rbx)\n\t"
+"vmovaps %%zmm10, 0x280(%%rbx)\n\t"
+"vmovaps %%zmm11, 0x2C0(%%rbx)\n\t"
+"vmovaps %%zmm12, 0x300(%%rbx)\n\t"
+"vmovaps %%zmm13, 0x340(%%rbx)\n\t"
+"vmovaps %%zmm14, 0x380(%%rbx)\n\t"
+"vmovaps %%zmm15, 0x3C0(%%rbx)\n\t"
+"vmovaps %%zmm16, 0x400(%%rbx)\n\t"
+"vmovaps %%zmm17, 0x440(%%rbx)\n\t"
+"vmovaps %%zmm18, 0x480(%%rbx)\n\t"
+"vmovaps %%zmm19, 0x4C0(%%rbx)\n\t"
+"vmovaps %%zmm20, 0x500(%%rbx)\n\t"
+"vmovaps %%zmm21, 0x540(%%rbx)\n\t"
+"vmovaps %%zmm22, 0x580(%%rbx)\n\t"
+"vmovaps %%zmm23, 0x5C0(%%rbx)\n\t"
+"vmovaps %%zmm24, 0x600(%%rbx)\n\t"
+"vmovaps %%zmm25, 0x640(%%rbx)\n\t"
+"vmovaps %%zmm26, 0x680(%%rbx)\n\t"
+"vmovaps %%zmm27, 0x6C0(%%rbx)\n\t"
+"vmovaps %%zmm28, 0x700(%%rbx)\n\t"
+"vmovaps %%zmm29, 0x740(%%rbx)\n\t"
+"vmovaps %%zmm30, 0x780(%%rbx)\n\t"
+"vmovaps %%zmm31, 0x7C0(%%rbx)\n\t"
+#endif
+: "=m"(zmm)
+: "m"(zmm_fill)
+: "%zmm0", "%zmm1", "%zmm2", "%zmm3", "%zmm4", "%zmm5", "%zmm6", "%zmm7",
+#if defined(__x86_64__) || defined(_M_X64)
+  "%zmm8", "%zmm9", "%zmm10", "%zmm11", "%zmm12", "%zmm13", "%zmm14",
+  "%zmm15", "%zmm16", "%zmm17", "%zmm18", "%zmm19", "%zmm20", "%zmm21",
+  "%zmm22", "%zmm23", "%zmm24", "%zmm25", "%zmm26", "%zmm27", "%zmm28",
+  "%zmm29", "%zmm30", "%zmm31",
+#endif
+  "%rbx"
+  );
+
+  for (int i = 0; i < 32; ++i) {
+printf("zmm%d = { ", i);
+for (int j = 0; j < sizeof(zmm->as_uint8); ++j)
+  printf("0x%02x ", zmm[i].as_uint8[j]);
+printf("}\n");
+  }
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-xmm16-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-xmm16-write.test?rev=359797&view=auto
==
--- lldb/trunk/lit/Register/x86-64-xmm16-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-xmm16-write.test Thu May  2 09:10:35 2019
@@ -0,0 +1,48 @@
+# XFAIL: system-darwin
+# XFAIL: system-freebsd
+# XFAI

[Lldb-commits] [lldb] r359977 - [lldb] [lit] Fix more filename mismatches in Register tests

2019-05-05 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun May  5 05:06:22 2019
New Revision: 359977

URL: http://llvm.org/viewvc/llvm-project?rev=359977&view=rev
Log:
[lldb] [lit] Fix more filename mismatches in Register tests

Modified:
lldb/trunk/lit/Register/x86-gp-write.test
lldb/trunk/lit/Register/x86-ymm-write.test

Modified: lldb/trunk/lit/Register/x86-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-gp-write.test?rev=359977&r1=359976&r2=359977&view=diff
==
--- lldb/trunk/lit/Register/x86-gp-write.test (original)
+++ lldb/trunk/lit/Register/x86-gp-write.test Sun May  5 05:06:22 2019
@@ -1,6 +1,6 @@
 # XFAIL: system-windows
 # REQUIRES: native && target-x86
-# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-gp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch
 

Modified: lldb/trunk/lit/Register/x86-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-ymm-write.test?rev=359977&r1=359976&r2=359977&view=diff
==
--- lldb/trunk/lit/Register/x86-ymm-write.test (original)
+++ lldb/trunk/lit/Register/x86-ymm-write.test Sun May  5 05:06:22 2019
@@ -1,6 +1,6 @@
 # XFAIL: system-windows
 # REQUIRES: native && target-x86 && native-cpu-avx
-# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %clangxx %p/Inputs/x86-ymm-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch
 


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


[Lldb-commits] [lldb] r359978 - [lldb] [lit] Simplify general-purpose register tests

2019-05-05 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun May  5 05:06:32 2019
New Revision: 359978

URL: http://llvm.org/viewvc/llvm-project?rev=359978&view=rev
Log:
[lldb] [lit] Simplify general-purpose register tests

Use output constraints for specific general-purpose registers in order
to simplify the tests.  They save us from having to manually put
the values in correct registers, and reduce the number of registers
needed as a result.

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp?rev=359978&r1=359977&r2=359978&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp Sun May  5 05:06:32 2019
@@ -15,14 +15,8 @@ int main() {
 "movq%%rsp, %%r8\n\t"
 "movq%%rbp, %%r9\n\t"
 "\n\t"
-"movq%0, %%rax\n\t"
-"movq%1, %%rbx\n\t"
-"movq%2, %%rcx\n\t"
-"movq%3, %%rdx\n\t"
 "movq%4, %%rsp\n\t"
 "movq%5, %%rbp\n\t"
-"movq%6, %%rsi\n\t"
-"movq%7, %%rdi\n\t"
 "\n\t"
 "int3\n\t"
 "\n\t"
@@ -30,10 +24,9 @@ int main() {
 "movq%%r8, %%rsp\n\t"
 "movq%%r9, %%rbp"
 :
-: "i"(rax), "i"(rbx), "i"(rcx), "i"(rdx), "i"(rsp), "i"(rbp), "i"(rsi),
-  "i"(rdi)
-: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%r8",
-  "%r9"
+: "a"(rax), "b"(rbx), "c"(rcx), "d"(rdx), "i"(rsp), "i"(rbp), "S"(rsi),
+  "D"(rdi)
+: "%r8", "%r9"
   );
 
   return 0;

Modified: lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp?rev=359978&r1=359977&r2=359978&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp Sun May  5 05:06:32 2019
@@ -9,8 +9,8 @@ int main() {
 
   asm volatile(
 // save rsp & rbp
-"movq%%rsp, %%mm0\n\t"
-"movq%%rbp, %%mm1\n\t"
+"movq%%rsp, %4\n\t"
+"movq%%rbp, %5\n\t"
 "\n\t"
 "movq%8, %%rax\n\t"
 "movq%8, %%rbx\n\t"
@@ -23,23 +23,13 @@ int main() {
 "\n\t"
 "int3\n\t"
 "\n\t"
-"movq%%rax, %0\n\t"
-"movq%%rbx, %1\n\t"
-"movq%%rcx, %2\n\t"
-"movq%%rdx, %3\n\t"
-"movq%%rsp, %4\n\t"
-"movq%%rbp, %5\n\t"
-"movq%%rsi, %6\n\t"
-"movq%%rdi, %7\n\t"
-"\n\t"
-// restore rsp & rbp
-"movq%%mm0, %%rsp\n\t"
-"movq%%mm1, %%rbp\n\t"
-: "=r"(rax), "=r"(rbx), "=r"(rcx), "=r"(rdx), "=r"(rsp), "=r"(rbp),
-  "=r"(rsi), "=r"(rdi)
+// swap saved & current rsp & rbp
+"xchgq%%rsp, %4\n\t"
+"xchgq%%rbp, %5\n\t"
+: "=a"(rax), "=b"(rbx), "=c"(rcx), "=d"(rdx), "=r"(rsp), "=r"(rbp),
+  "=S"(rsi), "=D"(rdi)
 : "g"(fill)
-: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%mm0",
-  "%mm1"
+:
   );
 
   printf("rax = 0x%016" PRIx64 "\n", rax);

Modified: lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp?rev=359978&r1=359977&r2=359978&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp Sun May  5 05:06:32 2019
@@ -15,14 +15,8 @@ int main() {
 "movd%%esp, %%mm0\n\t"
 "movd%%ebp, %%mm1\n\t"
 "\n\t"
-"movl%0, %%eax\n\t"
-"movl%1, %%ebx\n\t"
-"movl%2, %%ecx\n\t"
-"movl%3, %%edx\n\t"
 "movl%4, %%esp\n\t"
 "movl%5, %%ebp\n\t"
-"movl%6, %%esi\n\t"
-"movl%7, %%edi\n\t"
 "\n\t"
 "int3\n\t"
 "\n\t"
@@ -30,10 +24,9 @@ int main() {
 "movd%%mm0, %%esp\n\t"
 "movd%%mm1, %%ebp\n\t"
 :
-: "i"(eax), "i"(ebx), "i"(ecx), "i"(edx), "i"(esp), "i"(ebp), "i"(esi),
-  "i"(edi)
-: "%eax", "%ebx", "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0",
-  "%mm1"
+: "a"(eax), "b"(ebx), "c"(ecx), "d"(edx), "i"(esp), "i"(ebp), "S"(esi),
+  "D"(edi)
+: "%mm0", "%mm1"
   );
 
   return 0;

Modified: lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp?rev=359978&r1=359977&r2=359978&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp

[Lldb-commits] [lldb] r360041 - [lldb] [lit] Use more readable consts and arrays in register read tests

2019-05-06 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon May  6 06:06:43 2019
New Revision: 360041

URL: http://llvm.org/viewvc/llvm-project?rev=360041&view=rev
Log:
[lldb] [lit] Use more readable consts and arrays in register read tests

Replace the constants used for r8/mm/xmm/ymm/zmm tests with something
more readable to ease debugging in case of failures (0x00 0x01 ...).
While at it, put the constants in array and copy them from memory
to simplify inline asm.

The original constants grew out of necessity.  The xmm constants were
'weird' because they were intended to be different from mm constants
(as that was necessary to catch NetBSD implementation bug).  The ymm
constants were made even weirded to not even partially collide with
other xmm registers (not saying it made sense, just how it was done).
Then, zmm constants were once again designed to avoid accidental
collisions with xmm and ymm constants, and at the same the 16 extra
registers required even more shuffling.

The new constants are meant to be more user-readable, so that a mistake
could be easily spotted.  All of xmm, ymm and zmm tests use a sequence
of {0x00 0x01 0x02 ...}, shifted by 1 for every register.  This should
provide enough uniquity, and space for future increase in number of
registers.  Since mm and r8..r15 are printed as uint64_t rather than
byte-by-byte, they use 0x000102...  As a result, on x86 endianness takes
care of making mm different than xmm.

The use of arrays is something I had to learn for zmm write tests.  It
avoids having to specify all the input values separately, and makes
GCC happy about zmm-read test (it was rejected previously because of
hitting a limit of 30 constraints).

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
lldb/trunk/lit/Register/x86-64-read.test
lldb/trunk/lit/Register/x86-64-xmm16-read.test
lldb/trunk/lit/Register/x86-64-ymm-read.test
lldb/trunk/lit/Register/x86-64-ymm16-read.test
lldb/trunk/lit/Register/x86-64-zmm-read.test
lldb/trunk/lit/Register/x86-mm-xmm-read.test
lldb/trunk/lit/Register/x86-ymm-read.test
lldb/trunk/lit/Register/x86-zmm-read.test

Modified: lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-read.cpp?rev=360041&r1=360040&r2=360041&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-read.cpp Mon May  6 06:06:43 2019
@@ -5,48 +5,50 @@ struct alignas(16) xmm_t {
 };
 
 int main() {
-  constexpr uint64_t r8 = 0x0102030405060708;
-  constexpr uint64_t r9 = 0x1112131415161718;
-  constexpr uint64_t r10 = 0x2122232425262728;
-  constexpr uint64_t r11 = 0x3132333435363738;
-  constexpr uint64_t r12 = 0x4142434445464748;
-  constexpr uint64_t r13 = 0x5152535455565758;
-  constexpr uint64_t r14 = 0x6162636465666768;
-  constexpr uint64_t r15 = 0x7172737475767778;
+  constexpr uint64_t r8[] = {
+0x0001020304050607,
+0x1011121314151617,
+0x2021222324252627,
+0x3031323334353637,
+0x4041424344454647,
+0x5051525354555657,
+0x6061626364656667,
+0x7071727374757677,
+  };
 
-  constexpr xmm_t xmm8 = { 0x020406080A0C0E01, 0x030507090B0D0F00 };
-  constexpr xmm_t xmm9 = { 0x121416181A1C1E11, 0x131517191B1D1F10 };
-  constexpr xmm_t xmm10 = { 0x222426282A2C2E21, 0x232527292B2D2F20 };
-  constexpr xmm_t xmm11 = { 0x323436383A3C3E31, 0x333537393B3D3F30 };
-  constexpr xmm_t xmm12 = { 0x424446484A4C4E41, 0x434547494B4D4F40 };
-  constexpr xmm_t xmm13 = { 0x525456585A5C5E51, 0x535557595B5D5F50 };
-  constexpr xmm_t xmm14 = { 0x626466686A6C6E61, 0x636567696B6D6F60 };
-  constexpr xmm_t xmm15 = { 0x727476787A7C7E71, 0x737577797B7D7F70 };
+  constexpr xmm_t xmm8[] = {
+{ 0x0F0E0D0C0B0A0908, 0x1716151413121110, },
+{ 0x100F0E0D0C0B0A09, 0x1817161514131211, },
+{ 0x11100F0E0D0C0B0A, 0x1918171615141312, },
+{ 0x1211100F0E0D0C0B, 0x1A19181716151413, },
+{ 0x131211100F0E0D0C, 0x1B1A191817161514, },
+{ 0x14131211100F0E0D, 0x1C1B1A1918171615, },
+{ 0x1514131211100F0E, 0x1D1C1B1A19181716, },
+{ 0x161514131211100F, 0x1E1D1C1B1A191817, },
+  };
 
   asm volatile(
-"movq%0, %%r8\n\t"
-"movq%1, %%r9\n\t"
-"movq%2, %%r10\n\t"
-"movq%3, %%r11\n\t"
-"movq%4, %%r12\n\t"
-"movq%5, %%r13\n\t"
-"movq%6, %%r14\n\t"
-"movq%7, %%r15\n\t"
+"movq 0x00(%%rax), %%r8\n\t"
+"movq 0x08(%%rax), %%r9\n\t"
+"movq 0x10(%%rax), %%r10\n\t"
+"movq 0x18(%%rax), %%r11\n\t"
+"movq 0x20(%%rax), %%r12\n\t"
+"movq 0x28(%%rax), %%r13\n\t"
+"movq 0x30(%%rax), %%r14\n\t"
+"movq 0x38(%%rax), %%r15\n\t"
 "\n\t"
-"movaps  %8, %%xmm8\n\t"
-"movaps  %9, %%xmm9\n\t"
-   

[Lldb-commits] [lldb] r360148 - [lldb] [lit] Fix Register tests to reference arrays via %0 and %1

2019-05-07 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue May  7 07:02:11 2019
New Revision: 360148

URL: http://llvm.org/viewvc/llvm-project?rev=360148&view=rev
Log:
[lldb] [lit] Fix Register tests to reference arrays via %0 and %1

Fix Register tests to reference memory access to arrays via %0 and %1,
rather than via referencing %rax and %rbx directly.  This fixes test
build failures on 32-bit x86.

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/Inputs/x86-ymm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp
lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-64-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-read.cpp?rev=360148&r1=360147&r2=360148&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-read.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-read.cpp Tue May  7 07:02:11 2019
@@ -28,23 +28,23 @@ int main() {
   };
 
   asm volatile(
-"movq 0x00(%%rax), %%r8\n\t"
-"movq 0x08(%%rax), %%r9\n\t"
-"movq 0x10(%%rax), %%r10\n\t"
-"movq 0x18(%%rax), %%r11\n\t"
-"movq 0x20(%%rax), %%r12\n\t"
-"movq 0x28(%%rax), %%r13\n\t"
-"movq 0x30(%%rax), %%r14\n\t"
-"movq 0x38(%%rax), %%r15\n\t"
+"movq 0x00(%0), %%r8\n\t"
+"movq 0x08(%0), %%r9\n\t"
+"movq 0x10(%0), %%r10\n\t"
+"movq 0x18(%0), %%r11\n\t"
+"movq 0x20(%0), %%r12\n\t"
+"movq 0x28(%0), %%r13\n\t"
+"movq 0x30(%0), %%r14\n\t"
+"movq 0x38(%0), %%r15\n\t"
 "\n\t"
-"movaps   0x00(%%rbx), %%xmm8\n\t"
-"movaps   0x10(%%rbx), %%xmm9\n\t"
-"movaps   0x20(%%rbx), %%xmm10\n\t"
-"movaps   0x30(%%rbx), %%xmm11\n\t"
-"movaps   0x40(%%rbx), %%xmm12\n\t"
-"movaps   0x50(%%rbx), %%xmm13\n\t"
-"movaps   0x60(%%rbx), %%xmm14\n\t"
-"movaps   0x70(%%rbx), %%xmm15\n\t"
+"movaps   0x00(%1), %%xmm8\n\t"
+"movaps   0x10(%1), %%xmm9\n\t"
+"movaps   0x20(%1), %%xmm10\n\t"
+"movaps   0x30(%1), %%xmm11\n\t"
+"movaps   0x40(%1), %%xmm12\n\t"
+"movaps   0x50(%1), %%xmm13\n\t"
+"movaps   0x60(%1), %%xmm14\n\t"
+"movaps   0x70(%1), %%xmm15\n\t"
 "\n\t"
 "int3\n\t"
 :

Modified: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=360148&r1=360147&r2=360148&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Tue May  7 07:02:11 2019
@@ -36,29 +36,27 @@ int main() {
 "\n\t"
 "int3\n\t"
 "\n\t"
-"lea %0, %%rbx\n\t"
-"movq%%r8, 0x00(%%rbx)\n\t"
-"movq%%r9, 0x08(%%rbx)\n\t"
-"movq%%r10, 0x10(%%rbx)\n\t"
-"movq%%r11, 0x18(%%rbx)\n\t"
-"movq%%r12, 0x20(%%rbx)\n\t"
-"movq%%r13, 0x28(%%rbx)\n\t"
-"movq%%r14, 0x30(%%rbx)\n\t"
-"movq%%r15, 0x38(%%rbx)\n\t"
+"movq%%r8, 0x00(%0)\n\t"
+"movq%%r9, 0x08(%0)\n\t"
+"movq%%r10, 0x10(%0)\n\t"
+"movq%%r11, 0x18(%0)\n\t"
+"movq%%r12, 0x20(%0)\n\t"
+"movq%%r13, 0x28(%0)\n\t"
+"movq%%r14, 0x30(%0)\n\t"
+"movq%%r15, 0x38(%0)\n\t"
 "\n\t"
-"lea %1, %%rbx\n\t"
-"movaps  %%xmm8, 0x00(%%rbx)\n\t"
-"movaps  %%xmm9, 0x10(%%rbx)\n\t"
-"movaps  %%xmm10, 0x20(%%rbx)\n\t"
-"movaps  %%xmm11, 0x30(%%rbx)\n\t"
-"movaps  %%xmm12, 0x40(%%rbx)\n\t"
-"movaps  %%xmm13, 0x50(%%rbx)\n\t"
-"movaps  %%xmm14, 0x60(%%rbx)\n\t"
-"movaps  %%xmm15, 0x70(%%rbx)\n\t"
-: "=m"(r64), "=m"(xmm)
-: "m"(xmm_fill)
-: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
-  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+"movaps  %%xmm8, 0x00(%1)\n\t"
+"movaps  %%xmm9, 0x10(%1)\n\t"
+"movaps  %%xmm10, 0x20(%1)\n\t"
+"movaps  %%xmm11, 0x30(%1)\n\t"
+"movaps  %%xmm12, 0x40(%1)\n\t"
+"movaps  %%xmm13, 0x50(%1)\n\t"
+"movaps  %%xmm14, 0x60(%1)\n\t"
+"movaps  %%xmm15, 0x70(%1)\n\t"
+:
+: "a"(r64), "b"(xmm), "m"(xmm_fill)
+: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7", "%xmm0",
+  "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
   );
 
   for (int i = 0; i < 8; ++i)

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-read.cpp?rev=360148&r1=360147&r2=360148&view=diff
=

[Lldb-commits] [lldb] r360423 - [lldb] [lit] Fix clobbers in x86_64 register test

2019-05-10 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Fri May 10 06:12:36 2019
New Revision: 360423

URL: http://llvm.org/viewvc/llvm-project?rev=360423&view=rev
Log:
[lldb] [lit] Fix clobbers in x86_64 register test

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp

Modified: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=360423&r1=360422&r2=360423&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Fri May 10 06:12:36 2019
@@ -55,8 +55,8 @@ int main() {
 "movaps  %%xmm15, 0x70(%1)\n\t"
 :
 : "a"(r64), "b"(xmm), "m"(xmm_fill)
-: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7", "%xmm0",
-  "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+: "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%xmm8",
+  "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
   );
 
   for (int i = 0; i < 8; ++i)


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


[Lldb-commits] [lldb] r360744 - [lldb] [lit] Fix whitespace in matches for remaining AVX512 tests

2019-05-14 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Tue May 14 20:32:47 2019
New Revision: 360744

URL: http://llvm.org/viewvc/llvm-project?rev=360744&view=rev
Log:
[lldb] [lit] Fix whitespace in matches for remaining AVX512 tests

Modified:
lldb/trunk/lit/Register/x86-64-xmm16-read.test
lldb/trunk/lit/Register/x86-64-ymm16-read.test
lldb/trunk/lit/Register/x86-zmm-read.test

Modified: lldb/trunk/lit/Register/x86-64-xmm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-xmm16-read.test?rev=360744&r1=360743&r2=360744&view=diff
==
--- lldb/trunk/lit/Register/x86-64-xmm16-read.test (original)
+++ lldb/trunk/lit/Register/x86-64-xmm16-read.test Tue May 14 20:32:47 2019
@@ -9,22 +9,22 @@
 process launch
 
 register read --all
-# CHECK-DAG: xmm16 = {0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 
0x1b 0x1c 0x1d 0x1e 0x1f }
-# CHECK-DAG: xmm17 = {0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 
0x1c 0x1d 0x1e 0x1f 0x20 }
-# CHECK-DAG: xmm18 = {0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 
0x1d 0x1e 0x1f 0x20 0x21 }
-# CHECK-DAG: xmm19 = {0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 
0x1e 0x1f 0x20 0x21 0x22 }
-# CHECK-DAG: xmm20 = {0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 
0x1f 0x20 0x21 0x22 0x23 }
-# CHECK-DAG: xmm21 = {0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
0x20 0x21 0x22 0x23 0x24 }
-# CHECK-DAG: xmm22 = {0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 
0x21 0x22 0x23 0x24 0x25 }
-# CHECK-DAG: xmm23 = {0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 
0x22 0x23 0x24 0x25 0x26 }
-# CHECK-DAG: xmm24 = {0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 
0x23 0x24 0x25 0x26 0x27 }
-# CHECK-DAG: xmm25 = {0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 
0x24 0x25 0x26 0x27 0x28 }
-# CHECK-DAG: xmm26 = {0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 
0x25 0x26 0x27 0x28 0x29 }
-# CHECK-DAG: xmm27 = {0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 
0x26 0x27 0x28 0x29 0x2a }
-# CHECK-DAG: xmm28 = {0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 
0x27 0x28 0x29 0x2a 0x2b }
-# CHECK-DAG: xmm29 = {0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 
0x28 0x29 0x2a 0x2b 0x2c }
-# CHECK-DAG: xmm30 = {0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 
0x29 0x2a 0x2b 0x2c 0x2d }
-# CHECK-DAG: xmm31 = {0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 
0x2a 0x2b 0x2c 0x2d 0x2e }
+# CHECK-DAG: xmm16 = {0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 
0x1b 0x1c 0x1d 0x1e 0x1f}
+# CHECK-DAG: xmm17 = {0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 
0x1c 0x1d 0x1e 0x1f 0x20}
+# CHECK-DAG: xmm18 = {0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 
0x1d 0x1e 0x1f 0x20 0x21}
+# CHECK-DAG: xmm19 = {0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 
0x1e 0x1f 0x20 0x21 0x22}
+# CHECK-DAG: xmm20 = {0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 
0x1f 0x20 0x21 0x22 0x23}
+# CHECK-DAG: xmm21 = {0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
0x20 0x21 0x22 0x23 0x24}
+# CHECK-DAG: xmm22 = {0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 
0x21 0x22 0x23 0x24 0x25}
+# CHECK-DAG: xmm23 = {0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 
0x22 0x23 0x24 0x25 0x26}
+# CHECK-DAG: xmm24 = {0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 
0x23 0x24 0x25 0x26 0x27}
+# CHECK-DAG: xmm25 = {0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 
0x24 0x25 0x26 0x27 0x28}
+# CHECK-DAG: xmm26 = {0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 
0x25 0x26 0x27 0x28 0x29}
+# CHECK-DAG: xmm27 = {0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 
0x26 0x27 0x28 0x29 0x2a}
+# CHECK-DAG: xmm28 = {0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 
0x27 0x28 0x29 0x2a 0x2b}
+# CHECK-DAG: xmm29 = {0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 
0x28 0x29 0x2a 0x2b 0x2c}
+# CHECK-DAG: xmm30 = {0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 
0x29 0x2a 0x2b 0x2c 0x2d}
+# CHECK-DAG: xmm31 = {0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 
0x2a 0x2b 0x2c 0x2d 0x2e}
 
 process continue
 # CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-64-ymm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm16-read.test?rev=360744&r1=360743&r2=360744&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm16-read.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm16-read.test Tue May 14 20:32:47 2019
@@ -9,22 +9,22 @@
 process launch
 
 register read --all
-# CHECK-DAG: ymm16 = {0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 
0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 
0x2b 0x2c 0x2d 0x2e 0x2f }
-# CHECK-DAG: ymm17 = {0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 
0x

[Lldb-commits] [lldb] r360761 - [lldb] [lit] Pass --mode=compile to fix compiler-full-path.test

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 03:48:55 2019
New Revision: 360761

URL: http://llvm.org/viewvc/llvm-project?rev=360761&view=rev
Log:
[lldb] [lit] Pass --mode=compile to fix compiler-full-path.test

Pass '--mode=compile' to fix compiler-full-path.test failure on NetBSD
buildbot (apparently due to lack of 'link' executable).

Fixes r360355.  Acked by Pavel Labath.

Modified:
lldb/trunk/lit/BuildScript/compiler-full-path.test

Modified: lldb/trunk/lit/BuildScript/compiler-full-path.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/BuildScript/compiler-full-path.test?rev=360761&r1=360760&r2=360761&view=diff
==
--- lldb/trunk/lit/BuildScript/compiler-full-path.test (original)
+++ lldb/trunk/lit/BuildScript/compiler-full-path.test Wed May 15 03:48:55 2019
@@ -1,7 +1,8 @@
-RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
-RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
-RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
-RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+RUN: %build -n --mode=compile --verbose --arch=64 --compiler=/path/to/my/clang 
\
+RUN:-o foo foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --mode=compile --verbose --arch=64 \
+RUN:--compiler=/path/to/my/x64/cl.exe -o foo foobar.c | \
+RUN:FileCheck %s --check-prefix=CHECK-MSVC
 
 CHECK-CLANG: Command Line: /path/to/my/clang
 CHECK-SAME: -o


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


[Lldb-commits] [lldb] r360767 - [lldb] [test] Mark frequently failing flaky tests skipped on NetBSD

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 05:13:20 2019
New Revision: 360767

URL: http://llvm.org/viewvc/llvm-project?rev=360767&view=rev
Log:
[lldb] [test] Mark frequently failing flaky tests skipped on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py?rev=360767&r1=360766&r2=360767&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 Wed May 15 05:13:20 2019
@@ -13,7 +13,7 @@ class BreakpointSetRestart(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 BREAKPOINT_TEXT = 'Set a breakpoint here'
 
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_breakpoint_set_restart(self):
 self.build()
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py?rev=360767&r1=360766&r2=360767&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
 Wed May 15 05:13:20 2019
@@ -33,7 +33,7 @@ class LongjmpTestCase(TestBase):
 @skipIfFreeBSD  # llvm.org/pr17214
 @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20231")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_step_over(self):
 """Test stepping when the inferior calls setjmp/longjmp, in 
particular, thread step-over a longjmp."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=360767&r1=360766&r2=360767&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 Wed May 15 05:13:20 2019
@@ -23,7 +23,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
-@expectedFailureNetBSD
+@skipIfNetBSD
 def test_watchpoint_before_thread_start(self):
 """Test that we can hit a watchpoint we set before starting another 
thread"""
 self.do_watchpoint_test("Before running the thread")
@@ -31,7 +31,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
-@expectedFailureNetBSD
+@skipIfNetBSD
 def test_watchpoint_after_thread_start(self):
 """Test that we can hit a watchpoint we set after starting another 
thread"""
 self.do_watchpoint_test("After running the thread")

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=360767&r1=360766&r2=360767&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Wed May 15 05:13:20 2019
@@ -32,6 +32,7 @@ class EventAPITestCase(TestBase):
 oslist=["linux"],
 bugnumber="llvm.org/pr23730 Flaky, fails ~1/10 cases")
 @skipIfWindows # This is flakey on Windows AND when it fails, it hangs: 
llvm.org/pr38373
+@skipIfNetBSD
 def test_list

[Lldb-commits] [lldb] r360800 - [lldb] [test] Skip one more TestMiBreak on NetBSD

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 13:03:31 2019
New Revision: 360800

URL: http://llvm.org/viewvc/llvm-project?rev=360800&view=rev
Log:
[lldb] [test] Skip one more TestMiBreak on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=360800&r1=360799&r2=360800&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 Wed May 15 13:03:31 2019
@@ -304,7 +304,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_lldbmi_break_enable_disable(self):
 """Test that 'lldb-mi --interpreter' works for enabling / disabling 
breakpoints."""
 


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


[Lldb-commits] [lldb] r361114 - [lldb] [lit] Driver/TestConvenienceVariables.test requires Python

2019-05-18 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sat May 18 23:05:31 2019
New Revision: 361114

URL: http://llvm.org/viewvc/llvm-project?rev=361114&view=rev
Log:
[lldb] [lit] Driver/TestConvenienceVariables.test requires Python

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

Modified:
lldb/trunk/lit/Driver/TestConvenienceVariables.test
lldb/trunk/lit/lit.cfg.py

Modified: lldb/trunk/lit/Driver/TestConvenienceVariables.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/TestConvenienceVariables.test?rev=361114&r1=361113&r2=361114&view=diff
==
--- lldb/trunk/lit/Driver/TestConvenienceVariables.test (original)
+++ lldb/trunk/lit/Driver/TestConvenienceVariables.test Sat May 18 23:05:31 2019
@@ -1,3 +1,4 @@
+REQUIRES: python
 RUN: %build %p/Inputs/hello.cpp -o %t
 RUN: %lldb %t -s %p/Inputs/convenience.in -o quit | FileCheck %s
 
@@ -19,4 +20,4 @@ CHECK: 8
 CHECK: script lldb.frame.GetLineEntry().GetFileSpec().GetFilename()
 CHECK: hello.c
 CHECK: script lldb.frame.GetFunctionName()
-CHECK: main
\ No newline at end of file
+CHECK: main

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=361114&r1=361113&r2=361114&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Sat May 18 23:05:31 2019
@@ -96,3 +96,6 @@ if 'native' in config.available_features
 config.available_features.add('native-cpu-%s' % x)
 else:
 lit_config.warning("lit-cpuid failed: %s" % err)
+
+if not config.lldb_disable_python:
+config.available_features.add('python')


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


[Lldb-commits] [lldb] r361115 - [lldb] [lit] Skip more tests when Python is unavailable

2019-05-19 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Sun May 19 02:27:52 2019
New Revision: 361115

URL: http://llvm.org/viewvc/llvm-project?rev=361115&view=rev
Log:
[lldb] [lit] Skip more tests when Python is unavailable

LocalLLDBInit.test requires Python module loading support.
CommandScriptImmediateOutput tests are specific to running scripts.
Disable all of them when Python support is disabled.

Added:
lldb/trunk/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg
Modified:
lldb/trunk/lit/Driver/LocalLLDBInit.test

Added: lldb/trunk/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg?rev=361115&view=auto
==
--- lldb/trunk/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg (added)
+++ lldb/trunk/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg Sun May 
19 02:27:52 2019
@@ -0,0 +1,2 @@
+if not "python" in config.available_features:
+config.unsupported = True

Modified: lldb/trunk/lit/Driver/LocalLLDBInit.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/LocalLLDBInit.test?rev=361115&r1=361114&r2=361115&view=diff
==
--- lldb/trunk/lit/Driver/LocalLLDBInit.test (original)
+++ lldb/trunk/lit/Driver/LocalLLDBInit.test Sun May 19 02:27:52 2019
@@ -1,3 +1,4 @@
+# REQUIRES: python
 # RUN: mkdir -p %t.root
 # RUN: mkdir -p %t.home
 # RUN: cp %S/Inputs/.lldbinit %t.root


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


  1   2   >