[Lldb-commits] [lldb] 066eea7 - Revert "Reland "clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (#70639)""

2023-11-07 Thread Hans Wennborg via lldb-commits

Author: Hans Wennborg
Date: 2023-11-07T15:52:19+01:00
New Revision: 066eea75d38957353824b46474413ef2632d01a7

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

LOG: Revert "Reland "clang][DebugInfo] Emit global variable definitions for 
static data members with constant initializers (#70639)""

This casued asserts:

  llvm/lib/IR/Metadata.cpp:689:
  void llvm::MDNode::resolve(): Assertion `isUniqued() && "Expected this to be 
uniqued"' failed.

See comments on the PR.

This also reverts the dependent follow-up commits, see below.

> When an LLDB user asks for the value of a static data member, LLDB
> starts by searching the Names accelerator table for the corresponding
> variable definition DIE. For static data members with out-of-class
> definitions that works fine, because those get represented as global
> variables with a location and making them eligible to be added to the
> Names table. However, in-class definitions won<80><99>t get indexed 
> because
> we usually don't emit global variables for them. So in DWARF we end
> up with a single `DW_TAG_member` that usually holds the constant
> initializer.  But we don't get a corresponding CU-level
> `DW_TAG_variable` like we do for out-of-class definitions.
>
> To make it more convenient for debuggers to get to the value of
> inline static data members, this patch makes sure we emit definitions
> for static variables with constant initializers the same way we do
> for other static variables. This also aligns Clang closer to GCC,
> which produces CU-level definitions for inline statics and also
> emits these into `.debug_pubnames`.
>
> The implementation keeps track of newly created static data members.
> Then in `CGDebugInfo::finalize`, we emit a global `DW_TAG_variable`
> with a `DW_AT_const_value` for any of those declarations that didn't
> end up with a definition in the `DeclCache`.
>
> The newly emitted `DW_TAG_variable` will look as follows:
> ```
> 0x007b:   DW_TAG_structure_type
> DW_AT_calling_convention(DW_CC_pass_by_value)
> DW_AT_name  ("Foo")
> ...
>
> 0x008d: DW_TAG_member
>   DW_AT_name("i")
>   DW_AT_type(0x0062 "const int")
>   DW_AT_external(true)
>   DW_AT_declaration (true)
>   DW_AT_const_value (4)
>
> Newly added
> v
>
> 0x009a:   DW_TAG_variable
> DW_AT_specification (0x008d "i")
> DW_AT_const_value   (4)
> DW_AT_linkage_name  ("_ZN2t2IiE1iIfEE")
> ```
>
> This patch also drops the `DW_AT_const_value` off of the declaration
> since we now always have it on the definition. This ensures that the
> `DWARFParallelLinker` can type-merge class with static members where
> we couldn't attach the constant on the declaration in some CUs.

This reverts commit 7c3707aea8a6f1fc245ad2862982b8a51b6c0fea.
This reverts commit cab0a19467ac2e6e1e022087f4b6cb90d55da040.
This reverts commit 317481b3c8b34b0c3f106c514e6aa39b70886110.
This reverts commit 15fc809404d4715822e5349b76dcca50eb100eec.
This reverts commit 470de2bbec7f5fdd199775aa99c68ac76f4d5c74.

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-class.cpp
clang/test/CodeGenCXX/debug-info-static-member.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py

Removed: 
clang/test/CodeGenCXX/debug-info-static-inline-member.cpp



diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 410c8f522b1017f..84a166d3ac3659c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1677,13 +1677,22 @@ CGDebugInfo::CreateRecordStaticField(const VarDecl 
*Var, llvm::DIType *RecordTy,
 
   unsigned LineNumber = getLineNumber(Var->getLocation());
   StringRef VName = Var->getName();
+  llvm::Constant *C = nullptr;
+  if (Var->getInit()) {
+const APValue *Value = Var->evaluateValue();
+if (Value) {
+  if (Value->isInt())
+C = llvm::ConstantInt::get(CGM.getLLVMContext(), Value->getInt());
+  if (Value->isFloat())
+C = 

[Lldb-commits] [lldb] 3ab0155 - Revert "[CMake] Simplify CMake handling for zlib"

2020-08-05 Thread Hans Wennborg via lldb-commits

Author: Hans Wennborg
Date: 2020-08-05T12:31:44+02:00
New Revision: 3ab01550b632dad46f9595d74855749557ffd25c

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

LOG: Revert "[CMake] Simplify CMake handling for zlib"

This quietly disabled use of zlib on Windows even when building with
-DLLVM_ENABLE_ZLIB=FORCE_ON.

> Rather than handling zlib handling manually, use find_package from CMake
> to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
> HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
> set to YES, which requires the distributor to explicitly select whether
> zlib is enabled or not. This simplifies the CMake handling and usage in
> the rest of the tooling.
>
> This is a reland of abb0075 with all followup changes and fixes that
> should address issues that were reported in PR44780.
>
> Differential Revision: https://reviews.llvm.org/D79219

This reverts commit 10b1b4a231a485f1711d576e6131f6755e008abe and follow-ups
64d99cc6abed78c00a2a7863b02ce54911a5264f and
f9fec0447e12da9e8cf4b628f6d45f4941e7d182.

Added: 


Modified: 
clang/test/CMakeLists.txt
clang/test/lit.site.cfg.py.in
compiler-rt/test/lit.common.configured.in
lld/test/CMakeLists.txt
lld/test/lit.site.cfg.py.in
lldb/cmake/modules/LLDBStandalone.cmake
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
llvm/cmake/config-ix.cmake
llvm/cmake/modules/LLVMConfig.cmake.in
llvm/include/llvm/Config/config.h.cmake
llvm/lib/Support/CMakeLists.txt
llvm/lib/Support/CRC.cpp
llvm/lib/Support/Compression.cpp
llvm/test/CMakeLists.txt
llvm/test/lit.site.cfg.py.in
llvm/unittests/Support/CompressionTest.cpp
mlir/examples/standalone/CMakeLists.txt

Removed: 




diff  --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 334a90498d0d..38bbc5be90d5 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -9,6 +9,15 @@ endif ()
 
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR 
${LLVM_RUNTIME_OUTPUT_INTDIR})
 
+if(CLANG_BUILT_STANDALONE)
+  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
+  # value is forced to 0 if zlib was not found, so it is fine to use it
+  # instead of HAVE_LIBZ (not recorded).
+  if(LLVM_ENABLE_ZLIB)
+set(HAVE_LIBZ 1)
+  endif()
+endif()
+
 llvm_canonicalize_cmake_booleans(
   CLANG_BUILD_EXAMPLES
   CLANG_ENABLE_ARCMT
@@ -16,7 +25,7 @@ llvm_canonicalize_cmake_booleans(
   CLANG_SPAWN_CC1
   ENABLE_BACKTRACES
   ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
-  LLVM_ENABLE_ZLIB
+  HAVE_LIBZ
   LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
   LLVM_ENABLE_PLUGINS
   LLVM_ENABLE_THREADS)

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 286ea06d798c..d9b5b2f2592e 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -16,7 +16,7 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.host_cxx = "@CMAKE_CXX_COMPILER@"
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
-config.have_zlib = @LLVM_ENABLE_ZLIB@
+config.have_zlib = @HAVE_LIBZ@
 config.clang_arcmt = @CLANG_ENABLE_ARCMT@
 config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
 config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@

diff  --git a/compiler-rt/test/lit.common.configured.in 
b/compiler-rt/test/lit.common.configured.in
index 000bf9b98470..1f746c067b84 100644
--- a/compiler-rt/test/lit.common.configured.in
+++ b/compiler-rt/test/lit.common.configured.in
@@ -57,7 +57,7 @@ elif config.android:
 else:
   set_default("target_suffix", "-%s" % config.target_arch)
 
-set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
+set_default("have_zlib", "@HAVE_LIBZ@")
 set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
 
 # LLVM tools dir can be passed in lit parameters, so try to

diff  --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index 52e6118ba876..74b29f5d65b8 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -4,8 +4,17 @@ set(LLVM_BUILD_MODE "%(build_mode)s")
 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
 set(LLVM_LIBS_DIR 
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
 
+if(LLD_BUILT_STANDALONE)
+  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
+  # value is forced to 0 if zlib was not found, so it is fine to use it
+  # instead of HAVE_LIBZ (not recorded).
+  if(LLVM_ENABLE_ZLIB)
+set(HAVE_LIBZ 1)
+  endif()
+endif()
+
 llvm_canonicalize_cmake_booleans(
-  LLVM_ENABLE_ZLIB
+  HAVE_LIBZ
   LLVM_LIBXML2_ENABLED
   )
 

diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index 

[Lldb-commits] [lldb] 3eec657 - Revert "Enable -Wsuggest-override in the LLVM build" and the follow-ups.

2020-07-22 Thread Hans Wennborg via lldb-commits

Author: Hans Wennborg
Date: 2020-07-22T20:23:58+02:00
New Revision: 3eec65782575a1284391e447142fd004dd5de4a9

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

LOG: Revert "Enable -Wsuggest-override in the LLVM build" and the follow-ups.

After lots of follow-up fixes, there are still problems, such as
-Wno-suggest-override getting passed to the Windows Resource Compiler
because it was added with add_definitions in the CMake file.

Rather than piling on another fix, let's revert so this can be re-landed
when there's a proper fix.

This reverts commit 21c0b4c1e8d6a171899b31d072a47dac27258fc5.
This reverts commit 81d68ad27b29b1e6bc93807c6e42b14e9a77eade.
This reverts commit a361aa5249856e333a373df90947dabf34cd6aab.
This reverts commit fa42b7cf2949802ff0b8a63a2e111a2a68711067.
This reverts commit 955f87f947fda3072a69b0b00ca83c1f6a0566f6.
This reverts commit 8b16e45f66e24e4c10e2cea1b70d2b85a7ce64d5.
This reverts commit 308a127a38df3940420b98ff45fc1c17715f.
This reverts commit 274b6b0c7a8b584662595762eaeff57d61c6807f.
This reverts commit 1c7037a2a5576d0bb083db10ad947a8308e61f65.

Added: 


Modified: 
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/unittests/CMakeLists.txt
clang/unittests/CMakeLists.txt
compiler-rt/cmake/Modules/AddCompilerRT.cmake
compiler-rt/cmake/config-ix.cmake
flang/unittests/CMakeLists.txt
libcxx/CMakeLists.txt
libcxxabi/CMakeLists.txt
lld/unittests/CMakeLists.txt
lldb/unittests/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/lib/Testing/Support/CMakeLists.txt
llvm/unittests/CMakeLists.txt
llvm/utils/benchmark/CMakeLists.txt
llvm/utils/unittest/CMakeLists.txt
mlir/unittests/CMakeLists.txt
parallel-libs/acxxel/CMakeLists.txt
polly/unittests/CMakeLists.txt

Removed: 




diff  --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt 
b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index 8a4a0fb37fc6..c25e2b7f8103 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -22,10 +22,6 @@ if(CLANG_BUILT_STANDALONE)
   endif()
 endif()
 
-if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
-  add_definitions("-Wno-suggest-override")
-endif()
-
 if (CLANGD_ENABLE_REMOTE)
   include_directories(${CMAKE_CURRENT_BINARY_DIR}/../index/remote)
   add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1)

diff  --git a/clang-tools-extra/unittests/CMakeLists.txt 
b/clang-tools-extra/unittests/CMakeLists.txt
index 751827cd2a0f..086a68e63830 100644
--- a/clang-tools-extra/unittests/CMakeLists.txt
+++ b/clang-tools-extra/unittests/CMakeLists.txt
@@ -5,10 +5,6 @@ function(add_extra_unittest test_dirname)
   add_unittest(ExtraToolsUnitTests ${test_dirname} ${ARGN})
 endfunction()
 
-if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
-  add_definitions("-Wno-suggest-override")
-endif()
-
 add_subdirectory(clang-apply-replacements)
 add_subdirectory(clang-change-namespace)
 add_subdirectory(clang-doc)

diff  --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt
index 64168f44f843..4c222e24599f 100644
--- a/clang/unittests/CMakeLists.txt
+++ b/clang/unittests/CMakeLists.txt
@@ -10,10 +10,6 @@ if(CLANG_BUILT_STANDALONE)
   endif()
 endif()
 
-if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
-  add_definitions("-Wno-suggest-override")
-endif()
-
 # add_clang_unittest(test_dirname file1.cpp file2.cpp)
 #
 # Will compile the list of files together and link against the clang

diff  --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 
b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index efb660818270..dab55707338a 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -403,7 +403,6 @@ set(COMPILER_RT_GMOCK_CFLAGS
 
 append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 
COMPILER_RT_UNITTEST_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG 
-Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)
-append_list_if(COMPILER_RT_HAS_WSUGGEST_OVERRIDE_FLAG -Wno-suggest-override 
COMPILER_RT_UNITTEST_CFLAGS)
 
 if(MSVC)
   # gtest use a lot of stuff marked as deprecated on Windows.

diff  --git a/compiler-rt/cmake/config-ix.cmake 
b/compiler-rt/cmake/config-ix.cmake
index 0a27910ed494..f535123351d6 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -106,7 +106,6 @@ check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor"   
COMPILER_RT_HAS_WNON_VIRT
 check_cxx_compiler_flag("-Werror -Wvariadic-macros"
COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG)
 check_cxx_compiler_flag("-Werror -Wunused-parameter"   
COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG)
 check_cxx_compiler_flag("-Werror -Wcovered-switch-default" 

[Lldb-commits] [lldb] 525a591 - Revert 76c5f277f2 "Re-land [Debug][CodeView] Emit fully qualified names for globals"

2020-05-18 Thread Hans Wennborg via lldb-commits

Author: Hans Wennborg
Date: 2020-05-18T11:26:30+02:00
New Revision: 525a591f0f48b9d54018bf5245f2abee09c9c1c8

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

LOG: Revert 76c5f277f2 "Re-land [Debug][CodeView] Emit fully qualified names 
for globals"

> Before this patch, S_[L|G][THREAD32|DATA32] records were emitted with a 
> simple name, not the fully qualified name (namespace + class scope).
>
> Differential Revision: https://reviews.llvm.org/D79447

This causes asserts in Chromium builds:

CodeViewDebug.cpp:2997: void llvm::CodeViewDebug::emitDebugInfoForUDTs(const 
std::vector> &):
Assertion `OriginalSize == UDTs.size()' failed.

I will follow up on the Phabricator issue.

Added: 


Modified: 
lldb/test/Shell/SymbolFile/PDB/variables.test
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
llvm/test/DebugInfo/COFF/global-constants.ll
llvm/test/DebugInfo/COFF/global_visibility.ll
llvm/test/DebugInfo/COFF/globals.ll
llvm/test/DebugInfo/COFF/types-array-unsized.ll

Removed: 




diff  --git a/lldb/test/Shell/SymbolFile/PDB/variables.test 
b/lldb/test/Shell/SymbolFile/PDB/variables.test
index a6c715360958..ae14f02754ce 100644
--- a/lldb/test/Shell/SymbolFile/PDB/variables.test
+++ b/lldb/test/Shell/SymbolFile/PDB/variables.test
@@ -13,12 +13,12 @@ GLOBALS: SymbolFile pdb ([[MOD]])
 GLOBALS: CompileUnit{{.*}}, language = "c++", file = 
'{{.*}}\VariablesTest.cpp'
 GLOBALS-DAG:   Variable{{.*}}, name = "g_IntVar"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
+GLOBALS-DAG:   Variable{{.*}}, name = "m_StaticClassMember"
+GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_pConst"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "same_name_var"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
-GLOBALS-DAG:   Variable{{.*}}, name = "Class::m_StaticClassMember"
-GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_EnumVar"
 GLOBALS-SAME:  scope = global, location = {{.*}}, external
 GLOBALS-DAG:   Variable{{.*}}, name = "g_tls"

diff  --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp 
b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 6f75dbd889fe..f167cead4e2c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -343,24 +343,8 @@ static std::string formatNestedName(ArrayRef 
QualifiedNameComponents,
   return FullyQualifiedName;
 }
 
-struct CodeViewDebug::TypeLoweringScope {
-  TypeLoweringScope(CodeViewDebug ) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
-  ~TypeLoweringScope() {
-// Don't decrement TypeEmissionLevel until after emitting deferred types, 
so
-// inner TypeLoweringScopes don't attempt to emit deferred types.
-if (CVD.TypeEmissionLevel == 1)
-  CVD.emitDeferredCompleteTypes();
---CVD.TypeEmissionLevel;
-  }
-  CodeViewDebug 
-};
-
 std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Scope,
  StringRef Name) {
-  // Ensure types in the scope chain are emitted as soon as possible.
-  // This can create otherwise a situation where S_UDTs are emitted while
-  // looping in emitDebugInfoForUDTs.
-  TypeLoweringScope S(*this);
   SmallVector QualifiedNameComponents;
   collectParentScopeNames(Scope, QualifiedNameComponents);
   return formatNestedName(QualifiedNameComponents, Name);
@@ -371,6 +355,18 @@ std::string CodeViewDebug::getFullyQualifiedName(const 
DIScope *Ty) {
   return getFullyQualifiedName(Scope, getPrettyScopeName(Ty));
 }
 
+struct CodeViewDebug::TypeLoweringScope {
+  TypeLoweringScope(CodeViewDebug ) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
+  ~TypeLoweringScope() {
+// Don't decrement TypeEmissionLevel until after emitting deferred types, 
so
+// inner TypeLoweringScopes don't attempt to emit deferred types.
+if (CVD.TypeEmissionLevel == 1)
+  CVD.emitDeferredCompleteTypes();
+--CVD.TypeEmissionLevel;
+  }
+  CodeViewDebug 
+};
+
 TypeIndex CodeViewDebug::getScopeIndex(const DIScope *Scope) {
   // No scope means global scope and that uses the zero index.
   if (!Scope || isa(Scope))
@@ -2985,16 +2981,10 @@ void CodeViewDebug::emitEndSymbolRecord(SymbolKind 
EndKind) {
 }
 
 void CodeViewDebug::emitDebugInfoForUDTs(
-const std::vector> ) {
-#ifndef NDEBUG
-  size_t OriginalSize = UDTs.size();
-#endif
+ArrayRef> UDTs) {
   for (const auto  : UDTs) {
 const DIType *T = UDT.second;
 assert(shouldEmitUdt(T));
-// Ensure no new types are discovered when executing the code below.
-// See discussion in https://reviews.llvm.org/D79512
-

[Lldb-commits] [lldb] 916be8f - Revert abb00753 "build: reduce CMake handling for zlib" (PR44780)

2020-03-03 Thread Hans Wennborg via lldb-commits

Author: Hans Wennborg
Date: 2020-03-03T11:03:09+01:00
New Revision: 916be8fd6a0a0feea4cefcbeb0c22c65848d7a2e

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

LOG: Revert abb00753 "build: reduce CMake handling for zlib" (PR44780)

and follow-ups:
a2ca1c2d "build: disable zlib by default on Windows"
2181bf40 "[CMake] Link against ZLIB::ZLIB"
1079c68a "Attempt to fix ZLIB CMake logic on Windows"

This changed the output of llvm-config --system-libs, and more
importantly it broke stand-alone builds. Instead of piling on more fix
attempts, let's revert this to reduce the risk of more breakages.

Added: 


Modified: 
clang/test/CMakeLists.txt
clang/test/lit.site.cfg.py.in
compiler-rt/test/lit.common.configured.in
lld/test/CMakeLists.txt
lld/test/lit.site.cfg.py.in
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
llvm/include/llvm/Config/config.h.cmake
llvm/lib/Support/CMakeLists.txt
llvm/lib/Support/CRC.cpp
llvm/lib/Support/Compression.cpp
llvm/test/CMakeLists.txt
llvm/test/lit.site.cfg.py.in
llvm/unittests/Support/CompressionTest.cpp

Removed: 




diff  --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 2c6487e8c260..7fdc7d0be79f 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -9,6 +9,15 @@ endif ()
 
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR 
${LLVM_RUNTIME_OUTPUT_INTDIR})
 
+if(CLANG_BUILT_STANDALONE)
+  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
+  # value is forced to 0 if zlib was not found, so it is fine to use it
+  # instead of HAVE_LIBZ (not recorded).
+  if(LLVM_ENABLE_ZLIB)
+set(HAVE_LIBZ 1)
+  endif()
+endif()
+
 llvm_canonicalize_cmake_booleans(
   CLANG_BUILD_EXAMPLES
   CLANG_ENABLE_ARCMT
@@ -16,7 +25,7 @@ llvm_canonicalize_cmake_booleans(
   CLANG_SPAWN_CC1
   ENABLE_BACKTRACES
   ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
-  LLVM_ENABLE_ZLIB
+  HAVE_LIBZ
   LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
   LLVM_ENABLE_PLUGINS
   LLVM_ENABLE_THREADS)

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 39c8b47adf92..62616d9a2b95 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -16,7 +16,7 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.host_cxx = "@CMAKE_CXX_COMPILER@"
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
-config.have_zlib = @LLVM_ENABLE_ZLIB@
+config.have_zlib = @HAVE_LIBZ@
 config.clang_arcmt = @CLANG_ENABLE_ARCMT@
 config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
 config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@

diff  --git a/compiler-rt/test/lit.common.configured.in 
b/compiler-rt/test/lit.common.configured.in
index 4de8d030070f..60464bcdaa87 100644
--- a/compiler-rt/test/lit.common.configured.in
+++ b/compiler-rt/test/lit.common.configured.in
@@ -51,7 +51,7 @@ if config.enable_per_target_runtime_dir:
 else:
   set_default("target_suffix", "-%s" % config.target_arch)
 
-set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
+set_default("have_zlib", "@HAVE_LIBZ@")
 set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
 
 # LLVM tools dir can be passed in lit parameters, so try to

diff  --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index dc8cedf2ea09..8be42c46dd8a 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -4,8 +4,17 @@ set(LLVM_BUILD_MODE "%(build_mode)s")
 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
 set(LLVM_LIBS_DIR 
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
 
+if(LLD_BUILT_STANDALONE)
+  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
+  # value is forced to 0 if zlib was not found, so it is fine to use it
+  # instead of HAVE_LIBZ (not recorded).
+  if(LLVM_ENABLE_ZLIB)
+set(HAVE_LIBZ 1)
+  endif()
+endif()
+
 llvm_canonicalize_cmake_booleans(
-  LLVM_ENABLE_ZLIB
+  HAVE_LIBZ
   LLVM_LIBXML2_ENABLED
   )
 

diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index 531fce15839d..02840f8d6a30 100644
--- a/lld/test/lit.site.cfg.py.in
+++ b/lld/test/lit.site.cfg.py.in
@@ -14,7 +14,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
 config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
-config.have_zlib = @LLVM_ENABLE_ZLIB@
+config.have_zlib = @HAVE_LIBZ@
 config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@
 
 # Support substitution of the tools and libs dirs with user parameters. This is

diff  --git 

Re: [Lldb-commits] [lldb] 2046d72 - build: improve python checks for Windows

2020-01-28 Thread Hans Wennborg via lldb-commits
Should https://llvm.org/docs/GettingStarted.html#requirements and
https://llvm.org/docs/CMake.html#quick-start be updated to reflect the
new requirement? And maybe a release note?

On Sun, Dec 22, 2019 at 2:01 PM Saleem Abdulrasool via lldb-commits
 wrote:
>
>
> Author: Saleem Abdulrasool
> Date: 2019-12-22T13:57:46-08:00
> New Revision: 2046d72e91670114625c87e122db6e013ba089d5
>
> URL: 
> https://github.com/llvm/llvm-project/commit/2046d72e91670114625c87e122db6e013ba089d5
> DIFF: 
> https://github.com/llvm/llvm-project/commit/2046d72e91670114625c87e122db6e013ba089d5.diff
>
> LOG: build: improve python checks for Windows
>
> Require a newer CMake on Windows to use the Python3 support that is
> packaged in CMake. This version is able to check both 32-bit and 64-bit
> versions and will setup everything properly without the user needing to
> specify PYTHON_HOME. This enables building lldb's python bindings on
> Windows under Azure's CI again.
>
> Added:
>
>
> Modified:
> lldb/CMakeLists.txt
> lldb/cmake/modules/LLDBConfig.cmake
>
> Removed:
>
>
>
> 
> diff  --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
> index ff3d8ae70747..6170ab625c54 100644
> --- a/lldb/CMakeLists.txt
> +++ b/lldb/CMakeLists.txt
> @@ -1,4 +1,7 @@
>  cmake_minimum_required(VERSION 3.4.3)
> +if(CMAKE_SYSTEM_NAME STREQUAL Windows)
> +  cmake_minimum_required(VERSION 3.13)
> +endif()
>
>  if(POLICY CMP0075)
>cmake_policy(SET CMP0075 NEW)
>
> diff  --git a/lldb/cmake/modules/LLDBConfig.cmake 
> b/lldb/cmake/modules/LLDBConfig.cmake
> index c34ef76cb652..e1da76cf6249 100644
> --- a/lldb/cmake/modules/LLDBConfig.cmake
> +++ b/lldb/cmake/modules/LLDBConfig.cmake
> @@ -138,184 +138,39 @@ if (LLDB_ENABLE_LIBEDIT)
>set(CMAKE_EXTRA_INCLUDE_FILES)
>  endif()
>
> -# On Windows, we can't use the normal FindPythonLibs module that comes with 
> CMake,
> -# for a number of reasons.
> -# 1) Prior to MSVC 2015, it is only possible to embed Python if python 
> itself was
> -#compiled with an identical version (and build configuration) of MSVC as 
> LLDB.
> -#The standard algorithm does not take into account the
> diff erences between
> -#a binary release distribution of python and a custom built distribution.
> -# 2) From MSVC 2015 and onwards, it is only possible to use Python 3.5 or 
> later.
> -# 3) FindPythonLibs queries the registry to locate Python, and when looking 
> for a
> -#64-bit version of Python, since cmake.exe is a 32-bit executable, it 
> will see
> -#a 32-bit view of the registry.  As such, it is impossible for 
> FindPythonLibs to
> -#locate 64-bit Python libraries.
> -# This function is designed to address those limitations.  Currently it only 
> partially
> -# addresses them, but it can be improved and extended on an as-needed basis.
> -function(find_python_libs_windows_helper LOOKUP_DEBUG OUT_EXE_PATH_VARNAME 
> OUT_LIB_PATH_VARNAME OUT_DLL_PATH_VARNAME OUT_VERSION_VARNAME)
> -  if(LOOKUP_DEBUG)
> -  set(POSTFIX "_d")
> -  else()
> -  set(POSTFIX "")
> -  endif()
> -
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/python${POSTFIX}.exe"   
> PYTHON_EXE)
> -  file(TO_CMAKE_PATH 
> "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}${POSTFIX}.lib" PYTHON_LIB)
> -  file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}${POSTFIX}.dll"  
> PYTHON_DLL)
> -
> -  foreach(component PYTHON_EXE;PYTHON_LIB;PYTHON_DLL)
> -if(NOT EXISTS ${${component}})
> -  message(WARNING "Unable to find ${component}")
> -  unset(${component})
> -endif()
> -  endforeach()
> -
> -  if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL)
> -message(WARNING "Unable to find all Python components.  Python support 
> will be disabled for this build.")
> -set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
> -return()
> -  endif()
> -
> -  # Find the version of the Python interpreter.
> -  execute_process(COMMAND "${PYTHON_EXE}" -c
> -  "import sys; sys.stdout.write('.'.join([str(x) for x in 
> sys.version_info[:3]]))"
> -  OUTPUT_VARIABLE PYTHON_VERSION_OUTPUT
> -  RESULT_VARIABLE PYTHON_VERSION_RESULT
> -  ERROR_QUIET)
> -
> -  if(PYTHON_VERSION_RESULT)
> -message(WARNING "Unable to retrieve Python executable version")
> -set(PYTHON_VERSION_OUTPUT "")
> -  endif()
> -
> -  set(${OUT_EXE_PATH_VARNAME} ${PYTHON_EXE} PARENT_SCOPE)
> -  set(${OUT_LIB_PATH_VARNAME} ${PYTHON_LIB} PARENT_SCOPE)
> -  set(${OUT_DLL_PATH_VARNAME} ${PYTHON_DLL} PARENT_SCOPE)
> -  set(${OUT_VERSION_VARNAME}  ${PYTHON_VERSION_OUTPUT} PARENT_SCOPE)
> -endfunction()
> -
> -function(find_python_libs_windows)
> -  if ("${PYTHON_HOME}" STREQUAL "")
> -message(WARNING "LLDB embedded Python on Windows requires specifying a 
> value for PYTHON_HOME.  Python support disabled.")
> -set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
> -return()
> -  endif()
> -
> -  file(TO_CMAKE_PATH 

Re: [Lldb-commits] [lldb] fcaf5f6 - [LLDB] Fix the handling of unnamed bit-fields when parsing DWARF

2020-01-28 Thread Hans Wennborg via lldb-commits
Cherry-picked that in 54b022d344412fc9f1dfe37ee05de934a01e1ea4

Thanks!

On Tue, Jan 28, 2020 at 1:12 AM Raphael Isemann  wrote:
>
> Quick follow up: apparently Pavel fixed some nondeterminism in the testing 
> code that had made the test fail on some systems. Could you also cherry-pick 
> 77cedb0cdb8623ff9eb22dbf3b9302ee4d9f8a20 ?
>
> Thanks again!
>
> > On 27. Jan 2020, at 15:10, Hans Wennborg  wrote:
> >
> > Sure, b5cf892651812003e64c4a8f0dbf81f74a499016
> >
> > On Mon, Jan 27, 2020 at 12:18 AM Raphael Isemann  wrote:
> >>
> >> This commit fixes a *very* frequent crash when debugging Clang with LLDB 
> >> 10. Could we get that cherry-picked into the 10.x branch?
> >>
> >> I’ve been running the patch since more than a week and I haven’t found any 
> >> issues with it and the bots are also happy.
> >>
> >> Thanks!
> >> - Raphael
> >>
> >>> On 23. Jan 2020, at 23:46, via lldb-commits  
> >>> wrote:
> >>>
> >>>
> >>> Author: shafik
> >>> Date: 2020-01-23T14:46:24-08:00
> >>> New Revision: fcaf5f6c01a09f23b948afb8c91c4dd951d4525e
> >>>
> >>> URL: 
> >>> https://github.com/llvm/llvm-project/commit/fcaf5f6c01a09f23b948afb8c91c4dd951d4525e
> >>> DIFF: 
> >>> https://github.com/llvm/llvm-project/commit/fcaf5f6c01a09f23b948afb8c91c4dd951d4525e.diff
> >>>
> >>> LOG: [LLDB] Fix the handling of unnamed bit-fields when parsing DWARF
> >>>
> >>> We ran into an assert when debugging clang and performing an expression 
> >>> on a class derived from DeclContext. The assert was indicating we were 
> >>> getting the offsets wrong for RecordDeclBitfields. We were getting both 
> >>> the size and offset of unnamed bit-field members wrong. We could fix this 
> >>> case with a quick change but as I extended the test suite to include more 
> >>> combinations we kept finding more cases that were being handled 
> >>> incorrectly. A fix that handled all the new cases as well as the cases 
> >>> already covered required a refactor of the existing technique.
> >>>
> >>> Differential Revision: https://reviews.llvm.org/D72953
> >>>
> >>> Added:
> >>>   lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> >>>   
> >>> lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >>>   lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp
> >>>
> >>> Modified:
> >>>   lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> >>>   lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
> >>>
> >>> Removed:
> >>>
> >>>
> >>>
> >>> 
> >>> diff  --git 
> >>> a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile 
> >>> b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> >>> new file mode 100644
> >>> index ..8b20bcb0
> >>> --- /dev/null
> >>> +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> >>> @@ -0,0 +1,3 @@
> >>> +CXX_SOURCES := main.cpp
> >>> +
> >>> +include Makefile.rules
> >>>
> >>> diff  --git 
> >>> a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >>>  
> >>> b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >>> new file mode 100644
> >>> index ..696e5647f13f
> >>> --- /dev/null
> >>> +++ 
> >>> b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >>> @@ -0,0 +1,105 @@
> >>> +"""Show bitfields and check that they display correctly."""
> >>> +
> >>> +import lldb
> >>> +from lldbsuite.test.decorators import *
> >>> +from lldbsuite.test.lldbtest import *
> >>> +from lldbsuite.test import lldbutil
> >>> +
> >>> +
> >>> +class CppBitfieldsTestCase(TestBase):
> >>> +
> >>> +mydir = TestBase.compute_mydir(__file__)
> >>> +
> >>> +def setUp(self):
> >>> +# Call super's setUp().
> >>> +TestBase.setUp(self)
> >>> +# Find the line number to break inside main().
> >>> +self.line = line_number('main.cpp', '// Set break point at this 
> >>> line.')
> >>> +
> >>> +# BitFields exhibit crashes in record layout on Windows
> >>> +# (http://llvm.org/pr21800)
> >>> +@skipIfWindows
> >>> +def test_and_run_command(self):
> >>> +"""Test 'frame variable ...' on a variable with bitfields."""
> >>> +self.build()
> >>> +
> >>> +lldbutil.run_to_source_breakpoint(self, '// Set break point at 
> >>> this line.',
> >>> +  lldb.SBFileSpec("main.cpp", False))
> >>> +
> >>> +# The stop reason of the thread should be breakpoint.
> >>> +self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
> >>> +substrs=['stopped',
> >>> + 'stop reason = breakpoint'])
> >>> +
> >>> +# The breakpoint should have a hit count of 1.
> >>> +self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
> >>> +substrs=[' resolved, hit count = 1'])
> >>> +
> >>> +self.expect("expr (lba.a)", VARIABLES_DISPLAYED_CORRECTLY,

Re: [Lldb-commits] [lldb] fcaf5f6 - [LLDB] Fix the handling of unnamed bit-fields when parsing DWARF

2020-01-27 Thread Hans Wennborg via lldb-commits
Sure, b5cf892651812003e64c4a8f0dbf81f74a499016

On Mon, Jan 27, 2020 at 12:18 AM Raphael Isemann  wrote:
>
> This commit fixes a *very* frequent crash when debugging Clang with LLDB 10. 
> Could we get that cherry-picked into the 10.x branch?
>
> I’ve been running the patch since more than a week and I haven’t found any 
> issues with it and the bots are also happy.
>
> Thanks!
> - Raphael
>
> > On 23. Jan 2020, at 23:46, via lldb-commits  
> > wrote:
> >
> >
> > Author: shafik
> > Date: 2020-01-23T14:46:24-08:00
> > New Revision: fcaf5f6c01a09f23b948afb8c91c4dd951d4525e
> >
> > URL: 
> > https://github.com/llvm/llvm-project/commit/fcaf5f6c01a09f23b948afb8c91c4dd951d4525e
> > DIFF: 
> > https://github.com/llvm/llvm-project/commit/fcaf5f6c01a09f23b948afb8c91c4dd951d4525e.diff
> >
> > LOG: [LLDB] Fix the handling of unnamed bit-fields when parsing DWARF
> >
> > We ran into an assert when debugging clang and performing an expression on 
> > a class derived from DeclContext. The assert was indicating we were getting 
> > the offsets wrong for RecordDeclBitfields. We were getting both the size 
> > and offset of unnamed bit-field members wrong. We could fix this case with 
> > a quick change but as I extended the test suite to include more 
> > combinations we kept finding more cases that were being handled 
> > incorrectly. A fix that handled all the new cases as well as the cases 
> > already covered required a refactor of the existing technique.
> >
> > Differential Revision: https://reviews.llvm.org/D72953
> >
> > Added:
> >lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> >
> > lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp
> >
> > Modified:
> >lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> >lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
> >
> > Removed:
> >
> >
> >
> > 
> > diff  --git 
> > a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile 
> > b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> > new file mode 100644
> > index ..8b20bcb0
> > --- /dev/null
> > +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile
> > @@ -0,0 +1,3 @@
> > +CXX_SOURCES := main.cpp
> > +
> > +include Makefile.rules
> >
> > diff  --git 
> > a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> >  
> > b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> > new file mode 100644
> > index ..696e5647f13f
> > --- /dev/null
> > +++ 
> > b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
> > @@ -0,0 +1,105 @@
> > +"""Show bitfields and check that they display correctly."""
> > +
> > +import lldb
> > +from lldbsuite.test.decorators import *
> > +from lldbsuite.test.lldbtest import *
> > +from lldbsuite.test import lldbutil
> > +
> > +
> > +class CppBitfieldsTestCase(TestBase):
> > +
> > +mydir = TestBase.compute_mydir(__file__)
> > +
> > +def setUp(self):
> > +# Call super's setUp().
> > +TestBase.setUp(self)
> > +# Find the line number to break inside main().
> > +self.line = line_number('main.cpp', '// Set break point at this 
> > line.')
> > +
> > +# BitFields exhibit crashes in record layout on Windows
> > +# (http://llvm.org/pr21800)
> > +@skipIfWindows
> > +def test_and_run_command(self):
> > +"""Test 'frame variable ...' on a variable with bitfields."""
> > +self.build()
> > +
> > +lldbutil.run_to_source_breakpoint(self, '// Set break point at 
> > this line.',
> > +  lldb.SBFileSpec("main.cpp", False))
> > +
> > +# The stop reason of the thread should be breakpoint.
> > +self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
> > +substrs=['stopped',
> > + 'stop reason = breakpoint'])
> > +
> > +# The breakpoint should have a hit count of 1.
> > +self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
> > +substrs=[' resolved, hit count = 1'])
> > +
> > +self.expect("expr (lba.a)", VARIABLES_DISPLAYED_CORRECTLY,
> > +substrs=['unsigned int', '2'])
> > +self.expect("expr (lbb.b)", VARIABLES_DISPLAYED_CORRECTLY,
> > +substrs=['unsigned int', '3'])
> > +self.expect("expr (lbc.c)", VARIABLES_DISPLAYED_CORRECTLY,
> > +substrs=['unsigned int', '4'])
> > +self.expect("expr (lbd.a)", VARIABLES_DISPLAYED_CORRECTLY,
> > +substrs=['unsigned int', '5'])
> > +self.expect("expr (clang_example.f.a)", 
> > VARIABLES_DISPLAYED_CORRECTLY,
> > +substrs=['uint64_t', '1'])
> > +
> > +self.expect(
> > +"frame variable 

[Lldb-commits] [lldb] r374148 - Unify the two CRC implementations

2019-10-09 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Wed Oct  9 02:06:30 2019
New Revision: 374148

URL: http://llvm.org/viewvc/llvm-project?rev=374148=rev
Log:
Unify the two CRC implementations

David added the JamCRC implementation in r246590. More recently, Eugene
added a CRC-32 implementation in r357901, which falls back to zlib's
crc32 function if present.

These checksums are essentially the same, so having multiple
implementations seems unnecessary. This replaces the CRC-32
implementation with the simpler one from JamCRC, and implements the
JamCRC interface in terms of CRC-32 since this means it can use zlib's
implementation when available, saving a few bytes and potentially making
it faster.

JamCRC took an ArrayRef argument, and CRC-32 took a StringRef.
This patch changes it to ArrayRef which I think is the best
choice, and simplifies a few of the callers nicely.

Differential revision: https://reviews.llvm.org/D68570

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

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=374148=374147=374148=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Wed Oct  9 
02:06:30 2019
@@ -36,7 +36,7 @@
 #include "llvm/BinaryFormat/ELF.h"
 #include "llvm/Object/Decompressor.h"
 #include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/Support/JamCRC.h"
+#include "llvm/Support/CRC.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/MipsABIFlags.h"
@@ -398,10 +398,8 @@ bool ObjectFileELF::MagicBytesMatch(Data
 }
 
 static uint32_t calc_crc32(uint32_t init, const DataExtractor ) {
-  llvm::JamCRC crc(~init);
-  crc.update(llvm::makeArrayRef(
-  reinterpret_cast(data.GetDataStart()), 
data.GetByteSize()));
-  return ~crc.getCRC();
+  return llvm::crc32(
+  init, llvm::makeArrayRef(data.GetDataStart(), data.GetByteSize()));
 }
 
 uint32_t ObjectFileELF::CalculateELFNotesSegmentsCRC32(


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


Re: [Lldb-commits] [lldb] r372788 - Host: use the platform identifiers from LLVM (NFC)

2019-09-25 Thread Hans Wennborg via lldb-commits
This seems to have broken the build:
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9182

I've reverted in r372847.

On Wed, Sep 25, 2019 at 12:53 AM Saleem Abdulrasool via lldb-commits
 wrote:
>
> Author: compnerd
> Date: Tue Sep 24 15:55:44 2019
> New Revision: 372788
>
> URL: http://llvm.org/viewvc/llvm-project?rev=372788=rev
> Log:
> Host: use the platform identifiers from LLVM (NFC)
>
> Use symbolic constants for the platform identifiers rather than replicating 
> them
> locally.
>
> Modified:
> lldb/trunk/source/Host/windows/Host.cpp
>
> Modified: lldb/trunk/source/Host/windows/Host.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Host.cpp?rev=372788=372787=372788=diff
> ==
> --- lldb/trunk/source/Host/windows/Host.cpp (original)
> +++ lldb/trunk/source/Host/windows/Host.cpp Tue Sep 24 15:55:44 2019
> @@ -22,6 +22,7 @@
>  #include "lldb/Utility/StreamString.h"
>  #include "lldb/Utility/StructuredData.h"
>
> +#include "llvm/BinaryFormat/COFF.h"
>  #include "llvm/Support/ConvertUTF.h"
>
>  // Windows includes
> @@ -52,13 +53,13 @@ bool GetTripleForProcess(const FileSpec
>triple.setVendor(llvm::Triple::PC);
>triple.setOS(llvm::Triple::Win32);
>triple.setArch(llvm::Triple::UnknownArch);
> -  if (machineType == 0x8664)
> +  if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_AMD64)
>  triple.setArch(llvm::Triple::x86_64);
> -  else if (machineType == 0x14c)
> +  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_I386)
>  triple.setArch(llvm::Triple::x86);
> -  else if (machineType == 0x1c4)
> +  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_ARMNT)
>  triple.setArch(llvm::Triple::arm);
> -  else if (machineType == 0xaa64)
> +  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_ARM64)
>  triple.setArch(llvm::Triple::aarch64);
>
>return true;
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r372847 - Revert r372788 "Host: use the platform identifiers from LLVM (NFC)"

2019-09-25 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Wed Sep 25 04:55:16 2019
New Revision: 372847

URL: http://llvm.org/viewvc/llvm-project?rev=372847=rev
Log:
Revert r372788 "Host: use the platform identifiers from LLVM (NFC)"

> Use symbolic constants for the platform identifiers rather than replicating 
> them
> locally.

This broke the build of LLDB on Windows, see
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9182 which
fails with e.g.

  
E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(96):
 error C2059: syntax error: 'constant'
  
E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(96):
 error C3805: 'constant': unexpected token, expected either '}' or a ','
  
E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(128):
 error C2059: syntax error: 'constant'
  ...

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

Modified: lldb/trunk/source/Host/windows/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Host.cpp?rev=372847=372846=372847=diff
==
--- lldb/trunk/source/Host/windows/Host.cpp (original)
+++ lldb/trunk/source/Host/windows/Host.cpp Wed Sep 25 04:55:16 2019
@@ -22,7 +22,6 @@
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/StructuredData.h"
 
-#include "llvm/BinaryFormat/COFF.h"
 #include "llvm/Support/ConvertUTF.h"
 
 // Windows includes
@@ -53,13 +52,13 @@ bool GetTripleForProcess(const FileSpec
   triple.setVendor(llvm::Triple::PC);
   triple.setOS(llvm::Triple::Win32);
   triple.setArch(llvm::Triple::UnknownArch);
-  if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_AMD64)
+  if (machineType == 0x8664)
 triple.setArch(llvm::Triple::x86_64);
-  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_I386)
+  else if (machineType == 0x14c)
 triple.setArch(llvm::Triple::x86);
-  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_ARMNT)
+  else if (machineType == 0x1c4)
 triple.setArch(llvm::Triple::arm);
-  else if (machineType == llvm::COFF::IMAGE_FILE_MACHINE_ARM64)
+  else if (machineType == 0xaa64)
 triple.setArch(llvm::Triple::aarch64);
 
   return true;


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


Re: [Lldb-commits] [lldb] r367308 - [lldb] Fix crash when tab-completing in multi-line expr

2019-08-01 Thread Hans Wennborg via lldb-commits
Merged to release_90 in r367534.

On Tue, Jul 30, 2019 at 2:53 PM Hans Wennborg  wrote:
>
> Hi Raphael,
>
> Since this just landed, let's have it bake in trunk a little bit, and
> then I'll merge it.
>
> Thanks,
> Hans
>
> On Tue, Jul 30, 2019 at 2:36 PM Raphael “Teemperor” Isemann
>  wrote:
> >
> > Hi Hans,
> >
> > Can you cherry-pick this to the 9.0 release? The issue is really easy to 
> > hit when using LLDB and the fix is obvious
> >
> > Thanks!
> > - Raphael
> >
> > > On Jul 30, 2019, at 2:31 PM, Raphael Isemann via lldb-commits 
> > >  wrote:
> > >
> > > Author: teemperor
> > > Date: Tue Jul 30 05:31:24 2019
> > > New Revision: 367308
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=367308=rev
> > > Log:
> > > [lldb] Fix crash when tab-completing in multi-line expr
> > >
> > > Summary:
> > > Tab completing inside the multiline expression command can cause LLDB to 
> > > crash. The easiest way
> > > to do this is to go inside a frame with at least one local variable and 
> > > then try to complete:
> > >
> > >(lldb) expr
> > >1. a[tab]
> > >
> > > Reason for this was some mixup when we calculate the cursor position. 
> > > Obviously we should calculate
> > > the offset inside the string by doing 'end - start', but we are doing 
> > > 'start - end' (which causes the offset to
> > > become -1 which will lead to some out-of-bounds reading).
> > >
> > > Fixes rdar://51754005
> > >
> > > I don't see any way to test this as the *multiline* expression completion 
> > > is completely untested at the moment
> > > and I don't think we have any existing code for testing infrastructure 
> > > for it.
> > >
> > > Reviewers: shafik, davide, labath
> > >
> > > Reviewed By: labath
> > >
> > > Subscribers: abidh, lldb-commits, davide, clayborg, labath
> > >
> > > Tags: #lldb
> > >
> > > Differential Revision: https://reviews.llvm.org/D64995
> > >
> > > Added:
> > >
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/
> > >
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> > >
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> > >
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
> > > Modified:
> > >lldb/trunk/source/Core/IOHandler.cpp
> > >
> > > Added: 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> > > URL: 
> > > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile?rev=367308=auto
> > > ==
> > > --- 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> > >  (added)
> > > +++ 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> > >  Tue Jul 30 05:31:24 2019
> > > @@ -0,0 +1,3 @@
> > > +LEVEL = ../../make
> > > +C_SOURCES := main.c
> > > +include $(LEVEL)/Makefile.rules
> > >
> > > Added: 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> > > URL: 
> > > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py?rev=367308=auto
> > > ==
> > > --- 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> > >  (added)
> > > +++ 
> > > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> > >  Tue Jul 30 05:31:24 2019
> > > @@ -0,0 +1,52 @@
> > > +"""
> > > +Test completion for multiline expressions.
> > > +"""
> > > +
> > > +import lldb
> > > +from lldbsuite.test.decorators import *
> > > +from lldbsuite.test.lldbtest import *
> > > +
> > > +class MultilineCompletionTest(TestBase):
> > > +
> > > +mydir = TestBase.compute_mydir(__file__)
> > > +NO_DEBUG_INFO_TESTCASE = True
> > > +
> > > +def setUp(self):
> > > +TestBase.setUp(self)
> > > +self.source = 'main.c'
> > > +
> > > +def expect_string(self, string):
> > > +import pexpect
> > > +"""This expects for "string", with timeout & EOF being test 
> > > fails."""
> > > +try:
> > > +self.child.expect_exact(string)
> > > +except pexpect.EOF:
> > > +self.fail("Got EOF waiting for '%s'" % (string))
> > > +except pexpect.TIMEOUT:
> > > +self.fail("Timed out waiting for '%s'" % (string))
> > > +
> > > +@expectedFailureAll(
> > > +oslist=["windows"],
> > > +bugnumber="llvm.org/pr22274: need a pexpect replacement for 
> > > windows")
> > > +def test_basic_completion(self):
> > > +

Re: [Lldb-commits] [lldb] r367414 - [ProcessWindows] Choose a register context file by preprocessor

2019-08-01 Thread Hans Wennborg via lldb-commits
Merged to release_90 in r367523.

On Wed, Jul 31, 2019 at 1:59 PM Tatyana Krasnukha via lldb-commits
 wrote:
>
> Author: tkrasnukha
> Date: Wed Jul 31 05:00:30 2019
> New Revision: 367414
>
> URL: http://llvm.org/viewvc/llvm-project?rev=367414=rev
> Log:
> [ProcessWindows] Choose a register context file by preprocessor
>
> Replaced Cmake option based check with the preprocessor macro as 
> CMAKE_SYSTEM_PROCESSOR doesn't work as expected on Windows.
>
> Fixes llvm.org/pr42724
>
> Differential Revision: https://reviews.llvm.org/D65409
>
> Modified:
> lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
> 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
> 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
> 
> lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
> 
> lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h
>
> Modified: lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt?rev=367414=367413=367414=diff
> ==
> --- lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt (original)
> +++ lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt Wed Jul 
> 31 05:00:30 2019
> @@ -7,6 +7,9 @@ add_lldb_library(lldbPluginProcessWindow
>ProcessWindowsLog.cpp
>RegisterContextWindows.cpp
>TargetThreadWindows.cpp
> +  x64/RegisterContextWindows_x64.cpp
> +  x86/RegisterContextWindows_x86.cpp
> +  # TODO add support for ARM (NT) and ARM64
>
>LINK_LIBS
>  lldbCore
> @@ -20,13 +23,3 @@ add_lldb_library(lldbPluginProcessWindow
>LINK_COMPONENTS
>  Support
>)
> -
> -# TODO add support for ARM (NT) and ARM64
> -# TODO build these unconditionally as we cannot do cross-debugging or WoW
> -if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
> -  target_sources(lldbPluginProcessWindowsCommon PRIVATE
> -x64/RegisterContextWindows_x64.cpp)
> -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86")
> -  target_sources(lldbPluginProcessWindowsCommon PRIVATE
> -x86/RegisterContextWindows_x86.cpp)
> -endif()
>
> Modified: 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp?rev=367414=367413=367414=diff
> ==
> --- 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
>  (original)
> +++ 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
>  Wed Jul 31 05:00:30 2019
> @@ -6,6 +6,8 @@
>  //
>  
> //===--===//
>
> +#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
> defined(_M_AMD64)
> +
>  #include "lldb/Host/windows/HostThreadWindows.h"
>  #include "lldb/Host/windows/windows.h"
>  #include "lldb/Utility/RegisterValue.h"
> @@ -534,3 +536,5 @@ bool RegisterContextWindows_x64::WriteRe
>return ::SetThreadContext(
>wthread.GetHostThread().GetNativeThread().GetSystemHandle(), 
> _context);
>  }
> +
> +#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
> defined(_M_AMD64)
>
> Modified: 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h?rev=367414=367413=367414=diff
> ==
> --- 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
>  (original)
> +++ 
> lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
>  Wed Jul 31 05:00:30 2019
> @@ -9,6 +9,8 @@
>  #ifndef liblldb_RegisterContextWindows_x64_H_
>  #define liblldb_RegisterContextWindows_x64_H_
>
> +#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
> defined(_M_AMD64)
> +
>  #include "RegisterContextWindows.h"
>  #include "lldb/lldb-forward.h"
>
> @@ -40,4 +42,6 @@ public:
>  };
>  }
>
> +#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
> defined(_M_AMD64)
> +
>  #endif // #ifndef liblldb_RegisterContextWindows_x64_H_
>
> Modified: 
> lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp?rev=367414=367413=367414=diff
> ==
> --- 
> 

Re: [Lldb-commits] [lldb] r367308 - [lldb] Fix crash when tab-completing in multi-line expr

2019-07-30 Thread Hans Wennborg via lldb-commits
Hi Raphael,

Since this just landed, let's have it bake in trunk a little bit, and
then I'll merge it.

Thanks,
Hans

On Tue, Jul 30, 2019 at 2:36 PM Raphael “Teemperor” Isemann
 wrote:
>
> Hi Hans,
>
> Can you cherry-pick this to the 9.0 release? The issue is really easy to hit 
> when using LLDB and the fix is obvious
>
> Thanks!
> - Raphael
>
> > On Jul 30, 2019, at 2:31 PM, Raphael Isemann via lldb-commits 
> >  wrote:
> >
> > Author: teemperor
> > Date: Tue Jul 30 05:31:24 2019
> > New Revision: 367308
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=367308=rev
> > Log:
> > [lldb] Fix crash when tab-completing in multi-line expr
> >
> > Summary:
> > Tab completing inside the multiline expression command can cause LLDB to 
> > crash. The easiest way
> > to do this is to go inside a frame with at least one local variable and 
> > then try to complete:
> >
> >(lldb) expr
> >1. a[tab]
> >
> > Reason for this was some mixup when we calculate the cursor position. 
> > Obviously we should calculate
> > the offset inside the string by doing 'end - start', but we are doing 
> > 'start - end' (which causes the offset to
> > become -1 which will lead to some out-of-bounds reading).
> >
> > Fixes rdar://51754005
> >
> > I don't see any way to test this as the *multiline* expression completion 
> > is completely untested at the moment
> > and I don't think we have any existing code for testing infrastructure for 
> > it.
> >
> > Reviewers: shafik, davide, labath
> >
> > Reviewed By: labath
> >
> > Subscribers: abidh, lldb-commits, davide, clayborg, labath
> >
> > Tags: #lldb
> >
> > Differential Revision: https://reviews.llvm.org/D64995
> >
> > Added:
> >
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/
> >
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> >
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> >
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
> > Modified:
> >lldb/trunk/source/Core/IOHandler.cpp
> >
> > Added: 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> > URL: 
> > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile?rev=367308=auto
> > ==
> > --- 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> >  (added)
> > +++ 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
> >  Tue Jul 30 05:31:24 2019
> > @@ -0,0 +1,3 @@
> > +LEVEL = ../../make
> > +C_SOURCES := main.c
> > +include $(LEVEL)/Makefile.rules
> >
> > Added: 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> > URL: 
> > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py?rev=367308=auto
> > ==
> > --- 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> >  (added)
> > +++ 
> > lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
> >  Tue Jul 30 05:31:24 2019
> > @@ -0,0 +1,52 @@
> > +"""
> > +Test completion for multiline expressions.
> > +"""
> > +
> > +import lldb
> > +from lldbsuite.test.decorators import *
> > +from lldbsuite.test.lldbtest import *
> > +
> > +class MultilineCompletionTest(TestBase):
> > +
> > +mydir = TestBase.compute_mydir(__file__)
> > +NO_DEBUG_INFO_TESTCASE = True
> > +
> > +def setUp(self):
> > +TestBase.setUp(self)
> > +self.source = 'main.c'
> > +
> > +def expect_string(self, string):
> > +import pexpect
> > +"""This expects for "string", with timeout & EOF being test 
> > fails."""
> > +try:
> > +self.child.expect_exact(string)
> > +except pexpect.EOF:
> > +self.fail("Got EOF waiting for '%s'" % (string))
> > +except pexpect.TIMEOUT:
> > +self.fail("Timed out waiting for '%s'" % (string))
> > +
> > +@expectedFailureAll(
> > +oslist=["windows"],
> > +bugnumber="llvm.org/pr22274: need a pexpect replacement for 
> > windows")
> > +def test_basic_completion(self):
> > +"""Test that we can complete a simple multiline expression"""
> > +self.build()
> > +self.setTearDownCleanup()
> > +
> > +import pexpect
> > +exe = self.getBuildArtifact("a.out")
> > +prompt = "(lldb) "
> > +
> > +run_commands = ' -o "b main" -o "r"'
> > +self.child = pexpect.spawn(
> > +'%s 

Re: [Lldb-commits] [lldb] r366985 - LLGS: fix tracking execve on linux

2019-07-26 Thread Hans Wennborg via lldb-commits
Merged to release_90 in r367128.

On Wed, Jul 24, 2019 at 11:37 PM Pavel Labath via lldb-commits
 wrote:
>
> Author: labath
> Date: Wed Jul 24 23:38:33 2019
> New Revision: 366985
>
> URL: http://llvm.org/viewvc/llvm-project?rev=366985=rev
> Log:
> LLGS: fix tracking execve on linux
>
> Summary:
> Due to a logic error, lldb-server ended up asserting/crashing every time
> the debugged process attempted an execve(). This fixes the error, and
> extends TestExec to work on other platforms too. The "extension"
> consists of avoiding non-standard posix_spawn extensions and using the
> classic execve() call, which should be available on any platform that
> actually supports re-execing. I change the test decorator from
> @skipUnlessDarwin to @skipIfWindows.
>
> Reviewers: clayborg, jasonmolenda
>
> Subscribers: lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D65207
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp
> lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
>
> 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=366985=366984=366985=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
> (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
> Wed Jul 24 23:38:33 2019
> @@ -18,17 +18,17 @@ class ExecTestCase(TestBase):
>
>  mydir = TestBase.compute_mydir(__file__)
>
> -@skipUnlessDarwin
>  @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
>  @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
> bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
> systems
>  @skipIfSanitized # rdar://problem/43756823
> +@skipIfWindows
>  def test_hitting_exec (self):
>  self.do_test(False)
>
> -@skipUnlessDarwin
>  @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
>  @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
> bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
> systems
>  @skipIfSanitized # rdar://problem/43756823
> +@skipIfWindows
>  def test_skipping_exec (self):
>  self.do_test(True)
>
>
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp?rev=366985=366984=366985=diff
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp 
> (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp 
> Wed Jul 24 23:38:33 2019
> @@ -1,76 +1,16 @@
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> +#include 
> +#include 
> +#include 
>  #include 
>  #include 
> +#include 
>
> -static void
> -exit_with_errno (int err, const char *prefix)
> -{
> -if (err)
> -{
> -fprintf (stderr,
> - "%s%s",
> - prefix ? prefix : "",
> - strerror(err));
> -exit (err);
> -}
> -}
> -
> -static pid_t
> -spawn_process (const char *progname,
> -   const char **argv,
> -   const char **envp,
> -   int )
> -{
> -pid_t pid = 0;
> -
> -const posix_spawn_file_actions_t *file_actions = NULL;
> -posix_spawnattr_t attr;
> -err = posix_spawnattr_init ();
> -if (err)
> -return pid;
> -
> -short flags = POSIX_SPAWN_SETEXEC | POSIX_SPAWN_SETSIGDEF | 
> POSIX_SPAWN_SETSIGMASK;
> -err = posix_spawnattr_setflags (, flags);
> -if (err == 0)
> -{
> -// Use the default signal masks
> -sigset_t no_signals;
> -sigset_t all_signals;
> -sigemptyset (_signals);
> -sigfillset (_signals);
> -posix_spawnattr_setsigmask(, _signals);
> -posix_spawnattr_setsigdefault(, _signals);
> -
> -err = posix_spawn (,
> -   progname,
> -   file_actions,
> -   ,
> -   (char * const *)argv,
> -   (char * const *)envp);
> -
> -posix_spawnattr_destroy();
> -}
> -return pid;
> -}
> -
> -int
> -main (int argc, char const **argv)
> -{
> -char *buf = (char*) malloc (strlen (argv[0]) + 12);
> -strlcpy (buf, argv[0], strlen (argv[0]) + 1);
> -std::string directory_name (::dirname (buf));
> -
> -std::string other_program = directory_name + "/secondprog";
> -  

Re: [Lldb-commits] [lldb] r366433 - [CMake] Always build debugserver on Darwin and allow tests to use the system's one

2019-07-19 Thread Hans Wennborg via lldb-commits
Okay, merged in r366553.


On Thu, Jul 18, 2019 at 3:38 PM Stefan Gränitz
 wrote:
>
> Hello Hans
>
> This commit would be very good to have on release/9.x. It simplifies a lot of 
> code in the code-sign and testing logic for LLDB on Darwin. This would be 
> useful for people who build their own LLDB's from upstream.
> I was testing more comprehensively then usual and, thus, just missed the 
> branch point.
>
> Best
> Stefan
>
>  Forwarded Message 
> Subject: [Lldb-commits] [lldb] r366433 - [CMake] Always build debugserver on 
> Darwin and allow tests to use the system's one
> Date: Thu, 18 Jul 2019 13:30:37 -
> From: Stefan Granitz via lldb-commits 
> Reply-To: Stefan Granitz 
> To: lldb-commits@lists.llvm.org
>
>
> Author: stefan.graenitz
> Date: Thu Jul 18 06:30:37 2019
> New Revision: 366433
>
> URL: http://llvm.org/viewvc/llvm-project?rev=366433=rev
> Log:
> [CMake] Always build debugserver on Darwin and allow tests to use the 
> system's one
>
> Summary:
> We can always build debugserver, but we can't always sign it to be useable 
> for testing. `LLDB_USE_SYSTEM_DEBUGSERVER` should only tell whether or not 
> the system debugserver should be used for testing.
> The old behavior complicated the logic around debugserver a lot. The new 
> logic sorts out most of it.
>
> Please note that this patch is in early stage and needs some more testing. It 
> should not affect platfroms other than Darwin. It builds on Davide's approach 
> to validate the code-signing identity at configuration time.
>
> What do you think?
>
> Reviewers: xiaobai, JDevlieghere, davide, compnerd, friss, labath, mgorny, 
> jasonmolenda
>
> Reviewed By: JDevlieghere
>
> Subscribers: lldb-commits, #lldb
>
> Tags: #lldb
>
> Differential Revision: https://reviews.llvm.org/D64806
>
> Modified:
> lldb/trunk/CMakeLists.txt
> lldb/trunk/cmake/modules/AddLLDB.cmake
> lldb/trunk/cmake/modules/LLDBConfig.cmake
> lldb/trunk/test/CMakeLists.txt
> lldb/trunk/tools/debugserver/source/CMakeLists.txt
> lldb/trunk/unittests/CMakeLists.txt
> lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
>
> Modified: lldb/trunk/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=366433=366432=366433=diff
> ==
> --- lldb/trunk/CMakeLists.txt (original)
> +++ lldb/trunk/CMakeLists.txt Thu Jul 18 06:30:37 2019
> @@ -107,10 +107,6 @@ if(LLDB_INCLUDE_TESTS)
> list(APPEND LLDB_TEST_DEPS lldb-server)
> endif()
> - if(TARGET debugserver)
> - list(APPEND LLDB_TEST_DEPS debugserver)
> - endif()
> -
> if(TARGET lldb-mi)
> list(APPEND LLDB_TEST_DEPS lldb-mi)
> endif()
>
> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=366433=366432=366433=diff
> ==
> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Jul 18 06:30:37 2019
> @@ -276,3 +276,27 @@ function(lldb_setup_rpaths name)
> INSTALL_RPATH "${LIST_INSTALL_RPATH}"
> )
> endfunction()
> +
> +function(lldb_find_system_debugserver path)
> + execute_process(COMMAND xcode-select -p
> + RESULT_VARIABLE exit_code
> + OUTPUT_VARIABLE xcode_dev_dir
> + ERROR_VARIABLE error_msg
> + OUTPUT_STRIP_TRAILING_WHITESPACE)
> + if(exit_code)
> + message(WARNING "`xcode-select -p` failed:\n${error_msg}")
> + else()
> + set(subpath "LLDB.framework/Resources/debugserver")
> + set(path_shared "${xcode_dev_dir}/../SharedFrameworks/${subpath}")
> + set(path_private "${xcode_dev_dir}/Library/PrivateFrameworks/${subpath}")
> +
> + if(EXISTS ${path_shared})
> + set(${path} ${path_shared} PARENT_SCOPE)
> + elseif(EXISTS ${path_private})
> + set(${path} ${path_private} PARENT_SCOPE)
> + else()
> + message(WARNING "System debugserver requested, but not found. "
> + "Candidates don't exist: ${path_shared}\n${path_private}")
> + endif()
> + endif()
> +endfunction()
>
> Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=366433=366432=366433=diff
> ==
> --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
> +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Jul 18 06:30:37 2019
> @@ -50,6 +50,7 @@ option(LLDB_USE_SYSTEM_SIX "Use six.py s
> option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if 
> available" ON)
> option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
> option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in 
> binaries" OFF)
> +option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing 
> (Darwin only)." OFF)
> if(LLDB_BUILD_FRAMEWORK)
> if(NOT APPLE)
>
> Modified: lldb/trunk/test/CMakeLists.txt
> URL: 
> 

[Lldb-commits] [lldb] r360024 - Revert r359949 "[clang] adding explicit(bool) from c++2a"

2019-05-06 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Mon May  6 02:51:10 2019
New Revision: 360024

URL: http://llvm.org/viewvc/llvm-project?rev=360024=rev
Log:
Revert r359949 "[clang] adding explicit(bool) from c++2a"

This caused Clang to start erroring on the following:

  struct S {
    template  explicit S();
  };

  struct T : S {};

  struct U : T {
    U();
  };
  U::U() {}

  $ clang -c /tmp/x.cc
  /tmp/x.cc:10:4: error: call to implicitly-deleted default constructor of 'T'
  U::U() {}
     ^
  /tmp/x.cc:5:12: note: default constructor of 'T' is implicitly deleted
because base class 'S' has no default constructor
  struct T : S {};
             ^
  1 error generated.

See discussion on the cfe-commits email thread.

This also reverts the follow-ups r359966 and r359968.

> this patch adds support for the explicit bool specifier.
>
> Changes:
> - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp.
> - The storage of the explicit specifier was changed. the explicit specifier 
> was stored as a boolean value in the FunctionDeclBitfields and in the 
> DeclSpec class. now it is stored as a PointerIntPair with a flag 
> and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, 
> CXXConversionDecl and in the DeclSpec class.
> - Following the AST change, Serialization, ASTMatchers, ASTComparator and 
> ASTPrinter were adapted.
> - Template instantiation was adapted to instantiate the potential expressions 
> of the explicit(bool) specifier When instantiating their associated 
> declaration.
> - The Add*Candidate functions were adapted, they now take a Boolean 
> indicating if the context allowing explicit constructor or conversion 
> function and this boolean is used to remove invalid overloads that required 
> template instantiation to be detected.
> - Test for Semantic and Serialization were added.
>
> This patch is not yet complete. I still need to check that interaction with 
> CTAD and deduction guides is correct. and add more tests for AST operations. 
> But I wanted first feedback.
> Perhaps this patch should be spited in smaller patches, but making each patch 
> testable as a standalone may be tricky.
>
> Patch by Tyker
>
> Differential Revision: https://reviews.llvm.org/D60934

Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=360024=360023=360024=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon May  6 02:51:10 2019
@@ -8167,10 +8167,6 @@ clang::CXXMethodDecl *ClangASTContext::A
   if (is_artificial)
 return nullptr; // skip everything artificial
 
-  const clang::ExplicitSpecifier explicit_spec(
-  nullptr /*expr*/, is_explicit
-? clang::ExplicitSpecKind::ResolvedTrue
-: clang::ExplicitSpecKind::ResolvedFalse);
   if (name[0] == '~') {
 cxx_dtor_decl = clang::CXXDestructorDecl::Create(
 *getASTContext(), cxx_record_decl, clang::SourceLocation(),
@@ -8189,7 +8185,7 @@ clang::CXXMethodDecl *ClangASTContext::A
 clang::SourceLocation()),
 method_qual_type,
 nullptr, // TypeSourceInfo *
-explicit_spec, is_inline, is_artificial, false /*is_constexpr*/);
+is_explicit, is_inline, is_artificial, false /*is_constexpr*/);
 cxx_method_decl = cxx_ctor_decl;
   } else {
 clang::StorageClass SC = is_static ? clang::SC_Static : clang::SC_None;
@@ -8224,7 +8220,7 @@ clang::CXXMethodDecl *ClangASTContext::A
 clang::SourceLocation()),
 method_qual_type,
 nullptr, // TypeSourceInfo *
-is_inline, explicit_spec, false /*is_constexpr*/,
+is_inline, is_explicit, false /*is_constexpr*/,
 clang::SourceLocation());
   }
 }


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


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

2019-02-18 Thread Hans Wennborg via lldb-commits
Merged to release_80 in r354255.

On Fri, Feb 15, 2019 at 1:12 PM Michal Gorny via lldb-commits
 wrote:
>
> Author: mgorny
> Date: Fri Feb 15 04:13:02 2019
> New Revision: 354122
>
> URL: http://llvm.org/viewvc/llvm-project?rev=354122=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=354121=354122=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=354121=354122=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(_mask);
> +  ASSERT_EQ(0, sigaction(SIGUSR2, , 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 mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2019-02-18 Thread Hans Wennborg via lldb-commits
Merged to release_80 in r354254.

On Thu, Feb 14, 2019 at 2:51 PM Michal Gorny via lldb-commits
 wrote:
>
> Author: mgorny
> Date: Thu Feb 14 05:52:31 2019
> New Revision: 354029
>
> URL: http://llvm.org/viewvc/llvm-project?rev=354029=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=354028=354029=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 mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r353642 - lldb: Fix compilation on OpenBSD

2019-02-18 Thread Hans Wennborg via lldb-commits
Merged to release_80 in r354253.

On Sun, Feb 10, 2019 at 4:23 PM Raphael Isemann via lldb-commits
 wrote:
>
> Author: teemperor
> Date: Sun Feb 10 07:23:58 2019
> New Revision: 353642
>
> URL: http://llvm.org/viewvc/llvm-project?rev=353642=rev
> Log:
> lldb: Fix compilation on OpenBSD
>
> Summary: Update the OpenBSD Host.cpp for the new SetFile() function 
> signature. Fixes compiling lldb on OpenBSD.
>
> Reviewers: krytarowski
>
> Reviewed By: krytarowski
>
> Subscribers: lldb-commits
>
> Tags: #lldb
>
> Differential Revision: https://reviews.llvm.org/D57907
>
> Modified:
> lldb/trunk/source/Host/openbsd/Host.cpp
>
> Modified: lldb/trunk/source/Host/openbsd/Host.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/openbsd/Host.cpp?rev=353642=353641=353642=diff
> ==
> --- lldb/trunk/source/Host/openbsd/Host.cpp (original)
> +++ lldb/trunk/source/Host/openbsd/Host.cpp Sun Feb 10 07:23:58 2019
> @@ -67,8 +67,7 @@ GetOpenBSDProcessArgs(const ProcessInsta
>
>cstr = data.GetCStr();
>if (cstr) {
> -process_info.GetExecutableFile().SetFile(cstr, false,
> - FileSpec::Style::native);
> +process_info.GetExecutableFile().SetFile(cstr, 
> FileSpec::Style::native);
>
>  if (!(match_info_ptr == NULL ||
>NameMatches(
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2019-01-24 Thread Hans Wennborg via lldb-commits
Merged to 8.0 in r352134. Please let me know if there are any follow-ups.

Thanks,
Hans

On Thu, Jan 24, 2019 at 2:20 PM Michal Gorny via lldb-commits
 wrote:
>
> Author: mgorny
> Date: Thu Jan 24 14:20:47 2019
> New Revision: 352116
>
> URL: http://llvm.org/viewvc/llvm-project?rev=352116=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=352115=352116=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 mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r351327 - Revert "Simplify Value::GetValueByteSize()"

2019-01-16 Thread Hans Wennborg via lldb-commits
Merged to the 8 branch in r351342.

On Wed, Jan 16, 2019 at 1:23 PM Pavel Labath via lldb-commits
 wrote:
>
> Author: labath
> Date: Wed Jan 16 04:19:22 2019
> New Revision: 351327
>
> URL: http://llvm.org/viewvc/llvm-project?rev=351327=rev
> Log:
> Revert "Simplify Value::GetValueByteSize()"
>
> This reverts commit r351250 because it breaks the
> SymbolFile/NativePDB/function-types-builtins.cpp.
>
> Modified:
> lldb/trunk/source/Core/Value.cpp
>
> Modified: lldb/trunk/source/Core/Value.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=351327=351326=351327=diff
> ==
> --- lldb/trunk/source/Core/Value.cpp (original)
> +++ lldb/trunk/source/Core/Value.cpp Wed Jan 16 04:19:22 2019
> @@ -210,31 +210,35 @@ bool Value::ValueOf(ExecutionContext *ex
>  }
>
>  uint64_t Value::GetValueByteSize(Status *error_ptr, ExecutionContext 
> *exe_ctx) {
> +  uint64_t byte_size = 0;
> +
>switch (m_context_type) {
>case eContextTypeRegisterInfo: // RegisterInfo *
> -if (GetRegisterInfo()) {
> -  if (error_ptr)
> -error_ptr->Clear();
> -  return GetRegisterInfo()->byte_size;
> -}
> +if (GetRegisterInfo())
> +  byte_size = GetRegisterInfo()->byte_size;
>  break;
>
>case eContextTypeInvalid:
>case eContextTypeLLDBType: // Type *
>case eContextTypeVariable: // Variable *
>{
> -auto *scope = exe_ctx ? exe_ctx->GetBestExecutionContextScope() : 
> nullptr;
> -if (llvm::Optional size = 
> GetCompilerType().GetByteSize(scope)) {
> -  if (error_ptr)
> -error_ptr->Clear();
> -  return *size;
> -}
> -break;
> +const CompilerType _type = GetCompilerType();
> +if (ast_type.IsValid())
> +  if (llvm::Optional size = ast_type.GetByteSize(
> +  exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr))
> +byte_size = *size;
> +  } break;
>}
> +
> +  if (error_ptr) {
> +if (byte_size == 0) {
> +  if (error_ptr->Success())
> +error_ptr->SetErrorString("Unable to determine byte size.");
> +} else {
> +  error_ptr->Clear();
> +}
>}
> -  if (error_ptr && error_ptr->Success())
> -error_ptr->SetErrorString("Unable to determine byte size.");
> -  return 0;
> +  return byte_size;
>  }
>
>  const CompilerType ::GetCompilerType() {
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r347758 - Revert r347673 "Catch up with EvaluateAsInt() clang API change."

2018-11-28 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Wed Nov 28 06:30:18 2018
New Revision: 347758

URL: http://llvm.org/viewvc/llvm-project?rev=347758=rev
Log:
Revert r347673 "Catch up with EvaluateAsInt() clang API change."

r347417 was re-committed in Clang.

Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=347758=347757=347758=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Nov 28 06:30:18 2018
@@ -5965,10 +5965,10 @@ GetObjCFieldAtIndex(clang::ASTContext *a
 
 if (is_bitfield && ast) {
   clang::Expr *bitfield_bit_size_expr = ivar_pos->getBitWidth();
-  llvm::APSInt bitfield_apsint;
+  clang::Expr::EvalResult result;
   if (bitfield_bit_size_expr &&
-  bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint,
-*ast)) {
+  bitfield_bit_size_expr->EvaluateAsInt(result, *ast)) {
+llvm::APSInt bitfield_apsint = result.Val.getInt();
 *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
   }
 }
@@ -6025,10 +6025,11 @@ CompilerType ClangASTContext::GetFieldAt
 
 if (is_bitfield) {
   clang::Expr *bitfield_bit_size_expr = field->getBitWidth();
-  llvm::APSInt bitfield_apsint;
+  clang::Expr::EvalResult result;
   if (bitfield_bit_size_expr &&
-  bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint,
+  bitfield_bit_size_expr->EvaluateAsInt(result,
 *getASTContext())) {
+llvm::APSInt bitfield_apsint = result.Val.getInt();
 *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
   }
 }


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


Re: [Lldb-commits] [lldb] r339076 - [lit, python] Always add quotes around the python path in lit

2018-08-14 Thread Hans Wennborg via lldb-commits
Merged to 7.0 in r339657.

On Tue, Aug 7, 2018 at 12:37 AM, Stella Stamenova via lldb-commits
 wrote:
> Author: stella.stamenova
> Date: Mon Aug  6 15:37:53 2018
> New Revision: 339076
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339076=rev
> Log:
> [lit, python] Always add quotes around the python path in lit
>
> Summary:
> The issue with the python path is that the path to python on Windows can 
> contain spaces. To make the tests always work, the path to python needs to be 
> surrounded by quotes.
>
> This is a companion change to: https://reviews.llvm.org/D50206
>
> Reviewers: asmith, zturner
>
> Differential Revision: https://reviews.llvm.org/D50280
>
> 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=339076=339075=339076=diff
> ==
> --- lldb/trunk/lit/lit.cfg (original)
> +++ lldb/trunk/lit/lit.cfg Mon Aug  6 15:37:53 2018
> @@ -54,7 +54,7 @@ config.environment['LLVM_SRC_ROOT'] = ge
>  config.environment['PYTHON_EXECUTABLE'] = getattr(config, 
> 'python_executable', '')
>
>  # Register substitutions
> -config.substitutions.append(('%python', config.python_executable))
> +config.substitutions.append(('%python', "'%s'" % (config.python_executable)))
>
>  debugserver = lit.util.which('debugserver', lldb_tools_dir)
>  lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r338949 - Fix a bug in VMRange

2018-08-07 Thread Hans Wennborg via lldb-commits
Merged to 7.0 in r339107.

On Sat, Aug 4, 2018 at 4:15 AM, Leonard Mosescu via lldb-commits
 wrote:
> Author: lemo
> Date: Fri Aug  3 19:15:26 2018
> New Revision: 338949
>
> URL: http://llvm.org/viewvc/llvm-project?rev=338949=rev
> Log:
> Fix a bug in VMRange
>
> I noticed a suspicious failure:
>
> [ RUN ] VMRange.CollectionContains
> llvm/src/tools/lldb/unittests/Utility/VMRangeTest.cpp:146: Failure
> Value of: VMRange::ContainsRange(collection, VMRange(0x100, 0x104))
>
> Actual: false
> Expected: true
>
> Looking at the code, it is a very real bug:
>
> class RangeInRangeUnaryPredicate {
> public:
>   RangeInRangeUnaryPredicate(VMRange range) : _range(range) {} // note that 
> _range binds to a temporary!
>   bool operator()(const VMRange ) const {
> return range.Contains(_range);
>   }
>   const VMRange &_range;
> };
>
> This change fixes the bug.
>
> Differential Revision: https://reviews.llvm.org/D50290
>
>
> Modified:
> lldb/trunk/include/lldb/Utility/VMRange.h
> lldb/trunk/source/Utility/VMRange.cpp
>
> Modified: lldb/trunk/include/lldb/Utility/VMRange.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/VMRange.h?rev=338949=338948=338949=diff
> ==
> --- lldb/trunk/include/lldb/Utility/VMRange.h (original)
> +++ lldb/trunk/include/lldb/Utility/VMRange.h Fri Aug  3 19:15:26 2018
> @@ -87,24 +87,6 @@ public:
>void Dump(Stream *s, lldb::addr_t base_addr = 0,
>  uint32_t addr_width = 8) const;
>
> -  class ValueInRangeUnaryPredicate {
> -  public:
> -ValueInRangeUnaryPredicate(lldb::addr_t value) : _value(value) {}
> -bool operator()(const VMRange ) const {
> -  return range.Contains(_value);
> -}
> -lldb::addr_t _value;
> -  };
> -
> -  class RangeInRangeUnaryPredicate {
> -  public:
> -RangeInRangeUnaryPredicate(VMRange range) : _range(range) {}
> -bool operator()(const VMRange ) const {
> -  return range.Contains(_range);
> -}
> -const VMRange &_range;
> -  };
> -
>static bool ContainsValue(const VMRange::collection ,
>  lldb::addr_t value);
>
>
> Modified: lldb/trunk/source/Utility/VMRange.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/VMRange.cpp?rev=338949=338948=338949=diff
> ==
> --- lldb/trunk/source/Utility/VMRange.cpp (original)
> +++ lldb/trunk/source/Utility/VMRange.cpp Fri Aug  3 19:15:26 2018
> @@ -24,14 +24,16 @@ using namespace lldb_private;
>
>  bool VMRange::ContainsValue(const VMRange::collection ,
>  lldb::addr_t value) {
> -  ValueInRangeUnaryPredicate in_range_predicate(value);
> -  return llvm::find_if(coll, in_range_predicate) != coll.end();
> +  return llvm::find_if(coll, [&](const VMRange ) {
> +   return r.Contains(value);
> + }) != coll.end();
>  }
>
>  bool VMRange::ContainsRange(const VMRange::collection ,
>  const VMRange ) {
> -  RangeInRangeUnaryPredicate in_range_predicate(range);
> -  return llvm::find_if(coll, in_range_predicate) != coll.end();
> +  return llvm::find_if(coll, [&](const VMRange ) {
> +   return r.Contains(range);
> + }) != coll.end();
>  }
>
>  void VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) 
> const {
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r324234 - Fix a crash in *NetBSD::Factory::Launch

2018-02-06 Thread Hans Wennborg via lldb-commits
Merged to 6.0 in r324327.

On Mon, Feb 5, 2018 at 2:16 PM, Kamil Rytarowski via lldb-commits
 wrote:
> Author: kamil
> Date: Mon Feb  5 05:16:22 2018
> New Revision: 324234
>
> URL: http://llvm.org/viewvc/llvm-project?rev=324234=rev
> Log:
> Fix a crash in *NetBSD::Factory::Launch
>
> Summary:
> We cannot call process_up->SetState() inside
> the NativeProcessNetBSD::Factory::Launch
> function because it triggers a NULL pointer
> deference.
>
> The generic code for launching a process in:
> GDBRemoteCommunicationServerLLGS::LaunchProcess
> sets the m_debugged_process_up pointer after
> a successful call to  m_process_factory.Launch().
> If we attempt to call process_up->SetState()
> inside a platform specific Launch function we
> end up dereferencing a NULL pointer in
> NativeProcessProtocol::GetCurrentThreadID().
>
> Use the proper call process_up->SetState(,false)
> that sets notify_delegates to false.
>
> Sponsored by 
>
> Reviewers: labath, joerg
>
> Reviewed By: labath
>
> Subscribers: lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D42868
>
> 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=324234=324233=324234=diff
> ==
> --- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp 
> (original)
> +++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Mon Feb  
> 5 05:16:22 2018
> @@ -113,7 +113,7 @@ NativeProcessNetBSD::Factory::Launch(Pro
>
>for (const auto  : process_up->m_threads)
>  static_cast(*thread).SetStoppedBySignal(SIGSTOP);
> -  process_up->SetState(StateType::eStateStopped);
> +  process_up->SetState(StateType::eStateStopped, false);
>
>return std::move(process_up);
>  }
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r324251 - Sync PlatformNetBSD.cpp with Linux

2018-02-06 Thread Hans Wennborg via lldb-commits
Merged to 6.0 in r324326.

On Mon, Feb 5, 2018 at 6:12 PM, Kamil Rytarowski via lldb-commits
 wrote:
> Author: kamil
> Date: Mon Feb  5 09:12:23 2018
> New Revision: 324251
>
> URL: http://llvm.org/viewvc/llvm-project?rev=324251=rev
> Log:
> Sync PlatformNetBSD.cpp with Linux
>
> Summary:
> Various changes in logging from log->Printf() to generic LLDB_LOG().
>
> Sponsored by 
>
> Reviewers: labath, joerg
>
> Reviewed By: labath
>
> Subscribers: llvm-commits, lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D42912
>
> Modified:
> lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
>
> Modified: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp?rev=324251=324250=324251=diff
> ==
> --- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp (original)
> +++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Mon Feb  5 
> 09:12:23 2018
> @@ -45,19 +45,9 @@ static uint32_t g_initialize_count = 0;
>
>  PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) {
>Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
> -  if (log) {
> -const char *arch_name;
> -if (arch && arch->GetArchitectureName())
> -  arch_name = arch->GetArchitectureName();
> -else
> -  arch_name = "";
> -
> -const char *triple_cstr =
> -arch ? arch->GetTriple().getTriple().c_str() : "";
> -
> -log->Printf("PlatformNetBSD::%s(force=%s, arch={%s,%s})", __FUNCTION__,
> -force ? "true" : "false", arch_name, triple_cstr);
> -  }
> +  LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force,
> +   arch ? arch->GetArchitectureName() : "",
> +   arch ? arch->GetTriple().getTriple() : "");
>
>bool create = force;
>if (create == false && arch && arch->IsValid()) {
> @@ -72,18 +62,10 @@ PlatformSP PlatformNetBSD::CreateInstanc
>  }
>}
>
> +  LLDB_LOG(log, "create = {0}", create);
>if (create) {
> -if (log)
> -  log->Printf("PlatformNetBSD::%s() creating remote-netbsd platform",
> -  __FUNCTION__);
>  return PlatformSP(new PlatformNetBSD(false));
>}
> -
> -  if (log)
> -log->Printf(
> -"PlatformNetBSD::%s() aborting creation of remote-netbsd platform",
> -__FUNCTION__);
> -
>return PlatformSP();
>  }
>
> @@ -258,19 +240,15 @@ bool PlatformNetBSD::CanDebugProcess() {
>  }
>
>  // For local debugging, NetBSD will override the debug logic to use 
> llgs-launch
> -// rather than
> -// lldb-launch, llgs-attach.  This differs from current lldb-launch,
> -// debugserver-attach
> -// approach on MacOSX.
> -lldb::ProcessSP PlatformNetBSD::DebugProcess(
> -ProcessLaunchInfo _info, Debugger ,
> -Target *target, // Can be NULL, if NULL create a new
> -// target, else use existing one
> -Status ) {
> +// rather than lldb-launch, llgs-attach.  This differs from current 
> lldb-launch,
> +// debugserver-attach approach on MacOSX.
> +lldb::ProcessSP
> +PlatformNetBSD::DebugProcess(ProcessLaunchInfo _info, Debugger 
> ,
> + Target *target, // Can be NULL, if NULL create 
> a new
> + // target, else use existing one
> + Status ) {
>Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
> -  if (log)
> -log->Printf("PlatformNetBSD::%s entered (target %p)", __FUNCTION__,
> -static_cast(target));
> +  LLDB_LOG(log, "target {0}", target);
>
>// If we're a remote host, use standard behavior from parent class.
>if (!IsHost())
> @@ -293,61 +271,42 @@ lldb::ProcessSP PlatformNetBSD::DebugPro
>
>// Ensure we have a target.
>if (target == nullptr) {
> -if (log)
> -  log->Printf("PlatformNetBSD::%s creating new target", __FUNCTION__);
> -
> +LLDB_LOG(log, "creating new target");
>  TargetSP new_target_sp;
>  error = debugger.GetTargetList().CreateTarget(debugger, "", "", false,
>nullptr, new_target_sp);
>  if (error.Fail()) {
> -  if (log)
> -log->Printf("PlatformNetBSD::%s failed to create new target: %s",
> -__FUNCTION__, error.AsCString());
> +  LLDB_LOG(log, "failed to create new target: {0}", error);
>return process_sp;
>  }
>
>  target = new_target_sp.get();
>  if (!target) {
>error.SetErrorString("CreateTarget() returned nullptr");
> -  if (log)
> -log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__,
> -error.AsCString());
> +  LLDB_LOG(log, "error: {0}", error);
>return process_sp;
>  }
> -  } else {
> -if (log)
> -  log->Printf("PlatformNetBSD::%s using provided target", 

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

2018-01-18 Thread Hans Wennborg via lldb-commits
Merged to 6.0 in r322833.

On Tue, Jan 9, 2018 at 3:44 PM, Michal Gorny via lldb-commits
 wrote:
> Author: mgorny
> Date: Tue Jan  9 06:44:04 2018
> New Revision: 322081
>
> URL: http://llvm.org/viewvc/llvm-project?rev=322081=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=322080=322081=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=322080=322081=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 mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2018-01-18 Thread Hans Wennborg via lldb-commits
Merged to 6.0 in r322832.

On Sat, Jan 6, 2018 at 11:20 AM, Michal Gorny via lldb-commits
 wrote:
> Author: mgorny
> Date: Sat Jan  6 02:20:25 2018
> New Revision: 321932
>
> URL: http://llvm.org/viewvc/llvm-project?rev=321932=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=321931=321932=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 mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r312008 - [IPv6] Fix a bug in the IPv6 listen behavior

2017-08-29 Thread Hans Wennborg via lldb-commits
Merged to 5.0 in r312016.

On Tue, Aug 29, 2017 at 9:13 AM, Chris Bieneman via lldb-commits
 wrote:
> Author: cbieneman
> Date: Tue Aug 29 09:13:41 2017
> New Revision: 312008
>
> URL: http://llvm.org/viewvc/llvm-project?rev=312008=rev
> Log:
> [IPv6] Fix a bug in the IPv6 listen behavior
>
> The socket bind address should either be localhost or anyaddress. This bug in 
> the listen behavior was preventing lldb-server from opening sockets for 
> non-localhost connections.
>
> The added test verifies that opening an anyaddress socket works and has a 
> non-zero port assignment.
>
> This should resolve PR34183.
>
> Modified:
> lldb/trunk/source/Host/common/TCPSocket.cpp
> lldb/trunk/unittests/Host/SocketTest.cpp
>
> Modified: lldb/trunk/source/Host/common/TCPSocket.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=312008=312007=312008=diff
> ==
> --- lldb/trunk/source/Host/common/TCPSocket.cpp (original)
> +++ lldb/trunk/source/Host/common/TCPSocket.cpp Tue Aug 29 09:13:41 2017
> @@ -198,9 +198,14 @@ Status TCPSocket::Listen(llvm::StringRef
>  ::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, option_value_p,
>   sizeof(option_value));
>
> -address.SetPort(port);
> +SocketAddress listen_address = address;
> +if(!listen_address.IsLocalhost())
> +  listen_address.SetToAnyAddress(address.GetFamily(), port);
> +else
> +  listen_address.SetPort(port);
>
> -int err = ::bind(fd, (), address.GetLength());
> +int err =
> +::bind(fd, _address.sockaddr(), listen_address.GetLength());
>  if (-1 != err)
>err = ::listen(fd, backlog);
>
>
> Modified: lldb/trunk/unittests/Host/SocketTest.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=312008=312007=312008=diff
> ==
> --- lldb/trunk/unittests/Host/SocketTest.cpp (original)
> +++ lldb/trunk/unittests/Host/SocketTest.cpp Tue Aug 29 09:13:41 2017
> @@ -220,3 +220,14 @@ TEST_F(SocketTest, UDPConnect) {
>EXPECT_TRUE(error.Success());
>EXPECT_TRUE(socket_up->IsValid());
>  }
> +
> +TEST_F(SocketTest, TCPListen0GetPort) {
> +  Socket *server_socket;
> +  Predicate port_predicate;
> +  port_predicate.SetValue(0, eBroadcastNever);
> +  Status err =
> +  Socket::TcpListen("10.10.12.3:0", false, server_socket, 
> _predicate);
> +  std::unique_ptr socket_up((TCPSocket*)server_socket);
> +  EXPECT_TRUE(socket_up->IsValid());
> +  EXPECT_NE(socket_up->GetLocalPortNumber(), 0);
> +}
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r311579 - Process: fix FXSAVE on x86

2017-08-23 Thread Hans Wennborg via lldb-commits
Merged in r311585. Thanks!

On Wed, Aug 23, 2017 at 11:02 AM, Greg Clayton  wrote:
> Fine with me.
>
> On Aug 23, 2017, at 10:47 AM, Saleem Abdulrasool 
> wrote:
>
> This would be nice to merge to 5.0 IMO.  It fixes reading the x87 FPU state.
> What do you think Greg?
>
> On Wed, Aug 23, 2017 at 10:24 AM Saleem Abdulrasool via lldb-commits
>  wrote:
>>
>> Author: compnerd
>> Date: Wed Aug 23 10:23:12 2017
>> New Revision: 311579
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=311579=rev
>> Log:
>> Process: fix FXSAVE on x86
>>
>> The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit)
>> instead of the correct width (16-bit) as per the x87 Programmer's
>> Manual.  Adjust this to ensure that we print out the complete value for
>> the register.
>>
>> Modified:
>>
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
>>
>> lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
>> lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h
>>
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=311579=311578=311579=diff
>>
>> ==
>> ---
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
>> (original)
>> +++
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
>> Wed Aug 23 10:23:12 2017
>> @@ -256,7 +256,7 @@ class RegisterCommandsTestCase(TestBase)
>>  self.expect(
>>  "register read ftag", substrs=[
>>  'ftag' + ' = ', str(
>> -"0x%0.2x" %
>> +"0x%0.4x" %
>>  (reg_value_ftag_initial | (
>>  1 << fstat_top_pointer_initial)))])
>>  reg_value_ftag_initial = reg_value_ftag_initial | (
>>
>> Modified:
>> lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp?rev=311579=311578=311579=diff
>>
>> ==
>> ---
>> lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
>> (original)
>> +++
>> lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp Wed
>> Aug 23 10:23:12 2017
>> @@ -36,8 +36,7 @@ struct GPR {
>>  struct FPR_i386 {
>>uint16_t fctrl; // FPU Control Word (fcw)
>>uint16_t fstat; // FPU Status Word (fsw)
>> -  uint8_t ftag;   // FPU Tag Word (ftw)
>> -  uint8_t reserved_1; // Reserved
>> +  uint16_t ftag;  // FPU Tag Word (ftw)
>>uint16_t fop;   // Last Instruction Opcode (fop)
>>union {
>>  struct {
>>
>> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h?rev=311579=311578=311579=diff
>>
>> ==
>> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h
>> (original)
>> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h Wed
>> Aug 23 10:23:12 2017
>> @@ -257,8 +257,7 @@ struct XMMReg {
>>  struct FXSAVE {
>>uint16_t fctrl; // FPU Control Word (fcw)
>>uint16_t fstat; // FPU Status Word (fsw)
>> -  uint8_t ftag;   // FPU Tag Word (ftw)
>> -  uint8_t reserved_1; // Reserved
>> +  uint16_t ftag;  // FPU Tag Word (ftw)
>>uint16_t fop;   // Last Instruction Opcode (fop)
>>union {
>>  struct {
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r294019 - Push down more common code into PlatformPOSIX

2017-02-03 Thread Hans Wennborg via lldb-commits
Sorry for the noise, I must have gotten the numbers wrong somehow.

On Fri, Feb 3, 2017 at 1:59 PM, Geoff Berry  wrote:
> Hans,
>
> Sorry for the confusion, but this isn't the change I was referring to.  I
> included the phabricator review numbers in my original message, not svn
> commit numbers.
>
>
>
> On 2/3/2017 4:54 PM, Hans Wennborg wrote:
>>
>> Geoff asked for this to be merged to 4.0. It looks like a nice change,
>> but I'm a little hesitant since it doesn't look like it's fixing a
>> regression. Pavel, what do you think?
>>
>> On Fri, Feb 3, 2017 at 9:42 AM, Pavel Labath via lldb-commits
>>  wrote:
>>>
>>> Author: labath
>>> Date: Fri Feb  3 11:42:04 2017
>>> New Revision: 294019
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=294019=rev
>>> Log:
>>> Push down more common code into PlatformPOSIX
>>>
>>> Summary:
>>> - GetFileWithUUID: All platforms except PlatformDarwin had this.
>>> However, I see no reason why this code would not apply there as well.
>>>
>>> - GetProcessInfo, FindProcesses: The implementation was the same in all
>>> classes.
>>>
>>> - GetFullNameForDylib: This code should apply to all non-darwin
>>> platforms. I've kept the PlatformDarwin override as the situation is
>>> different there.
>>>
>>> Reviewers: clayborg, krytarowski, emaste
>>>
>>> Subscribers: lldb-commits
>>>
>>> Differential Revision: https://reviews.llvm.org/D29496
>
>
> --
> Geoff Berry
> Employee of Qualcomm Datacenter Technologies, Inc.
>  Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
> Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the Code
> Aurora Forum, a Linux Foundation Collaborative Project.
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r294019 - Push down more common code into PlatformPOSIX

2017-02-03 Thread Hans Wennborg via lldb-commits
Geoff asked for this to be merged to 4.0. It looks like a nice change,
but I'm a little hesitant since it doesn't look like it's fixing a
regression. Pavel, what do you think?

On Fri, Feb 3, 2017 at 9:42 AM, Pavel Labath via lldb-commits
 wrote:
> Author: labath
> Date: Fri Feb  3 11:42:04 2017
> New Revision: 294019
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294019=rev
> Log:
> Push down more common code into PlatformPOSIX
>
> Summary:
> - GetFileWithUUID: All platforms except PlatformDarwin had this.
> However, I see no reason why this code would not apply there as well.
>
> - GetProcessInfo, FindProcesses: The implementation was the same in all 
> classes.
>
> - GetFullNameForDylib: This code should apply to all non-darwin
> platforms. I've kept the PlatformDarwin override as the situation is
> different there.
>
> Reviewers: clayborg, krytarowski, emaste
>
> Subscribers: lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D29496
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r277117 - Fix -break-insert not working when using absolute paths (MI)

2016-08-16 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Mon, Aug 8, 2016 at 1:38 PM, Hans Wennborg  wrote:
> Greg: ping?
>
> On Wed, Aug 3, 2016 at 9:06 AM, Hans Wennborg  wrote:
>> For LLDB, I think it's up to Greg to decide.
>>
>> On Tue, Aug 2, 2016 at 10:20 PM, Ilia K  wrote:
>>> Hi Hans!
>>>
>>> The author of this commit asks me is there a chance to include this changes
>>> to 3.9 release? I'm not sure about our policy when RC has already been
>>> tagged.
>>>
>>> On Fri, Jul 29, 2016 at 9:01 AM, Ilia K via lldb-commits
>>>  wrote:

 Author: ki.stfu
 Date: Fri Jul 29 01:01:20 2016
 New Revision: 277117

 URL: http://llvm.org/viewvc/llvm-project?rev=277117=rev
 Log:
 Fix -break-insert not working when using absolute paths (MI)

 Summary:
 When trying to parse the -break-insert arguments as a named location, the
 string parsing was not configured to allow directory paths. This patch adds
 a constructor to allow the parsing of string as directory path along with
 the other parameters.

 This fixes https://llvm.org/bugs/show_bug.cgi?id=28709

 Patch from malape...@gmail.com
 Reviewers: clayborg, ki.stfu
 Subscribers: lldb-commits, ki.stfu
 Differential Revision: https://reviews.llvm.org/D22902


 Modified:

 lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
 lldb/trunk/tools/lldb-mi/MICmdArgValString.h
 lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp

 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=277117=277116=277117=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
 Fri Jul 29 01:01:20 2016
 @@ -155,7 +155,6 @@ 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
 -@unittest2.expectedFailure("-break-insert doesn't work for absolute
 path")
  def test_lldbmi_break_insert_file_line_absolute_path(self):
  """Test that 'lldb-mi --interpreter' works for file:line
 breakpoints."""


 Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
 URL:
 http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp?rev=277117=277116=277117=diff

 ==
 --- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp (original)
 +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp Fri Jul 29 01:01:20
 2016
 @@ -85,6 +85,30 @@ CMICmdArgValString::CMICmdArgValString(c
  }

  //++
 
 +// Details: CMICmdArgValString constructor.
 +// Type:Method.
 +// Args:vrArgName   - (R) Argument's name to search by.
 +//  vbMandatory - (R) True = Yes must be present, false =
 optional argument.
 +//  vbHandleByCmd   - (R) True = Command processes *this option,
 false = not handled.
 +//  vbHandleQuotes  - (R) True = Parse a string surrounded by
 quotes spaces are not delimiters, false = only text up to
 +// next delimiting space character.
 +//  vbAcceptNumbers - (R) True = Parse a string and accept as a
 number if number, false = numbers not recognised as
 +//  vbHandleDirPaths - (R) True = Parse a string and accept as a
 file path if a path, false = file paths are not
 +// string types.
 +// Return:  None.
 +// Throws:  None.
 +//--
 +CMICmdArgValString::CMICmdArgValString(const CMIUtilString ,
 const bool vbMandatory, const bool vbHandleByCmd,
 +   const bool vbHandleQuotes, const bool vbAcceptNumbers,
 const bool vbHandleDirPaths)
 +: CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd)
 +, m_bHandleQuotedString(vbHandleQuotes)
 +, m_bAcceptNumbers(vbAcceptNumbers)
 +, m_bHandleDirPaths(vbHandleDirPaths)
 +, m_bHandleAnything(false)
 +{
 +}
 +
 +//++
 
  // Details: CMICmdArgValString destructor.
  // Type:Overridden.
  // Args:None.

 Modified: 

Re: [Lldb-commits] [lldb] r277117 - Fix -break-insert not working when using absolute paths (MI)

2016-08-08 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Wed, Aug 3, 2016 at 9:06 AM, Hans Wennborg  wrote:
> For LLDB, I think it's up to Greg to decide.
>
> On Tue, Aug 2, 2016 at 10:20 PM, Ilia K  wrote:
>> Hi Hans!
>>
>> The author of this commit asks me is there a chance to include this changes
>> to 3.9 release? I'm not sure about our policy when RC has already been
>> tagged.
>>
>> On Fri, Jul 29, 2016 at 9:01 AM, Ilia K via lldb-commits
>>  wrote:
>>>
>>> Author: ki.stfu
>>> Date: Fri Jul 29 01:01:20 2016
>>> New Revision: 277117
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=277117=rev
>>> Log:
>>> Fix -break-insert not working when using absolute paths (MI)
>>>
>>> Summary:
>>> When trying to parse the -break-insert arguments as a named location, the
>>> string parsing was not configured to allow directory paths. This patch adds
>>> a constructor to allow the parsing of string as directory path along with
>>> the other parameters.
>>>
>>> This fixes https://llvm.org/bugs/show_bug.cgi?id=28709
>>>
>>> Patch from malape...@gmail.com
>>> Reviewers: clayborg, ki.stfu
>>> Subscribers: lldb-commits, ki.stfu
>>> Differential Revision: https://reviews.llvm.org/D22902
>>>
>>>
>>> Modified:
>>>
>>> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
>>> lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
>>> lldb/trunk/tools/lldb-mi/MICmdArgValString.h
>>> lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
>>>
>>> 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=277117=277116=277117=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
>>> Fri Jul 29 01:01:20 2016
>>> @@ -155,7 +155,6 @@ 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
>>> -@unittest2.expectedFailure("-break-insert doesn't work for absolute
>>> path")
>>>  def test_lldbmi_break_insert_file_line_absolute_path(self):
>>>  """Test that 'lldb-mi --interpreter' works for file:line
>>> breakpoints."""
>>>
>>>
>>> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp?rev=277117=277116=277117=diff
>>>
>>> ==
>>> --- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp (original)
>>> +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp Fri Jul 29 01:01:20
>>> 2016
>>> @@ -85,6 +85,30 @@ CMICmdArgValString::CMICmdArgValString(c
>>>  }
>>>
>>>  //++
>>> 
>>> +// Details: CMICmdArgValString constructor.
>>> +// Type:Method.
>>> +// Args:vrArgName   - (R) Argument's name to search by.
>>> +//  vbMandatory - (R) True = Yes must be present, false =
>>> optional argument.
>>> +//  vbHandleByCmd   - (R) True = Command processes *this option,
>>> false = not handled.
>>> +//  vbHandleQuotes  - (R) True = Parse a string surrounded by
>>> quotes spaces are not delimiters, false = only text up to
>>> +// next delimiting space character.
>>> +//  vbAcceptNumbers - (R) True = Parse a string and accept as a
>>> number if number, false = numbers not recognised as
>>> +//  vbHandleDirPaths - (R) True = Parse a string and accept as a
>>> file path if a path, false = file paths are not
>>> +// string types.
>>> +// Return:  None.
>>> +// Throws:  None.
>>> +//--
>>> +CMICmdArgValString::CMICmdArgValString(const CMIUtilString ,
>>> const bool vbMandatory, const bool vbHandleByCmd,
>>> +   const bool vbHandleQuotes, const bool vbAcceptNumbers,
>>> const bool vbHandleDirPaths)
>>> +: CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd)
>>> +, m_bHandleQuotedString(vbHandleQuotes)
>>> +, m_bAcceptNumbers(vbAcceptNumbers)
>>> +, m_bHandleDirPaths(vbHandleDirPaths)
>>> +, m_bHandleAnything(false)
>>> +{
>>> +}
>>> +
>>> +//++
>>> 
>>>  // Details: CMICmdArgValString destructor.
>>>  // Type:Overridden.
>>>  // Args:None.
>>>
>>> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.h?rev=277117=277116=277117=diff
>>>
>>> 

Re: [Lldb-commits] [lldb] r277117 - Fix -break-insert not working when using absolute paths (MI)

2016-08-03 Thread Hans Wennborg via lldb-commits
For LLDB, I think it's up to Greg to decide.

On Tue, Aug 2, 2016 at 10:20 PM, Ilia K  wrote:
> Hi Hans!
>
> The author of this commit asks me is there a chance to include this changes
> to 3.9 release? I'm not sure about our policy when RC has already been
> tagged.
>
> On Fri, Jul 29, 2016 at 9:01 AM, Ilia K via lldb-commits
>  wrote:
>>
>> Author: ki.stfu
>> Date: Fri Jul 29 01:01:20 2016
>> New Revision: 277117
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=277117=rev
>> Log:
>> Fix -break-insert not working when using absolute paths (MI)
>>
>> Summary:
>> When trying to parse the -break-insert arguments as a named location, the
>> string parsing was not configured to allow directory paths. This patch adds
>> a constructor to allow the parsing of string as directory path along with
>> the other parameters.
>>
>> This fixes https://llvm.org/bugs/show_bug.cgi?id=28709
>>
>> Patch from malape...@gmail.com
>> Reviewers: clayborg, ki.stfu
>> Subscribers: lldb-commits, ki.stfu
>> Differential Revision: https://reviews.llvm.org/D22902
>>
>>
>> Modified:
>>
>> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
>> lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
>> lldb/trunk/tools/lldb-mi/MICmdArgValString.h
>> lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
>>
>> 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=277117=277116=277117=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
>> Fri Jul 29 01:01:20 2016
>> @@ -155,7 +155,6 @@ 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
>> -@unittest2.expectedFailure("-break-insert doesn't work for absolute
>> path")
>>  def test_lldbmi_break_insert_file_line_absolute_path(self):
>>  """Test that 'lldb-mi --interpreter' works for file:line
>> breakpoints."""
>>
>>
>> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp?rev=277117=277116=277117=diff
>>
>> ==
>> --- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp (original)
>> +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp Fri Jul 29 01:01:20
>> 2016
>> @@ -85,6 +85,30 @@ CMICmdArgValString::CMICmdArgValString(c
>>  }
>>
>>  //++
>> 
>> +// Details: CMICmdArgValString constructor.
>> +// Type:Method.
>> +// Args:vrArgName   - (R) Argument's name to search by.
>> +//  vbMandatory - (R) True = Yes must be present, false =
>> optional argument.
>> +//  vbHandleByCmd   - (R) True = Command processes *this option,
>> false = not handled.
>> +//  vbHandleQuotes  - (R) True = Parse a string surrounded by
>> quotes spaces are not delimiters, false = only text up to
>> +// next delimiting space character.
>> +//  vbAcceptNumbers - (R) True = Parse a string and accept as a
>> number if number, false = numbers not recognised as
>> +//  vbHandleDirPaths - (R) True = Parse a string and accept as a
>> file path if a path, false = file paths are not
>> +// string types.
>> +// Return:  None.
>> +// Throws:  None.
>> +//--
>> +CMICmdArgValString::CMICmdArgValString(const CMIUtilString ,
>> const bool vbMandatory, const bool vbHandleByCmd,
>> +   const bool vbHandleQuotes, const bool vbAcceptNumbers,
>> const bool vbHandleDirPaths)
>> +: CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd)
>> +, m_bHandleQuotedString(vbHandleQuotes)
>> +, m_bAcceptNumbers(vbAcceptNumbers)
>> +, m_bHandleDirPaths(vbHandleDirPaths)
>> +, m_bHandleAnything(false)
>> +{
>> +}
>> +
>> +//++
>> 
>>  // Details: CMICmdArgValString destructor.
>>  // Type:Overridden.
>>  // Args:None.
>>
>> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.h?rev=277117=277116=277117=diff
>>
>> ==
>> --- lldb/trunk/tools/lldb-mi/MICmdArgValString.h (original)
>> +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.h Fri Jul 29 01:01:20 2016
>> @@ -32,6 +32,8 @@ class CMICmdArgValString : public 

Re: [Lldb-commits] FW: [Diffusion] rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation…

2016-08-02 Thread Hans Wennborg via lldb-commits
While this all seems very MIPS-specific, so probably fine to merge if
you want to, it does look more like new development than just bug
fixing.

I'm OK with merging this if Clayton approves, though.

Thanks,
Hans

On Tue, Aug 2, 2016 at 12:49 AM, Nitesh Jain  wrote:
> Hi Hans,
>
> Could you please merge this to the LLDB 3.9 release branch ?
>
> Thanks & regards,
> Nitesh Jain
>
> -Original Message-
> From: Nitesh Jain
> Sent: 02 August 2016 12:56
> To: Nitesh Jain
> Subject: Re: [Diffusion] rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI 
> instructions emulation . Fix emulation…
>
> nitesh.jain committed rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI 
> instructions emulation . Fix emulation….
>
> [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation 
> for (D)ADDIU, SD/SW and LW/LD instructions
>
> Reviewers: clayborg, jaydeep, bhushan
>
> Subscribers: mohit.bhakkad, slthakur, sdardis, lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D22851
>
>
> Files:
>   /lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
>
> Users:
>   nitesh.jain (Author)
>
> https://reviews.llvm.org/rL277426
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR (Merge Request)

2016-08-02 Thread Hans Wennborg via lldb-commits
Looks like a pretty big change to merge at this stage.

I'll let Clayton decide.

Thanks,
Hans

On Mon, Aug 1, 2016 at 11:25 PM, Nitesh Jain  wrote:
> Hi Hans,
>
> Could you please add this to the LLDB 3.9 release branch ?
>
> Thanks & regards,
> Nitesh Jain
>
>
> -Original Message-
> From: Nitesh Jain
> Sent: 01 August 2016 19:24
> To: Nitesh Jain; jing...@apple.com; clayb...@gmail.com
> Cc: ema...@freebsd.org; nemanja.i@gmail.com; lab...@google.com; 
> lldb-commits@lists.llvm.org; Simon Dardis; Mohit Bhakkad; Sagar Thakur; 
> Bhushan Attarde; Jaydeep Patil
> Subject: Re: [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR
>
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL277343: [LLVM][MIPS] Fix FPU Size Based on Dynamic FR. 
> (authored by nitesh.jain).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D20357?vs=65923=66314#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D20357
>
> Files:
>   lldb/trunk/include/lldb/Target/RegisterContext.h
>   lldb/trunk/include/lldb/lldb-private-types.h
>   lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>   lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm64.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_i386.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips64.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_s390x.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
>   
> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>   lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
>   lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>   lldb/trunk/source/Target/RegisterContext.cpp
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r260072 - [LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS

2016-02-09 Thread Hans Wennborg via lldb-commits
Merged in r260236.

Thanks,
Hans

On Tue, Feb 9, 2016 at 1:40 AM, Bhushan Attarde
 wrote:
> Hi Hans,
>
> Could you please add this (r260072) to the release branch?
>
> Thanks,
> Bhushan
>
>
> -Original Message-
> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
> Bhushan D. Attarde via lldb-commits
> Sent: 08 February 2016 10:06
> To: lldb-commits@lists.llvm.org
> Subject: [Lldb-commits] [lldb] r260072 - [LLDB][MIPS] Fix 
> TestExpressionInSyscall.py for MIPS
>
> Author: bhushan.attarde
> Date: Sun Feb  7 22:35:51 2016
> New Revision: 260072
>
> URL: http://llvm.org/viewvc/llvm-project?rev=260072=rev
> Log:
> [LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS
>
> SUMMARY:
> This patch fixes TestExpressionInSyscall.py and solves bug 23659 for MIPS.
> Corrected indentation at couple of places.
>
> Reviewers: clayborg
> Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
> Differential Revision: http://reviews.llvm.org/D16916
>
> Modified:
> lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
> lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
>
> Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=260072=260071=260072=diff
> ==
> --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
> +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Sun Feb  7 
> 22:35:51 2016
> @@ -242,16 +242,27 @@ ABISysV_mips::PrepareTrivialCall (Thread
>  const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo 
> (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
>  const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo 
> (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
>  const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
> +const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
>
>  if (log)
> -log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
> +log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0);
> +
> +/* Write r0 with 0, in case we are stopped in syscall,
> + * such setting prevents automatic decrement of the PC.
> + * This clears the bug 23659 for MIPS.
> +*/
> +if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0))
> +return false;
> +
> +if (log)
> +log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
>
>  // Set "sp" to the requested value
>  if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp))
>  return false;
>
>  if (log)
> -log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
> +log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
>
>  // Set "ra" to the return address
>  if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr))
>
> Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=260072=260071=260072=diff
> ==
> --- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
> +++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Sun Feb  7 
> 22:35:51 2016
> @@ -207,16 +207,27 @@ ABISysV_mips64::PrepareTrivialCall (Thre
>  const RegisterInfo *sp_reg_info = reg_ctx->GetRegisterInfo 
> (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
>  const RegisterInfo *ra_reg_info = reg_ctx->GetRegisterInfo 
> (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
>  const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
> +const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
>
>  if (log)
> -log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
> +log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0);
> +
> +/* Write r0 with 0, in case we are stopped in syscall,
> + * such setting prevents automatic decrement of the PC.
> + * This clears the bug 23659 for MIPS.
> +*/
> +if (!reg_ctx->WriteRegisterFromUnsigned (r0_info, (uint64_t)0))
> +return false;
> +
> +if (log)
> +log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
>
>  // Set "sp" to the requested value
>  if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_info, sp))
>  return false;
>
>  if (log)
> -log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
> +log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
>
>  // Set "ra" to the return address
>  if (!reg_ctx->WriteRegisterFromUnsigned (ra_reg_info, return_addr))
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> 

Re: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-02-02 Thread Hans Wennborg via lldb-commits
On Mon, Feb 1, 2016 at 9:34 AM, Hans Wennborg  wrote:
> On Mon, Feb 1, 2016 at 2:37 AM, Bhushan Attarde
>  wrote:
>> Hi Hans,
>>
>> Could you please add this (r258919) to the release branch?
>> Also commit r258967 (on top of this) by Zachary which fixes some python 3 
>> incompatibilities.
>
> Since this touched more than just MIPS-specific files, I'd like Greg
> to approve it for the branch.
>
> Greg, is this OK for 3.8?

As per Greg's earlier email [1] about non-ARM or x86 patches, I'll
just go ahead and merge this. r259523.

Thanks,
Hans

 [1] 
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20160201/027147.html


>> -Original Message-
>> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
>> Bhushan D. Attarde via lldb-commits
>> Sent: 27 January 2016 15:47
>> To: lldb-commits@lists.llvm.org
>> Subject: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in 
>> GetBreakableLoadAddress() for MIPS
>>
>> Author: bhushan.attarde
>> Date: Wed Jan 27 04:16:30 2016
>> New Revision: 258919
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=258919=rev
>> Log:
>> [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
>>
>> SUMMARY:
>> Get the load address for the address given by symbol and function.
>> Earlier, this was done for function only, this patch does it for symbol 
>> too.
>> This patch also adds TestAvoidBreakpointInDelaySlot.py to test this 
>> change.
>>
>> Reviewers: clayborg
>> Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits
>> Differential Revision: http://reviews.llvm.org/D16049
>>
>> Added:
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c
>> Modified:
>> lldb/trunk/include/lldb/API/SBInstruction.h
>> lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
>> lldb/trunk/scripts/interface/SBInstruction.i
>> lldb/trunk/source/API/SBInstruction.cpp
>> lldb/trunk/source/Target/Target.cpp
>>
>> Modified: lldb/trunk/include/lldb/API/SBInstruction.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=258919=258918=258919=diff
>> ==
>> --- lldb/trunk/include/lldb/API/SBInstruction.h (original)
>> +++ lldb/trunk/include/lldb/API/SBInstruction.h Wed Jan 27 04:16:30 2016
>> @@ -60,6 +60,9 @@ public:
>>  bool
>>  DoesBranch ();
>>
>> +bool
>> +HasDelaySlot ();
>> +
>>  void
>>  Print (FILE *out);
>>
>>
>> Added: 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile?rev=258919=auto
>> ==
>> --- 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
>>  (added)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint
>> +++ /breakpoint_in_delayslot/Makefile Wed Jan 27 04:16:30 2016
>> @@ -0,0 +1,6 @@
>> +LEVEL = ../../../make
>> +
>> +C_SOURCES := main.c
>> +
>> +include $(LEVEL)/Makefile.rules
>> +
>>
>> Added: 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py?rev=258919=auto
>> ==
>> --- 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
>>  (added)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint
>> +++ /breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Wed Jan
>> +++ 27 04:16:30 2016
>> @@ -0,0 +1,82 @@
>> +"""
>> +Test specific to MIPS
>> +"""
>> +
>> +import os, time
>> +import re
>> +import unittest2
>> +import lldb
>> +import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest
>> +import *
>> +
>> +class AvoidBreakpointInDelaySlotAPITestCase(TestBase):
>> +
>> +mydir = TestBase.compute_mydir(__file__)
>> +
>> +@skipUnlessArch(archs=re.compile('mips*'))
>> +def test(self):
>> +self.build()
>> +exe = os.path.join(os.getcwd(), "a.out")
>> +

Re: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-02-02 Thread Hans Wennborg via lldb-commits
On Tue, Feb 2, 2016 at 8:52 AM, Hans Wennborg  wrote:
> On Mon, Feb 1, 2016 at 9:34 AM, Hans Wennborg  wrote:
>> On Mon, Feb 1, 2016 at 2:37 AM, Bhushan Attarde
>>  wrote:
>>> Hi Hans,
>>>
>>> Could you please add this (r258919) to the release branch?
>>> Also commit r258967 (on top of this) by Zachary which fixes some python 3 
>>> incompatibilities.
>>
>> Since this touched more than just MIPS-specific files, I'd like Greg
>> to approve it for the branch.
>>
>> Greg, is this OK for 3.8?
>
> As per Greg's earlier email [1] about non-ARM or x86 patches, I'll
> just go ahead and merge this. r259523.

(Almost forgot, also merged r258967 in r259524.)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation

2016-02-02 Thread Hans Wennborg via lldb-commits
r259525.

On Mon, Feb 1, 2016 at 1:51 PM, Hans Wennborg  wrote:
> Greg: ping?
>
> On Mon, Jan 25, 2016 at 11:40 AM, Hans Wennborg  wrote:
>> SGTM if Greg approves.
>>
>> On Mon, Jan 25, 2016 at 2:03 AM, Bhushan Attarde
>>  wrote:
>>> Could you please add this to the release branch?
>>>
>>> Thanks,
>>> Bhushan
>>>
>>>
>>> -Original Message-
>>> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf 
>>> Of Bhushan D. Attarde via lldb-commits
>>> Sent: 22 January 2016 10:32
>>> To: lldb-commits@lists.llvm.org
>>> Subject: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for 
>>> dynamic checker function inserted by LLDB during expression evaluation
>>>
>>> Author: bhushan.attarde
>>> Date: Thu Jan 21 23:02:02 2016
>>> New Revision: 258485
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=258485=rev
>>> Log:
>>> Use "_$" prefix instead of "$" for dynamic checker function inserted by 
>>> LLDB during expression evaluation
>>>
>>> SUMMARY:
>>> The symbol "$" has a special meaning for MIPS i.e it is marker for 
>>> temporary symbols for MIPS.
>>> So this patch uses additional _ prefix for 
>>> "$__lldb_valid_pointer_check" so that it wont be marked as temporary symbol 
>>> in case of MIPS.
>>>
>>> Reviewers: clayborg, spyffe
>>> Subscribers: dean, emaste, mohit.bhakkad, sagar, jaydeep, lldb-commits
>>> Differential http://reviews.llvm.org/D14111
>>>
>>> Modified:
>>> lldb/trunk/source/Expression/IRDynamicChecks.cpp
>>>
>>> Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=258485=258484=258485=diff
>>> ==
>>> --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original)
>>> +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Thu Jan 21 23:02:02
>>> +++ 2016
>>> @@ -35,12 +35,12 @@ using namespace lldb_private;
>>>
>>>  static char ID;
>>>
>>> -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check"
>>> +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check"
>>>  #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check"
>>>
>>>  static const char g_valid_pointer_check_text[] =  "extern \"C\" void\n"
>>> -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
>>> +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
>>>  "{\n"
>>>  "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n"
>>>  "}";
>>>
>>>
>>> ___
>>> lldb-commits mailing list
>>> lldb-commits@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods

2016-02-01 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Tue, Jan 26, 2016 at 11:10 AM, Hans Wennborg  wrote:
> Greg: Ping?
>
> On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg  wrote:
>> Sure. Greg, are you the code owner for this, or is there a specific
>> owner for Go?
>>
>> Thanks,
>> Hans
>>
>> On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits
>>  wrote:
>>> It would be nice if we could get this into 3.8 to get rid of these asserts.
>>>
>>> -- Ryan Brown
>>>
>>> On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits
>>>  wrote:

 Author: ribrdb
 Date: Fri Jan 15 13:35:48 2016
 New Revision: 257926

 URL: http://llvm.org/viewvc/llvm-project?rev=257926=rev
 Log:
 Implement missing GoASTContext methods

 Modified:
 lldb/trunk/source/Symbol/GoASTContext.cpp

 Modified: lldb/trunk/source/Symbol/GoASTContext.cpp
 URL:
 http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926=257925=257926=diff

 ==
 --- lldb/trunk/source/Symbol/GoASTContext.cpp (original)
 +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016
 @@ -13,6 +13,7 @@

  #include "lldb/Core/Module.h"
  #include "lldb/Core/PluginManager.h"
 +#include "lldb/Core/StreamFile.h"
  #include "lldb/Core/UniqueCStringMap.h"
  #include "lldb/Core/ValueObject.h"
  #include "lldb/DataFormatters/StringPrinter.h"
 @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue(
  //--
  // Dumping types
  //--
 +#define DEPTH_INCREMENT 2
 +
  void
  GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
 ExecutionContext *exe_ctx, Stream *s, lldb::Format format,
 -const DataExtractor , lldb::offset_t
 data_offset, size_t data_byte_size,
 +const DataExtractor , lldb::offset_t
 data_byte_offset, size_t data_byte_size,
  uint32_t bitfield_bit_size, uint32_t
 bitfield_bit_offset, bool show_types, bool show_summary,
  bool verbose, uint32_t depth)
  {
 -assert(false);
 +if (IsTypedefType(type))
 +type = GetTypedefedType(type).GetOpaqueQualType();
 +if (!type)
 +return;
 +GoType *t = static_cast(type);
 +
 +if (GoStruct *st = t->GetStruct())
 +{
 +if (GetCompleteType(type))
 +{
 +uint32_t field_idx = 0;
 +for (auto* field = st->GetField(field_idx); field != nullptr;
 field_idx++)
 +{
 +// Print the starting squiggly bracket (if this is the
 +// first member) or comma (for member 2 and beyond) for
 +// the struct/union/class member.
 +if (field_idx == 0)
 +s->PutChar('{');
 +else
 +s->PutChar(',');
 +
 +// Indent
 +s->Printf("\n%*s", depth + DEPTH_INCREMENT, "");
 +
 +// Print the member type if requested
 +if (show_types)
 +{
 +ConstString field_type_name =
 field->m_type.GetTypeName();
 +s->Printf("(%s) ", field_type_name.AsCString());
 +}
 +// Print the member name and equal sign
 +s->Printf("%s = ", field->m_name.AsCString());
 +
 +
 +// Dump the value of the member
 +CompilerType field_type = field->m_type;
 +field_type.DumpValue (exe_ctx,
 + s,
 // Stream to dump to
 + field_type.GetFormat(),
 // The format with which to display the member
 + data,
 // Data buffer containing all bytes for this type
 + data_byte_offset +
 field->m_byte_offset,// Offset into "data" where to grab value from
 +
 field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()),  //
 Size of this type in bytes
 + 0,
 // Bitfield bit size
 + 0,
 // Bitfield bit offset
 + show_types,
 // Boolean indicating if we should show the variable types
 + show_summary,
 // Boolean indicating if we should show a summary for 

Re: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation

2016-02-01 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Mon, Jan 25, 2016 at 11:40 AM, Hans Wennborg  wrote:
> SGTM if Greg approves.
>
> On Mon, Jan 25, 2016 at 2:03 AM, Bhushan Attarde
>  wrote:
>> Could you please add this to the release branch?
>>
>> Thanks,
>> Bhushan
>>
>>
>> -Original Message-
>> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
>> Bhushan D. Attarde via lldb-commits
>> Sent: 22 January 2016 10:32
>> To: lldb-commits@lists.llvm.org
>> Subject: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for 
>> dynamic checker function inserted by LLDB during expression evaluation
>>
>> Author: bhushan.attarde
>> Date: Thu Jan 21 23:02:02 2016
>> New Revision: 258485
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=258485=rev
>> Log:
>> Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB 
>> during expression evaluation
>>
>> SUMMARY:
>> The symbol "$" has a special meaning for MIPS i.e it is marker for 
>> temporary symbols for MIPS.
>> So this patch uses additional _ prefix for "$__lldb_valid_pointer_check" 
>> so that it wont be marked as temporary symbol in case of MIPS.
>>
>> Reviewers: clayborg, spyffe
>> Subscribers: dean, emaste, mohit.bhakkad, sagar, jaydeep, lldb-commits
>> Differential http://reviews.llvm.org/D14111
>>
>> Modified:
>> lldb/trunk/source/Expression/IRDynamicChecks.cpp
>>
>> Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=258485=258484=258485=diff
>> ==
>> --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original)
>> +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Thu Jan 21 23:02:02
>> +++ 2016
>> @@ -35,12 +35,12 @@ using namespace lldb_private;
>>
>>  static char ID;
>>
>> -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check"
>> +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check"
>>  #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check"
>>
>>  static const char g_valid_pointer_check_text[] =  "extern \"C\" void\n"
>> -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
>> +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
>>  "{\n"
>>  "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n"
>>  "}";
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods

2016-02-01 Thread Hans Wennborg via lldb-commits
Thanks! r259423.

On Mon, Feb 1, 2016 at 2:19 PM, Greg Clayton  wrote:
> Sorry for the delay. This is fine.
>
> In general, feel free to accept any patches that are architecture specific 
> for architectures that aren't x86 or ARM (MIPS, hexagon for example), and for 
> any languages that aren't C/C++/ObjC or Swift (renderscript, go).
>
>
>> On Feb 1, 2016, at 1:49 PM, Hans Wennborg  wrote:
>>
>> Greg: ping?
>>
>> On Tue, Jan 26, 2016 at 11:10 AM, Hans Wennborg  wrote:
>>> Greg: Ping?
>>>
>>> On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg  wrote:
 Sure. Greg, are you the code owner for this, or is there a specific
 owner for Go?

 Thanks,
 Hans

 On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits
  wrote:
> It would be nice if we could get this into 3.8 to get rid of these 
> asserts.
>
> -- Ryan Brown
>
> On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits
>  wrote:
>>
>> Author: ribrdb
>> Date: Fri Jan 15 13:35:48 2016
>> New Revision: 257926
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=257926=rev
>> Log:
>> Implement missing GoASTContext methods
>>
>> Modified:
>>lldb/trunk/source/Symbol/GoASTContext.cpp
>>
>> Modified: lldb/trunk/source/Symbol/GoASTContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926=257925=257926=diff
>>
>> ==
>> --- lldb/trunk/source/Symbol/GoASTContext.cpp (original)
>> +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016
>> @@ -13,6 +13,7 @@
>>
>> #include "lldb/Core/Module.h"
>> #include "lldb/Core/PluginManager.h"
>> +#include "lldb/Core/StreamFile.h"
>> #include "lldb/Core/UniqueCStringMap.h"
>> #include "lldb/Core/ValueObject.h"
>> #include "lldb/DataFormatters/StringPrinter.h"
>> @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue(
>> //--
>> // Dumping types
>> //--
>> +#define DEPTH_INCREMENT 2
>> +
>> void
>> GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
>> ExecutionContext *exe_ctx, Stream *s, lldb::Format format,
>> -const DataExtractor , lldb::offset_t
>> data_offset, size_t data_byte_size,
>> +const DataExtractor , lldb::offset_t
>> data_byte_offset, size_t data_byte_size,
>> uint32_t bitfield_bit_size, uint32_t
>> bitfield_bit_offset, bool show_types, bool show_summary,
>> bool verbose, uint32_t depth)
>> {
>> -assert(false);
>> +if (IsTypedefType(type))
>> +type = GetTypedefedType(type).GetOpaqueQualType();
>> +if (!type)
>> +return;
>> +GoType *t = static_cast(type);
>> +
>> +if (GoStruct *st = t->GetStruct())
>> +{
>> +if (GetCompleteType(type))
>> +{
>> +uint32_t field_idx = 0;
>> +for (auto* field = st->GetField(field_idx); field != 
>> nullptr;
>> field_idx++)
>> +{
>> +// Print the starting squiggly bracket (if this is the
>> +// first member) or comma (for member 2 and beyond) for
>> +// the struct/union/class member.
>> +if (field_idx == 0)
>> +s->PutChar('{');
>> +else
>> +s->PutChar(',');
>> +
>> +// Indent
>> +s->Printf("\n%*s", depth + DEPTH_INCREMENT, "");
>> +
>> +// Print the member type if requested
>> +if (show_types)
>> +{
>> +ConstString field_type_name =
>> field->m_type.GetTypeName();
>> +s->Printf("(%s) ", field_type_name.AsCString());
>> +}
>> +// Print the member name and equal sign
>> +s->Printf("%s = ", field->m_name.AsCString());
>> +
>> +
>> +// Dump the value of the member
>> +CompilerType field_type = field->m_type;
>> +field_type.DumpValue (exe_ctx,
>> + s,
>> // Stream to dump to
>> + field_type.GetFormat(),
>> // The format with which to display the member
>> + data,
>> // Data buffer containing all bytes for this 

Re: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS

2016-02-01 Thread Hans Wennborg via lldb-commits
On Mon, Feb 1, 2016 at 2:37 AM, Bhushan Attarde
 wrote:
> Hi Hans,
>
> Could you please add this (r258919) to the release branch?
> Also commit r258967 (on top of this) by Zachary which fixes some python 3 
> incompatibilities.

Since this touched more than just MIPS-specific files, I'd like Greg
to approve it for the branch.

Greg, is this OK for 3.8?

Thanks,
Hans


> -Original Message-
> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
> Bhushan D. Attarde via lldb-commits
> Sent: 27 January 2016 15:47
> To: lldb-commits@lists.llvm.org
> Subject: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in 
> GetBreakableLoadAddress() for MIPS
>
> Author: bhushan.attarde
> Date: Wed Jan 27 04:16:30 2016
> New Revision: 258919
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258919=rev
> Log:
> [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
>
> SUMMARY:
> Get the load address for the address given by symbol and function.
> Earlier, this was done for function only, this patch does it for symbol 
> too.
> This patch also adds TestAvoidBreakpointInDelaySlot.py to test this 
> change.
>
> Reviewers: clayborg
> Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits
> Differential Revision: http://reviews.llvm.org/D16049
>
> Added:
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c
> Modified:
> lldb/trunk/include/lldb/API/SBInstruction.h
> lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
> lldb/trunk/scripts/interface/SBInstruction.i
> lldb/trunk/source/API/SBInstruction.cpp
> lldb/trunk/source/Target/Target.cpp
>
> Modified: lldb/trunk/include/lldb/API/SBInstruction.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=258919=258918=258919=diff
> ==
> --- lldb/trunk/include/lldb/API/SBInstruction.h (original)
> +++ lldb/trunk/include/lldb/API/SBInstruction.h Wed Jan 27 04:16:30 2016
> @@ -60,6 +60,9 @@ public:
>  bool
>  DoesBranch ();
>
> +bool
> +HasDelaySlot ();
> +
>  void
>  Print (FILE *out);
>
>
> Added: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile?rev=258919=auto
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile
>  (added)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint
> +++ /breakpoint_in_delayslot/Makefile Wed Jan 27 04:16:30 2016
> @@ -0,0 +1,6 @@
> +LEVEL = ../../../make
> +
> +C_SOURCES := main.c
> +
> +include $(LEVEL)/Makefile.rules
> +
>
> Added: 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py?rev=258919=auto
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
>  (added)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint
> +++ /breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Wed Jan
> +++ 27 04:16:30 2016
> @@ -0,0 +1,82 @@
> +"""
> +Test specific to MIPS
> +"""
> +
> +import os, time
> +import re
> +import unittest2
> +import lldb
> +import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest
> +import *
> +
> +class AvoidBreakpointInDelaySlotAPITestCase(TestBase):
> +
> +mydir = TestBase.compute_mydir(__file__)
> +
> +@skipUnlessArch(archs=re.compile('mips*'))
> +def test(self):
> +self.build()
> +exe = os.path.join(os.getcwd(), "a.out")
> +self.expect("file " + exe,
> +patterns = [ "Current executable set to .*a.out.*"
> + ])
> +
> +# Create a target by the debugger.
> +target = self.dbg.CreateTarget(exe)
> +self.assertTrue(target, VALID_TARGET)
> +
> +breakpoint = target.BreakpointCreateByName('main', 'a.out')
> +self.assertTrue(breakpoint and
> +

Re: [Lldb-commits] [lldb] r259188 - Fix linking of lldb-server with BUILD_SHARED_LIBS

2016-01-29 Thread Hans Wennborg via lldb-commits
Sgtm. Zach's the owner here.

On Fri, Jan 29, 2016 at 6:47 AM, Pavel Labath  wrote:
> Zachary, Hans,
>
> this is not super-important, as a BUILD_SHARED_LIBS build of lldb will
> still remain broken due to other issues, but I'd still like to get
> this into 3.8, as it will reduce the pain for anyone trying to get
> this build working downstream. What do you think?
>
> problem reported in pr26335.
>
> cheers,
> pl
>
> On 29 January 2016 at 11:59, Pavel Labath via lldb-commits
>  wrote:
>> Author: labath
>> Date: Fri Jan 29 05:59:57 2016
>> New Revision: 259188
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=259188=rev
>> Log:
>> Fix linking of lldb-server with BUILD_SHARED_LIBS
>>
>> Summary:
>> The BUILD_SHARED_LIBS branch of lldb-server link flags was hopelessly 
>> broken, at least since we
>> started restricting the symbols exported by liblldb. lldb-server depends on 
>> symbols from the
>> lldb_private namespace, so it cannot link to the public interface of 
>> liblldb. Instead I make it
>> link to the individual libraries constituting liblldb, just like it does in 
>> the
>> !BUILD_SHARED_LIBS case.
>>
>> This does not make the BUILD_SHARED_LIBS build of lldb fully functional yet, 
>> due to the way
>> liblldb dependencies are managed, but it's a step in that direction.
>>
>> Reviewers: zturner, tfiala
>>
>> Subscribers: lldb-commits
>>
>> Differential Revision: http://reviews.llvm.org/D16678
>>
>> Modified:
>> lldb/trunk/tools/lldb-server/CMakeLists.txt
>>
>> Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=259188=259187=259188=diff
>> ==
>> --- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
>> +++ lldb/trunk/tools/lldb-server/CMakeLists.txt Fri Jan 29 05:59:57 2016
>> @@ -33,24 +33,19 @@ add_lldb_executable(lldb-server
>>  LLDBServerUtilities.cpp
>>  )
>>
>> -if (BUILD_SHARED_LIBS )
>> -  target_link_libraries(lldb-server liblldb)
>> -  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>> +# The Darwin linker doesn't understand --start-group/--end-group.
>> +if (LLDB_LINKER_SUPPORTS_GROUPS)
>> +  target_link_libraries(lldb-server
>> +-Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
>> +  target_link_libraries(lldb-server
>> +-Wl,--start-group ${CLANG_USED_LIBS} 
>> -Wl,--end-group)
>>  else()
>> -  # The Darwin linker doesn't understand --start-group/--end-group.
>> -  if (LLDB_LINKER_SUPPORTS_GROUPS)
>> -target_link_libraries(lldb-server
>> -  -Wl,--start-group ${LLDB_USED_LIBS} 
>> -Wl,--end-group)
>> -target_link_libraries(lldb-server
>> -  -Wl,--start-group ${CLANG_USED_LIBS} 
>> -Wl,--end-group)
>> -  else()
>> -target_link_libraries(lldb-server ${LLDB_USED_LIBS})
>> -target_link_libraries(lldb-server ${CLANG_USED_LIBS})
>> -  endif()
>> -  llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
>> -
>> -  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>> +  target_link_libraries(lldb-server ${LLDB_USED_LIBS})
>> +  target_link_libraries(lldb-server ${CLANG_USED_LIBS})
>>  endif()
>> +llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
>> +
>> +target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>>
>>  set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION})
>>
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r259188 - Fix linking of lldb-server with BUILD_SHARED_LIBS

2016-01-29 Thread Hans Wennborg via lldb-commits
r259241. Thanks.

On Fri, Jan 29, 2016 at 10:21 AM, Zachary Turner  wrote:
> lgtm, as Pavel points out build_shared_libs is already broken anyway and
> this doesn't make it worse, while also not touching the non
> build_shared_libs path.
>
> On Fri, Jan 29, 2016 at 10:15 AM Hans Wennborg  wrote:
>>
>> Sgtm. Zach's the owner here.
>>
>> On Fri, Jan 29, 2016 at 6:47 AM, Pavel Labath  wrote:
>> > Zachary, Hans,
>> >
>> > this is not super-important, as a BUILD_SHARED_LIBS build of lldb will
>> > still remain broken due to other issues, but I'd still like to get
>> > this into 3.8, as it will reduce the pain for anyone trying to get
>> > this build working downstream. What do you think?
>> >
>> > problem reported in pr26335.
>> >
>> > cheers,
>> > pl
>> >
>> > On 29 January 2016 at 11:59, Pavel Labath via lldb-commits
>> >  wrote:
>> >> Author: labath
>> >> Date: Fri Jan 29 05:59:57 2016
>> >> New Revision: 259188
>> >>
>> >> URL: http://llvm.org/viewvc/llvm-project?rev=259188=rev
>> >> Log:
>> >> Fix linking of lldb-server with BUILD_SHARED_LIBS
>> >>
>> >> Summary:
>> >> The BUILD_SHARED_LIBS branch of lldb-server link flags was hopelessly
>> >> broken, at least since we
>> >> started restricting the symbols exported by liblldb. lldb-server
>> >> depends on symbols from the
>> >> lldb_private namespace, so it cannot link to the public interface of
>> >> liblldb. Instead I make it
>> >> link to the individual libraries constituting liblldb, just like it
>> >> does in the
>> >> !BUILD_SHARED_LIBS case.
>> >>
>> >> This does not make the BUILD_SHARED_LIBS build of lldb fully functional
>> >> yet, due to the way
>> >> liblldb dependencies are managed, but it's a step in that direction.
>> >>
>> >> Reviewers: zturner, tfiala
>> >>
>> >> Subscribers: lldb-commits
>> >>
>> >> Differential Revision: http://reviews.llvm.org/D16678
>> >>
>> >> Modified:
>> >> lldb/trunk/tools/lldb-server/CMakeLists.txt
>> >>
>> >> Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
>> >> URL:
>> >> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=259188=259187=259188=diff
>> >>
>> >> ==
>> >> --- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
>> >> +++ lldb/trunk/tools/lldb-server/CMakeLists.txt Fri Jan 29 05:59:57
>> >> 2016
>> >> @@ -33,24 +33,19 @@ add_lldb_executable(lldb-server
>> >>  LLDBServerUtilities.cpp
>> >>  )
>> >>
>> >> -if (BUILD_SHARED_LIBS )
>> >> -  target_link_libraries(lldb-server liblldb)
>> >> -  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>> >> +# The Darwin linker doesn't understand --start-group/--end-group.
>> >> +if (LLDB_LINKER_SUPPORTS_GROUPS)
>> >> +  target_link_libraries(lldb-server
>> >> +-Wl,--start-group ${LLDB_USED_LIBS}
>> >> -Wl,--end-group)
>> >> +  target_link_libraries(lldb-server
>> >> +-Wl,--start-group ${CLANG_USED_LIBS}
>> >> -Wl,--end-group)
>> >>  else()
>> >> -  # The Darwin linker doesn't understand --start-group/--end-group.
>> >> -  if (LLDB_LINKER_SUPPORTS_GROUPS)
>> >> -target_link_libraries(lldb-server
>> >> -  -Wl,--start-group ${LLDB_USED_LIBS}
>> >> -Wl,--end-group)
>> >> -target_link_libraries(lldb-server
>> >> -  -Wl,--start-group ${CLANG_USED_LIBS}
>> >> -Wl,--end-group)
>> >> -  else()
>> >> -target_link_libraries(lldb-server ${LLDB_USED_LIBS})
>> >> -target_link_libraries(lldb-server ${CLANG_USED_LIBS})
>> >> -  endif()
>> >> -  llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
>> >> -
>> >> -  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>> >> +  target_link_libraries(lldb-server ${LLDB_USED_LIBS})
>> >> +  target_link_libraries(lldb-server ${CLANG_USED_LIBS})
>> >>  endif()
>> >> +llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
>> >> +
>> >> +target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
>> >>
>> >>  set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION})
>> >>
>> >>
>> >>
>> >> ___
>> >> lldb-commits mailing list
>> >> lldb-commits@lists.llvm.org
>> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16284: Fix Makefile build

2016-01-28 Thread Hans Wennborg via lldb-commits
hans added a comment.

loladiro: Ping?


http://reviews.llvm.org/D16284



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


Re: [Lldb-commits] [PATCH] D16284: Fix Makefile build

2016-01-28 Thread Hans Wennborg via lldb-commits
hans added a comment.

I've committed the patch to 3.8 in r259081.

Please confirm if this fixes the issue there.


http://reviews.llvm.org/D16284



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


Re: [Lldb-commits] [lldb] r258921 - Fix linking with LLVM_LINK_LLVM_DYLIB=ON

2016-01-27 Thread Hans Wennborg via lldb-commits
Zach is the lldb cmake owner. Zach, does this seem OK for 3.8?

On Wed, Jan 27, 2016 at 7:13 AM, Pavel Labath  wrote:
> Hi,
>
> could we get this patch applied to the 3.8 branch?
>
> thanks,
> pl
>
>
> On 27 January 2016 at 11:02, Pavel Labath via lldb-commits
>  wrote:
>> Author: labath
>> Date: Wed Jan 27 05:02:02 2016
>> New Revision: 258921
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=258921=rev
>> Log:
>> Fix linking with LLVM_LINK_LLVM_DYLIB=ON
>>
>> Linking with LLVM shared libraries currently produces linker errors.  This 
>> works around the issue
>> (pr24953) by disabling linking with llvm so for lldb libraries.
>>
>> Patch by Evangelos Foutras.
>>
>> Reviewers: zturner
>>
>> Subscribers: lldb-commits
>>
>> Differential Revision: http://reviews.llvm.org/D16293
>>
>> Modified:
>> lldb/trunk/cmake/modules/AddLLDB.cmake
>>
>> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=258921=258920=258921=diff
>> ==
>> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
>> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jan 27 05:02:02 2016
>> @@ -56,7 +56,7 @@ macro(add_lldb_library name)
>>if (PARAM_OBJECT)
>>  add_library(${name} ${libkind} ${srcs})
>>else()
>> -llvm_add_library(${name} ${libkind} ${srcs})
>> +llvm_add_library(${name} ${libkind} DISABLE_LLVM_LINK_LLVM_DYLIB 
>> ${srcs})
>>
>>  lldb_link_common_libs(${name} "${libkind}")
>>
>> @@ -93,7 +93,7 @@ macro(add_lldb_library name)
>>  endmacro(add_lldb_library)
>>
>>  macro(add_lldb_executable name)
>> -  add_llvm_executable(${name} ${ARGN})
>> +  add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
>>set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
>>  endmacro(add_lldb_executable)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r258921 - Fix linking with LLVM_LINK_LLVM_DYLIB=ON

2016-01-27 Thread Hans Wennborg via lldb-commits
Merged in r258964, thanks. (I accidentally committed some local
changes too; reverted those in r258968.)

On Wed, Jan 27, 2016 at 10:06 AM, Zachary Turner  wrote:
> Yea I think this is fine.
>
> On Wed, Jan 27, 2016 at 9:29 AM Hans Wennborg  wrote:
>>
>> Zach is the lldb cmake owner. Zach, does this seem OK for 3.8?
>>
>> On Wed, Jan 27, 2016 at 7:13 AM, Pavel Labath  wrote:
>> > Hi,
>> >
>> > could we get this patch applied to the 3.8 branch?
>> >
>> > thanks,
>> > pl
>> >
>> >
>> > On 27 January 2016 at 11:02, Pavel Labath via lldb-commits
>> >  wrote:
>> >> Author: labath
>> >> Date: Wed Jan 27 05:02:02 2016
>> >> New Revision: 258921
>> >>
>> >> URL: http://llvm.org/viewvc/llvm-project?rev=258921=rev
>> >> Log:
>> >> Fix linking with LLVM_LINK_LLVM_DYLIB=ON
>> >>
>> >> Linking with LLVM shared libraries currently produces linker errors.
>> >> This works around the issue
>> >> (pr24953) by disabling linking with llvm so for lldb libraries.
>> >>
>> >> Patch by Evangelos Foutras.
>> >>
>> >> Reviewers: zturner
>> >>
>> >> Subscribers: lldb-commits
>> >>
>> >> Differential Revision: http://reviews.llvm.org/D16293
>> >>
>> >> Modified:
>> >> lldb/trunk/cmake/modules/AddLLDB.cmake
>> >>
>> >> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
>> >> URL:
>> >> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=258921=258920=258921=diff
>> >>
>> >> ==
>> >> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
>> >> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jan 27 05:02:02 2016
>> >> @@ -56,7 +56,7 @@ macro(add_lldb_library name)
>> >>if (PARAM_OBJECT)
>> >>  add_library(${name} ${libkind} ${srcs})
>> >>else()
>> >> -llvm_add_library(${name} ${libkind} ${srcs})
>> >> +llvm_add_library(${name} ${libkind} DISABLE_LLVM_LINK_LLVM_DYLIB
>> >> ${srcs})
>> >>
>> >>  lldb_link_common_libs(${name} "${libkind}")
>> >>
>> >> @@ -93,7 +93,7 @@ macro(add_lldb_library name)
>> >>  endmacro(add_lldb_library)
>> >>
>> >>  macro(add_lldb_executable name)
>> >> -  add_llvm_executable(${name} ${ARGN})
>> >> +  add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
>> >>set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
>> >>  endmacro(add_lldb_executable)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation

2016-01-25 Thread Hans Wennborg via lldb-commits
SGTM if Greg approves.

On Mon, Jan 25, 2016 at 2:03 AM, Bhushan Attarde
 wrote:
> Could you please add this to the release branch?
>
> Thanks,
> Bhushan
>
>
> -Original Message-
> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
> Bhushan D. Attarde via lldb-commits
> Sent: 22 January 2016 10:32
> To: lldb-commits@lists.llvm.org
> Subject: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for 
> dynamic checker function inserted by LLDB during expression evaluation
>
> Author: bhushan.attarde
> Date: Thu Jan 21 23:02:02 2016
> New Revision: 258485
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258485=rev
> Log:
> Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB 
> during expression evaluation
>
> SUMMARY:
> The symbol "$" has a special meaning for MIPS i.e it is marker for 
> temporary symbols for MIPS.
> So this patch uses additional _ prefix for "$__lldb_valid_pointer_check" 
> so that it wont be marked as temporary symbol in case of MIPS.
>
> Reviewers: clayborg, spyffe
> Subscribers: dean, emaste, mohit.bhakkad, sagar, jaydeep, lldb-commits
> Differential http://reviews.llvm.org/D14111
>
> Modified:
> lldb/trunk/source/Expression/IRDynamicChecks.cpp
>
> Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=258485=258484=258485=diff
> ==
> --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original)
> +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Thu Jan 21 23:02:02
> +++ 2016
> @@ -35,12 +35,12 @@ using namespace lldb_private;
>
>  static char ID;
>
> -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check"
> +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check"
>  #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check"
>
>  static const char g_valid_pointer_check_text[] =  "extern \"C\" void\n"
> -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
> +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
>  "{\n"
>  "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n"
>  "}";
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16284: Fix Makefile build

2016-01-19 Thread Hans Wennborg via lldb-commits
hans added a comment.

In http://reviews.llvm.org/D16284#329161, @loladiro wrote:

> The Makefile system will be removed from trunk very soon, so it might not 
> necessarily make sense there, but I think it would be good to get this 
> applied to release-38. @clayborg @hans how would you like to handle that? 
> Apply this to trunk and backport?


Yes, exactly.


http://reviews.llvm.org/D16284



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


Re: [Lldb-commits] [lldb] r257691 - Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.

2016-01-13 Thread Hans Wennborg via lldb-commits
On Wed, Jan 13, 2016 at 2:40 PM, Hans Wennborg via lldb-commits
<lldb-commits@lists.llvm.org> wrote:
> Author: hans
> Date: Wed Jan 13 16:40:24 2016
> New Revision: 257691
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257691=rev
> Log:
> Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.

Merged to 3.8 in r257704.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257691 - Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.

2016-01-13 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Wed Jan 13 16:40:24 2016
New Revision: 257691

URL: http://llvm.org/viewvc/llvm-project?rev=257691=rev
Log:
Include IR/DerivedTypes.h instead of IR/Type.h to match LLVM change r256406.

This is similar to r256407 and fixes the following warning:

In file included from 
/work/llvm-3.8/llvm.src/tools/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp:14:
In file included from 
/work/llvm-3.8/llvm.src/tools/lldb/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h:23:
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:350:16: error: inline function 
'llvm::Type::getSequentialElementType' is not defined 
[-Werror,-Wundefined-inline]
  inline Type *getSequentialElementType() const;
   ^
/work/llvm-3.8/llvm.src/include/llvm/IR/Type.h:353:46: note: used here
  Type *getArrayElementType() const { return getSequentialElementType(); }
 ^
1 error generated.

I'm not sure why it's not showing on any bots.

Modified:
lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h

Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h?rev=257691=257690=257691=diff
==
--- lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h Wed Jan 13 
16:40:24 2016
@@ -20,7 +20,7 @@
 #include "lldb/Target/ThreadPlanCallFunction.h"
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/IR/Type.h"
+#include "llvm/IR/DerivedTypes.h"
 
 namespace lldb_private {
 


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


[Lldb-commits] [lldb] r257692 - Fix -Wformat-pedantic warning

2016-01-13 Thread Hans Wennborg via lldb-commits
Author: hans
Date: Wed Jan 13 16:40:26 2016
New Revision: 257692

URL: http://llvm.org/viewvc/llvm-project?rev=257692=rev
Log:
Fix -Wformat-pedantic warning

/work/llvm-3.8/llvm.src/tools/lldb/source/API/SBProcess.cpp:1003:73:
error: format specifies type 'void *' but the argument has type 
'lldb_private::Event *' [-Werror,-Wformat-pedantic]
log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, 
event.get(), ret_val);
  ~~
^~~
1 error generated.

Modified:
lldb/trunk/source/API/SBProcess.cpp

Modified: lldb/trunk/source/API/SBProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=257692=257691=257692=diff
==
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Wed Jan 13 16:40:26 2016
@@ -1000,7 +1000,8 @@ SBProcess::GetRestartedFromEvent (const
 bool ret_val = Process::ProcessEventData::GetRestartedFromEvent 
(event.get());
 
 if (log)
-log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, 
event.get(), ret_val);
+log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__,
+ static_cast(event.get()), ret_val);
 
 return ret_val;
 }


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


Re: [Lldb-commits] [lldb] r257692 - Fix -Wformat-pedantic warning

2016-01-13 Thread Hans Wennborg via lldb-commits
On Wed, Jan 13, 2016 at 2:40 PM, Hans Wennborg via lldb-commits
<lldb-commits@lists.llvm.org> wrote:
> Author: hans
> Date: Wed Jan 13 16:40:26 2016
> New Revision: 257692
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257692=rev
> Log:
> Fix -Wformat-pedantic warning

Merged to 3.8 in r257706.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245547 - [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-21 Thread Hans Wennborg via lldb-commits
I'm not happy about this.

lldb builds fine on Linux for me. What's the build problem on mips? I
also don't see the relation between r245240 (which was also a large
patch) and this, but I haven't looked closely and am not familiar with
the code.

In general it would be nice if merge requests don't break the build. I
do check that the build works on x86_64 Linux before committing a
merge, but I don't have a mips machine.

RC3 was just tagged and will be the final release unless a critical
regression comes up.

If you need a build fix or revert for MIPS I'd be willing to squeeze
that in if we do an RC4 for some other reason, or before committing
the -final tag (but then it really has to be a mips-only change that
would not affect other platforms).


Thanks,
Hans

On Fri, Aug 21, 2015 at 3:17 AM,  sagar.tha...@imgtec.com wrote:
 Hi Tamas,

 The code in release branch will fail to compile on mips if we don’t merge
 this change because the commit r245240 in the release branch is dependant on
 this change.  If we don't want to merge this change to the release branch
 then we will have to revert r245240 from the release branch so that the code
 from release branch can compile properly.

 Thanks,
 Sagar


 On Friday 21 August 2015 03:06 PM, Tamas Berghammer wrote:

 Hi Sagar,

 I don't really happy with merging a big change to the release branch at the
 last moment (after RC3) especially as this commit caused several issues in
 the past and I don't think we tested it extensively enough to be sure it is
 works as intended at the moment.

 Is there any reason you really want this change in LLDB 3.7 considering that
 we won't create a binary with the release as far as I know?

 Thanks,
 Tamas

 On Fri, Aug 21, 2015 at 10:20 AM via lldb-commits
 lldb-commits@lists.llvm.org wrote:

 Hi Hans,

 Could you please merge r245547 to the release branch ?

 Thanks,
 Sagar

 On Thursday 20 August 2015 02:42 PM, Sagar Thakur via lldb-commits wrote:
  Author: slthakur
  Date: Thu Aug 20 04:12:46 2015
  New Revision: 245547
 
  URL: http://llvm.org/viewvc/llvm-project?rev=245547view=rev
  Log:
  [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue
 
  Eliminated ENABLE_128_BIT_SUPPORT and union ValueData from Scalar.cpp
  and use llvm::APInt and llvm::APFloat for all integer and floating point
  types. Also used Scalar in RegisterValue.cpp
 
  Reviewers: tberghammer, ovyalov, clayborg, labath
  Subscribers: lldb-commits, nitesh.jain, jaydeep
  Differential: http://reviews.llvm.org/D12100
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-18 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Fri, Aug 14, 2015 at 11:06 AM, Hans Wennborg h...@chromium.org wrote:
 Sure, if Greg approves.

 Thanks,
 Hans

 On Thu, Aug 13, 2015 at 11:25 PM, Bhushan Attarde
 bhushan.atta...@imgtec.com wrote:
 Hi Hans,

 Could you please merge this to the release branch?

 Thanks
 Bhushan


 -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
 Bhushan D. Attarde via lldb-commits
 Sent: 14 August 2015 09:11
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and 
 aggregate return types in SysV-mips [32 bit] ABI

 Author: bhushan.attarde
 Date: Thu Aug 13 22:40:31 2015
 New Revision: 245020

 URL: http://llvm.org/viewvc/llvm-project?rev=245020view=rev
 Log:
 [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] 
 ABI

 SUMMARY:
 This patch adds support of floating point and aggregate return types in 
 GetReturnValueObjectImpl() for mips32

 Reviewers: clayborg
 Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
 Differential Revision: http://reviews.llvm.org/D11930

 Modified:
 lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

 Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245020r1=245019r2=245020view=diff
 ==
 --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
 +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Thu Aug 13 
 22:40:31 2015
 @@ -423,15 +423,16 @@ ABISysV_mips::GetReturnValueObjectImpl (
  if (!reg_ctx)
  return return_valobj_sp;

 -bool is_signed;
 +bool is_signed = false;
 +bool is_complex = false;
 +uint32_t count = 0;

  // In MIPS register r2 (v0) holds the integer function return values
  const RegisterInfo *r2_reg_info = reg_ctx-GetRegisterInfoByName(r2, 
 0);
 +size_t bit_width = return_clang_type.GetBitSize(thread);

  if (return_clang_type.IsIntegerType (is_signed))
  {
 -size_t bit_width = return_clang_type.GetBitSize(thread);
 -
  switch (bit_width)
  {
  default:
 @@ -473,6 +474,52 @@ ABISysV_mips::GetReturnValueObjectImpl (
  uint32_t ptr = 
 thread.GetRegisterContext()-ReadRegisterAsUnsigned(r2_reg_info, 0)  
 UINT32_MAX;
  value.GetScalar() = ptr;
  }
 +else if (return_clang_type.IsAggregateType ())
 +{
 +// Structure/Vector is always passed in memory and pointer to that 
 memory is passed in r2.
 +uint64_t mem_address = 
 reg_ctx-ReadRegisterAsUnsigned(reg_ctx-GetRegisterInfoByName(r2, 0), 0);
 +// We have got the address. Create a memory object out of it
 +return_valobj_sp = ValueObjectMemory::Create (thread,
 +  ,
 +  Address (mem_address, 
 NULL),
 +  return_clang_type);
 +return return_valobj_sp;
 +}
 +else if (return_clang_type.IsFloatingPointType (count, is_complex))
 +{
 +const RegisterInfo *f0_info = reg_ctx-GetRegisterInfoByName(f0, 
 0);
 +const RegisterInfo *f1_info = reg_ctx-GetRegisterInfoByName(f1, 
 0);
 +
 +if (count == 1  !is_complex)
 +{
 +switch (bit_width)
 +{
 +default:
 +return return_valobj_sp;
 +case 64:
 +{
 +static_assert(sizeof(double) == sizeof(uint64_t), );
 +uint64_t raw_value;
 +raw_value = reg_ctx-ReadRegisterAsUnsigned(f0_info, 0) 
  UINT32_MAX;
 +raw_value |= 
 ((uint64_t)(reg_ctx-ReadRegisterAsUnsigned(f1_info, 0)  UINT32_MAX))  32;
 +value.GetScalar() = 
 *reinterpret_castdouble*(raw_value);
 +break;
 +}
 +case 32:
 +{
 +static_assert(sizeof(float) == sizeof(uint32_t), );
 +uint32_t raw_value = 
 reg_ctx-ReadRegisterAsUnsigned(f0_info, 0)  UINT32_MAX;
 +value.GetScalar() = 
 *reinterpret_castfloat*(raw_value);
 +break;
 +}
 +}
 +}
 +else
 +{
 +// not handled yet
 +return return_valobj_sp;
 +}
 +}
  else
  {
  // not handled yet


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

Re: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-17 Thread Hans Wennborg via lldb-commits
Merged to 3.7 in r245240. There was a conflicts because r245141 isn't
on the branch. Please check that I got it right:
http://llvm.org/viewvc/llvm-project?rev=245240view=rev

Thanks,
Hans

On Mon, Aug 17, 2015 at 1:28 PM, Greg Clayton clayb...@gmail.com wrote:
 Ok to merge.
 On Aug 17, 2015, at 1:26 PM, Hans Wennborg h...@chromium.org wrote:

 I'm OK with it if Greg approves.

 - Hans

 On Mon, Aug 17, 2015 at 7:07 AM,  sagar.tha...@imgtec.com wrote:
 Hi Hans,

 Could you please also merge r245217 in the release branch.

 Thanks,
 Sagar

 -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of
 Sagar Thakur via lldb-commits
 Sent: 17 August 2015 19:10
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all
 register sets and add MSA regset and FRE=1 mode support

 Author: slthakur
 Date: Mon Aug 17 08:40:17 2015
 New Revision: 245217

 URL: http://llvm.org/viewvc/llvm-project?rev=245217view=rev
 Log:
 [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1
 mode support

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


Re: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-17 Thread Hans Wennborg via lldb-commits
I'm OK with it if Greg approves.

 - Hans

On Mon, Aug 17, 2015 at 7:07 AM,  sagar.tha...@imgtec.com wrote:
 Hi Hans,

 Could you please also merge r245217 in the release branch.

 Thanks,
 Sagar

  -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of
 Sagar Thakur via lldb-commits
 Sent: 17 August 2015 19:10
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all
 register sets and add MSA regset and FRE=1 mode support

 Author: slthakur
 Date: Mon Aug 17 08:40:17 2015
 New Revision: 245217

 URL: http://llvm.org/viewvc/llvm-project?rev=245217view=rev
 Log:
 [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1
 mode support
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245216 - [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-17 Thread Hans Wennborg via lldb-commits
+lldb-commits

On Mon, Aug 17, 2015 at 1:25 PM, Hans Wennborg h...@chromium.org wrote:
 I'm OK with it if Greg approves.

  - Hans

 On Mon, Aug 17, 2015 at 7:06 AM,  sagar.tha...@imgtec.com wrote:
 Hi Hans,

 Could you please merge r245216 in the release branch?

 Thanks,
 Sagar

 -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of
 Sagar Thakur via lldb-commits
 Sent: 17 August 2015 17:36
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245216 - [LLDB] Use llvm::APInt and
 llvm::APFloat in Scalar and RegisterValue

 Author: slthakur
 Date: Mon Aug 17 07:05:31 2015
 New Revision: 245216

 URL: http://llvm.org/viewvc/llvm-project?rev=245216view=rev
 Log:
 [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-14 Thread Hans Wennborg via lldb-commits
Sure, if Greg approves.

Thanks,
Hans

On Thu, Aug 13, 2015 at 11:25 PM, Bhushan Attarde
bhushan.atta...@imgtec.com wrote:
 Hi Hans,

 Could you please merge this to the release branch?

 Thanks
 Bhushan


 -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
 Bhushan D. Attarde via lldb-commits
 Sent: 14 August 2015 09:11
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and 
 aggregate return types in SysV-mips [32 bit] ABI

 Author: bhushan.attarde
 Date: Thu Aug 13 22:40:31 2015
 New Revision: 245020

 URL: http://llvm.org/viewvc/llvm-project?rev=245020view=rev
 Log:
 [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] 
 ABI

 SUMMARY:
 This patch adds support of floating point and aggregate return types in 
 GetReturnValueObjectImpl() for mips32

 Reviewers: clayborg
 Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
 Differential Revision: http://reviews.llvm.org/D11930

 Modified:
 lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp

 Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245020r1=245019r2=245020view=diff
 ==
 --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
 +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Thu Aug 13 
 22:40:31 2015
 @@ -423,15 +423,16 @@ ABISysV_mips::GetReturnValueObjectImpl (
  if (!reg_ctx)
  return return_valobj_sp;

 -bool is_signed;
 +bool is_signed = false;
 +bool is_complex = false;
 +uint32_t count = 0;

  // In MIPS register r2 (v0) holds the integer function return values
  const RegisterInfo *r2_reg_info = reg_ctx-GetRegisterInfoByName(r2, 
 0);
 +size_t bit_width = return_clang_type.GetBitSize(thread);

  if (return_clang_type.IsIntegerType (is_signed))
  {
 -size_t bit_width = return_clang_type.GetBitSize(thread);
 -
  switch (bit_width)
  {
  default:
 @@ -473,6 +474,52 @@ ABISysV_mips::GetReturnValueObjectImpl (
  uint32_t ptr = 
 thread.GetRegisterContext()-ReadRegisterAsUnsigned(r2_reg_info, 0)  
 UINT32_MAX;
  value.GetScalar() = ptr;
  }
 +else if (return_clang_type.IsAggregateType ())
 +{
 +// Structure/Vector is always passed in memory and pointer to that 
 memory is passed in r2.
 +uint64_t mem_address = 
 reg_ctx-ReadRegisterAsUnsigned(reg_ctx-GetRegisterInfoByName(r2, 0), 0);
 +// We have got the address. Create a memory object out of it
 +return_valobj_sp = ValueObjectMemory::Create (thread,
 +  ,
 +  Address (mem_address, 
 NULL),
 +  return_clang_type);
 +return return_valobj_sp;
 +}
 +else if (return_clang_type.IsFloatingPointType (count, is_complex))
 +{
 +const RegisterInfo *f0_info = reg_ctx-GetRegisterInfoByName(f0, 
 0);
 +const RegisterInfo *f1_info = reg_ctx-GetRegisterInfoByName(f1, 
 0);
 +
 +if (count == 1  !is_complex)
 +{
 +switch (bit_width)
 +{
 +default:
 +return return_valobj_sp;
 +case 64:
 +{
 +static_assert(sizeof(double) == sizeof(uint64_t), );
 +uint64_t raw_value;
 +raw_value = reg_ctx-ReadRegisterAsUnsigned(f0_info, 0) 
  UINT32_MAX;
 +raw_value |= 
 ((uint64_t)(reg_ctx-ReadRegisterAsUnsigned(f1_info, 0)  UINT32_MAX))  32;
 +value.GetScalar() = 
 *reinterpret_castdouble*(raw_value);
 +break;
 +}
 +case 32:
 +{
 +static_assert(sizeof(float) == sizeof(uint32_t), );
 +uint32_t raw_value = 
 reg_ctx-ReadRegisterAsUnsigned(f0_info, 0)  UINT32_MAX;
 +value.GetScalar() = 
 *reinterpret_castfloat*(raw_value);
 +break;
 +}
 +}
 +}
 +else
 +{
 +// not handled yet
 +return return_valobj_sp;
 +}
 +}
  else
  {
  // not handled yet


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


Re: [Lldb-commits] [lldb] r243091 - Handle old style S packet correctly

2015-08-11 Thread Hans Wennborg via lldb-commits
Ping?

On Wed, Aug 5, 2015 at 1:20 PM, Hans Wennborg h...@chromium.org wrote:
 Ping?

 On Wed, Jul 29, 2015 at 8:56 AM, Hans Wennborg h...@chromium.org wrote:
 Greg, I believe you're the code owner here. OK to merge?

 On Tue, Jul 28, 2015 at 9:05 PM, Bhushan Attarde
 bhushan.atta...@imgtec.com wrote:
 Hi Hans,

 Could you please add this to the release branch?

 Thanks
 Bhushan

 -Original Message-
 From: lldb-commits-boun...@cs.uiuc.edu 
 [mailto:lldb-commits-boun...@cs.uiuc.edu] On Behalf Of Bhushan Attarde
 Sent: 24 July 2015 09:36
 To: lldb-comm...@cs.uiuc.edu
 Subject: [Lldb-commits] [lldb] r243091 - Handle old style S packet correctly

 Author: bhushan.attarde
 Date: Thu Jul 23 23:06:20 2015
 New Revision: 243091

 URL: http://llvm.org/viewvc/llvm-project?rev=243091view=rev
 Log:
 Handle old style S packet correctly

 SUMMARY:
 This patch fixes couple of issues:
 1. A thread tries to lock a mutex which is already locked.
 2. Updating a thread list before the stop packet is parsed so that it 
 can get a valid thread id and allows to set the stop info correctly.

 Reviewers: clayborg
 Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
 Differential Revision: http://reviews.llvm.org/D11449

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

 Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
 URL: 
 http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=243091r1=243090r2=243091view=diff
 ==
 --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
 (original)
 +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
 +++ Thu Jul 23 23:06:20 2015
 @@ -371,7 +371,7 @@ ProcessGDBRemote::ProcessGDBRemote(Targe
  m_flags (0),
  m_gdb_comm (),
  m_debugserver_pid (LLDB_INVALID_PROCESS_ID),
 -m_last_stop_packet_mutex (Mutex::eMutexTypeNormal),
 +m_last_stop_packet_mutex (Mutex::eMutexTypeRecursive),
  m_register_info (),
  m_async_broadcaster (NULL, 
 lldb.process.gdb-remote.async-broadcaster),
  m_async_thread_state_mutex(Mutex::eMutexTypeRecursive),
 @@ -2485,6 +2485,18 @@ ProcessGDBRemote::SetThreadStopInfo (Str
  }
  }

 +if (tid == LLDB_INVALID_THREAD_ID)
 +{
 +// A thread id may be invalid if the response is old style 
 'S' packet which does not provide the
 +// thread information. So update the thread list and 
 choose the first one.
 +UpdateThreadIDList ();
 +
 +if (!m_thread_ids.empty ())
 +{
 +tid = m_thread_ids.front ();
 +}
 +}
 +
  ThreadSP thread_sp = SetThreadStopInfo (tid,
  expedited_register_map,
  signo, @@ -2499,19 
 +2511,6 @@ ProcessGDBRemote::SetThreadStopInfo (Str
  queue_kind,
  queue_serial);

 -// If the response is old style 'S' packet which does not 
 provide us with thread information
 -// then update the thread list and choose the first one.
 -if (!thread_sp)
 -{
 -UpdateThreadIDList ();
 -
 -if (!m_thread_ids.empty ())
 -{
 -Mutex::Locker locker (m_thread_list_real.GetMutex ());
 -thread_sp = m_thread_list_real.FindThreadByProtocolID 
 (m_thread_ids.front (), false);
 -}
 -}
 -
  return eStateStopped;
  }
  break;


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