[Lldb-commits] [PATCH] D102140: [ppc64le] [lldb] [testsuite] Fix false FAILs on ppc64* with no hw watchpoints

2021-05-10 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 344000.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102140/new/

https://reviews.llvm.org/D102140

Files:
  lldb/packages/Python/lldbsuite/test/concurrent_base.py
  lldb/test/API/commands/watchpoints/hello_watchpoint/TestMyFirstWatchpoint.py
  
lldb/test/API/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py
  
lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
  
lldb/test/API/commands/watchpoints/watchpoint_commands/TestWatchpointCommands.py
  
lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandLLDB.py
  
lldb/test/API/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py
  
lldb/test/API/commands/watchpoints/watchpoint_commands/condition/TestWatchpointConditionCmd.py
  lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py
  lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py
  lldb/test/API/commands/watchpoints/watchpoint_events/TestWatchpointEvents.py
  
lldb/test/API/commands/watchpoints/watchpoint_on_vectors/TestValueOfVectorVariable.py
  
lldb/test/API/commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py
  lldb/test/API/commands/watchpoints/watchpoint_size/TestWatchpointSizes.py
  lldb/test/API/functionalities/completion/TestCompletion.py
  lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
  lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
  lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
  lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
  lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
  lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
  lldb/test/Shell/Subprocess/Inputs/check-follow-parent-wp.lldbinit
  lldb/test/Shell/Subprocess/clone-follow-parent-wp.test
  lldb/test/Shell/Subprocess/fork-follow-parent-wp.test
  lldb/test/Shell/Subprocess/vfork-follow-parent-wp.test

Index: lldb/test/Shell/Subprocess/vfork-follow-parent-wp.test
===
--- lldb/test/Shell/Subprocess/vfork-follow-parent-wp.test
+++ lldb/test/Shell/Subprocess/vfork-follow-parent-wp.test
@@ -2,7 +2,10 @@
 # UNSUPPORTED: system-windows
 # UNSUPPORTED: system-darwin
 # RUN: %clangxx_host -g %p/Inputs/fork.cpp -DTEST_FORK=vfork -o %t
-# RUN: %lldb -b -s %s %t | FileCheck %s
+# RUN: (test $(uname -m) = ppc64le \
+# RUN:  && (%lldb -b -s %p/Inputs/check-follow-parent-wp.lldbinit %t || true) \
+# RUN:2>&1 | FileCheck %p/Inputs/check-follow-parent-wp.lldbinit) \
+# RUN:   || %lldb -b -s %s %t | FileCheck %s
 process launch -s
 watchpoint set variable -w write g_val
 # CHECK: Watchpoint created:
Index: lldb/test/Shell/Subprocess/fork-follow-parent-wp.test
===
--- lldb/test/Shell/Subprocess/fork-follow-parent-wp.test
+++ lldb/test/Shell/Subprocess/fork-follow-parent-wp.test
@@ -1,7 +1,10 @@
 # REQUIRES: native && dbregs-set
 # UNSUPPORTED: system-windows
 # RUN: %clangxx_host -g %p/Inputs/fork.cpp -DTEST_FORK=fork -o %t
-# RUN: %lldb -b -s %s %t | FileCheck %s
+# RUN: (test $(uname -m) = ppc64le \
+# RUN:  && (%lldb -b -s %p/Inputs/check-follow-parent-wp.lldbinit %t || true) \
+# RUN:2>&1 | FileCheck %p/Inputs/check-follow-parent-wp.lldbinit) \
+# RUN:   || %lldb -b -s %s %t | FileCheck %s
 process launch -s
 watchpoint set variable -w write g_val
 # CHECK: Watchpoint created:
Index: lldb/test/Shell/Subprocess/clone-follow-parent-wp.test
===
--- lldb/test/Shell/Subprocess/clone-follow-parent-wp.test
+++ lldb/test/Shell/Subprocess/clone-follow-parent-wp.test
@@ -2,7 +2,10 @@
 # clone() tests fails on arm64 Linux, PR #49899
 # UNSUPPORTED: system-linux && target-aarch64
 # RUN: %clangxx_host -g %p/Inputs/fork.cpp -DTEST_CLONE -o %t
-# RUN: %lldb -b -s %s %t | FileCheck %s
+# RUN: (test $(uname -m) = ppc64le \
+# RUN:  && (%lldb -b -s %p/Inputs/check-follow-parent-wp.lldbinit %t || true) \
+# RUN:2>&1 | FileCheck %p/Inputs/check-follow-parent-wp.lldbinit) \
+# RUN:   || %lldb -b -s %s %t | FileCheck %s
 process launch -s
 watchpoint set variable -w write g_val
 # CHECK: Watchpoint created:
Index: lldb/test/Shell/Subprocess/Inputs/check-follow-parent-wp.lldbinit
===
--- /dev/null
+++ lldb/test/Shell/Subprocess/Inputs/check-follow-parent-wp.lldbinit
@@ -0,0 +1,3 @@
+process launch -s
+watchpoint set variable g_val
+# CHECK: error: Target supports (0) hardware watchpoint slots.
Index: lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
===
--- lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

[Lldb-commits] [PATCH] D102092: [lldb] Enable -Wmisleading-indentation

2021-05-10 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf44c6f20f5e9: [cmake] Enable -Wmisleading-indentation 
(authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102092/new/

https://reviews.llvm.org/D102092

Files:
  llvm/cmake/modules/HandleLLVMOptions.cmake


Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -759,6 +759,9 @@
 
   # Enable -Wstring-conversion to catch misuse of string literals.
   add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
+
+  # Prevent bugs that can happen with llvm's brace style.
+  add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG)
 endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
 
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)


Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -759,6 +759,9 @@
 
   # Enable -Wstring-conversion to catch misuse of string literals.
   add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
+
+  # Prevent bugs that can happen with llvm's brace style.
+  add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG)
 endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
 
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D102092: [lldb] Enable -Wmisleading-indentation

2021-05-10 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

Will keep an eye on buildbots, thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102092/new/

https://reviews.llvm.org/D102092

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


[Lldb-commits] [PATCH] D102085: Add an "interrupt timeout" to Process, fix a bug in handling interrupt timeouts in

2021-05-10 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments.



Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:3129
 uint8_t error_no = m_gdb_comm.SendGDBStoppointTypePacket(
-eBreakpointSoftware, true, addr, bp_op_size);
+eBreakpointSoftware, true, addr, bp_op_size, GetInterruptTimeout());
 if (error_no == 0) {

`/*insert=*/true`



Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:3169
 uint8_t error_no = m_gdb_comm.SendGDBStoppointTypePacket(
-eBreakpointHardware, true, addr, bp_op_size);
+eBreakpointHardware, true, addr, bp_op_size, GetInterruptTimeout());
 if (error_no == 0) {

`/*insert=*/true`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102085/new/

https://reviews.llvm.org/D102085

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


[Lldb-commits] [PATCH] D102085: Add an "interrupt timeout" to Process, fix a bug in handling interrupt timeouts in

2021-05-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Thanks for combining the functions and fine not to use Optional is we have a 
good value to indicate no timeout.

Just one inline comment where we can hopefully get rid of kWakeupInterval being 
a constant.




Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp:56
   for (;;) {
-PacketResult read_result = ReadPacket(response, kInterruptTimeout, false);
+PacketResult read_result = ReadPacket(response, kWakeupInterval, false);
 switch (read_result) {

Should we tailor this timeout a bit better to be related to the time left until 
we reach m_interrupt_endpoint? If we set the interrupt timeout to 1 second, we 
will wait for 5 seconds before we return. Maybe this should be calculated by 
subtracting m_interrupt_endpoint from steady_clock::now()?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102085/new/

https://reviews.llvm.org/D102085

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


[Lldb-commits] [PATCH] D101539: Add null-pointer checks when accessing a TypeSystem's SymbolFile

2021-05-10 Thread Augusto Noronha via Phabricator via lldb-commits
augusto2112 updated this revision to Diff 344151.
augusto2112 added a comment.

Add GetExeModuleWhenMissingSymbolFile tesst.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101539/new/

https://reviews.llvm.org/D101539

Files:
  lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Symbol/Type.cpp
  lldb/unittests/Symbol/TestTypeSystemClang.cpp

Index: lldb/unittests/Symbol/TestTypeSystemClang.cpp
===
--- lldb/unittests/Symbol/TestTypeSystemClang.cpp
+++ lldb/unittests/Symbol/TestTypeSystemClang.cpp
@@ -13,6 +13,7 @@
 #include "lldb/Core/Declaration.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/lldb-enumerations.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/ExprCXX.h"
@@ -741,3 +742,14 @@
   ScratchTypeSystemClang::IsolatedASTKind::CppModules,
   ScratchTypeSystemClang::InferIsolatedASTKindFromLangOpts(lang_opts));
 }
+
+TEST_F(TestTypeSystemClang, GetExeModuleWhenMissingSymbolFile) {
+  auto compiler_type = m_ast->GetBasicTypeFromAST(lldb::eBasicTypeInt);
+  lldb_private::Type t(0, nullptr, ConstString("MyType"), llvm::None, nullptr,
+   0, {}, {}, compiler_type,
+   lldb_private::Type::ResolveState::Full);
+  // Test that getting the execution module when no type system is present
+  // is handled gracefully.
+  auto module = t.GetExeModule();
+}
+
Index: lldb/source/Symbol/Type.cpp
===
--- lldb/source/Symbol/Type.cpp
+++ lldb/source/Symbol/Type.cpp
@@ -730,7 +730,8 @@
 ModuleSP Type::GetExeModule() {
   if (m_compiler_type) {
 SymbolFile *symbol_file = m_compiler_type.GetTypeSystem()->GetSymbolFile();
-return symbol_file->GetObjectFile()->GetModule();
+if (symbol_file)
+  return symbol_file->GetObjectFile()->GetModule();
   }
   return ModuleSP();
 }
Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
===
--- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -9306,11 +9306,11 @@
 std::vector TypeSystemClang::DeclContextFindDeclByName(
 void *opaque_decl_ctx, ConstString name, const bool ignore_using_decls) {
   std::vector found_decls;
-  if (opaque_decl_ctx) {
+  SymbolFile *symbol_file = GetSymbolFile();
+  if (opaque_decl_ctx && symbol_file) {
 DeclContext *root_decl_ctx = (DeclContext *)opaque_decl_ctx;
 std::set searched;
 std::multimap search_queue;
-SymbolFile *symbol_file = GetSymbolFile();
 
 for (clang::DeclContext *decl_context = root_decl_ctx;
  decl_context != nullptr && found_decls.empty();
@@ -9404,10 +9404,10 @@
   clang::DeclContext *child_decl_ctx,
   ConstString *child_name,
   CompilerType *child_type) {
-  if (frame_decl_ctx) {
+  SymbolFile *symbol_file = GetSymbolFile();
+  if (frame_decl_ctx && symbol_file) {
 std::set searched;
 std::multimap search_queue;
-SymbolFile *symbol_file = GetSymbolFile();
 
 // Get the lookup scope for the decl we're trying to find.
 clang::DeclContext *parent_decl_ctx = child_decl_ctx->getParent();
Index: lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===
--- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -534,8 +534,12 @@
 auto type_def = llvm::dyn_cast(&type);
 assert(type_def);
 
+SymbolFile *symbol_file = m_ast.GetSymbolFile();
+if (!symbol_file)
+  return nullptr;
+
 lldb_private::Type *target_type =
-m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId());
+symbol_file->ResolveTypeUID(type_def->getTypeId());
 if (!target_type)
   return nullptr;
 
@@ -609,8 +613,13 @@
   auto arg = arg_enum->getChildAtIndex(arg_idx);
   if (!arg)
 break;
+
+  SymbolFile *symbol_file = m_ast.GetSymbolFile();
+  if (!symbol_file)
+return nullptr;
+
   lldb_private::Type *arg_type =
-  m_ast.GetSymbolFile()->ResolveTypeUID(arg->getSymIndexId());
+  symbol_file->ResolveTypeUID(arg->getSymIndexId());
   // If there's some error looking up one of the dependent types of this
   // function signature, bail.
   if (!arg_type)
@@ -621,8 +630,12 @@
 lldbassert(arg_list.size() <= num_args);
 
 auto pdb_return_type = func_sig->getReturnType();
+SymbolFile *symbol_file = m_ast.GetSymbolFile();
+if (!symbol_file)
+  return nullptr;
+
 lldb_private::Type *return_type =
-m_ast.GetSymbolFile()->ResolveT

[Lldb-commits] [PATCH] D101539: Add null-pointer checks when accessing a TypeSystem's SymbolFile

2021-05-10 Thread Augusto Noronha via Phabricator via lldb-commits
augusto2112 added a comment.

@teemperor let me know if this test is OK, or if there's a better way to test 
this :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101539/new/

https://reviews.llvm.org/D101539

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


[Lldb-commits] [PATCH] D101539: Add null-pointer checks when accessing a TypeSystem's SymbolFile

2021-05-10 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.

LGTM, just some nits and please address the clang-format issue.




Comment at: lldb/unittests/Symbol/TestTypeSystemClang.cpp:747
+TEST_F(TestTypeSystemClang, GetExeModuleWhenMissingSymbolFile) {
+  auto compiler_type = m_ast->GetBasicTypeFromAST(lldb::eBasicTypeInt);
+  lldb_private::Type t(0, nullptr, ConstString("MyType"), llvm::None, nullptr,

Can you make that `CompilerType`? (Just because it's not clear what this 
returns, e.g. Type or CompilerType)



Comment at: lldb/unittests/Symbol/TestTypeSystemClang.cpp:753
+  // is handled gracefully.
+  auto module = t.GetExeModule();
+}

Can you also spell out the auto type and check that this is a nullptr? 
`EXPECT_EQ(module, nullptr);` Right now this could return some random pointer 
and pass.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101539/new/

https://reviews.llvm.org/D101539

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


[Lldb-commits] [lldb] 6dc2a6a - Remove some unnecessary explicit defaulted copy ctors to cleanup -Wdeprecated-copy

2021-05-10 Thread David Blaikie via lldb-commits

Author: David Blaikie
Date: 2021-05-10T14:31:11-07:00
New Revision: 6dc2a6a8c9a0e4f8b46a0ba05430b77229789b8e

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

LOG: Remove some unnecessary explicit defaulted copy ctors to cleanup 
-Wdeprecated-copy

These types also wanted to be/were copy assignable, and using the
implicit copy ctor is deprecated in the presence of an explicit copy
ctor.

Removing the explicit copy ctor provides the desired behavior - both
ctor and assignment operator are available implicitly.

Also while I was nearby there were some missing std::moves on shared
pointer parameters.

Added: 


Modified: 
lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
lldb/include/lldb/Symbol/UnwindPlan.h
lldb/include/lldb/Utility/Timeout.h
lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp

Removed: 




diff  --git a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h 
b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
index 2f3bdf80a6f17..4d54f03a2e03c 100644
--- a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
+++ b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
@@ -62,8 +62,6 @@ class DumpValueObjectOptions {
 
   DumpValueObjectOptions();
 
-  DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default;
-
   DumpValueObjectOptions(ValueObject &valobj);
 
   DumpValueObjectOptions &

diff  --git a/lldb/include/lldb/Symbol/UnwindPlan.h 
b/lldb/include/lldb/Symbol/UnwindPlan.h
index 06c76ca80796b..f8d23d7b7f231 100644
--- a/lldb/include/lldb/Symbol/UnwindPlan.h
+++ b/lldb/include/lldb/Symbol/UnwindPlan.h
@@ -322,8 +322,6 @@ class UnwindPlan {
 
 Row();
 
-Row(const UnwindPlan::Row &rhs) = default;
-
 bool operator==(const Row &rhs) const;
 
 bool GetRegisterInfo(uint32_t reg_num,

diff  --git a/lldb/include/lldb/Utility/Timeout.h 
b/lldb/include/lldb/Utility/Timeout.h
index 80e2015155770..29f8c1bbee380 100644
--- a/lldb/include/lldb/Utility/Timeout.h
+++ b/lldb/include/lldb/Utility/Timeout.h
@@ -37,7 +37,6 @@ class Timeout : public 
llvm::Optional> {
 
 public:
   Timeout(llvm::NoneType none) : Base(none) {}
-  Timeout(const Timeout &other) = default;
 
   template ::type>

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
index 0d5ae16a0b295..47c6634ed65e6 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
@@ -27,8 +27,7 @@ namespace {
 class ListEntry {
 public:
   ListEntry() = default;
-  ListEntry(ValueObjectSP entry_sp) : m_entry_sp(entry_sp) {}
-  ListEntry(const ListEntry &rhs) = default;
+  ListEntry(ValueObjectSP entry_sp) : m_entry_sp(std::move(entry_sp)) {}
   ListEntry(ValueObject *entry)
   : m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {}
 
@@ -73,9 +72,8 @@ class ListEntry {
 class ListIterator {
 public:
   ListIterator() = default;
-  ListIterator(ListEntry entry) : m_entry(entry) {}
-  ListIterator(ValueObjectSP entry) : m_entry(entry) {}
-  ListIterator(const ListIterator &rhs) = default;
+  ListIterator(ListEntry entry) : m_entry(std::move(entry)) {}
+  ListIterator(ValueObjectSP entry) : m_entry(std::move(entry)) {}
   ListIterator(ValueObject *entry) : m_entry(entry) {}
 
   ValueObjectSP value() { return m_entry.GetEntry(); }

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index 64a199e24e4a5..25c2bfd9387bb 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -26,7 +26,6 @@ class MapEntry {
 public:
   MapEntry() = default;
   explicit MapEntry(ValueObjectSP entry_sp) : m_entry_sp(entry_sp) {}
-  MapEntry(const MapEntry &rhs) = default;
   explicit MapEntry(ValueObject *entry)
   : m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {}
 
@@ -86,9 +85,9 @@ class MapIterator {
 public:
   MapIterator() = default;
   MapIterator(MapEntry entry, size_t depth = 0)
-  : m_entry(entry), m_max_depth(depth), m_error(false) {}
+  : m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {}
   MapIterator(ValueObjectSP entry, size_t depth = 0)
-  : m_entry(entry), m_max_depth(depth), m_error(false) {}
+  : m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {}
   MapIterator(const MapIterator &rhs)
   : m_entry(rhs.m_entry), m_max_depth(rhs.m_max_depth), m_error(false) {}
   MapIterator(ValueObject *entry, size_t depth = 0)
@@ -138,7 +137,7 @@ class MapIterator {
   }
 
 private:
-  MapEntry tree_min(MapEntry &&x) {
+  MapEntry tree_min(MapEntry x) {
 if (x.null())
  

[Lldb-commits] [PATCH] D102085: Add an "interrupt timeout" to Process, fix a bug in handling interrupt timeouts in

2021-05-10 Thread Jim Ingham via Phabricator via lldb-commits
jingham updated this revision to Diff 344213.
jingham added a comment.

When the ReadPacket call in SendContinuePacketAndWaitForResponse wakes up due 
to the wakeup timeout, and there's an interrupt which hasn't reached it's 
endpoint, shorten the wakeup interval so we don't wait longer than the 
interrupt endpoint.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102085/new/

https://reviews.llvm.org/D102085

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/TargetProperties.td
  lldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
  lldb/unittests/tools/lldb-server/tests/TestClient.cpp

Index: lldb/unittests/tools/lldb-server/tests/TestClient.cpp
===
--- lldb/unittests/tools/lldb-server/tests/TestClient.cpp
+++ lldb/unittests/tools/lldb-server/tests/TestClient.cpp
@@ -193,7 +193,7 @@
   PacketResult expected_result) {
   StringExtractorGDBRemote response;
   GTEST_LOG_(INFO) << "Send Packet: " << message.str();
-  PacketResult result = SendPacketAndWaitForResponse(message, response, false);
+  PacketResult result = SendPacketAndWaitForResponse(message, response);
   response.GetEscapedBinaryData(response_string);
   GTEST_LOG_(INFO) << "Read Packet: " << response_string;
   if (result != expected_result)
Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -385,8 +385,9 @@
   TraceSupportedResponse trace_type;
   std::string error_message;
   auto callback = [&] {
+std::chrono::seconds timeout(10);
 if (llvm::Expected trace_type_or_err =
-client.SendTraceSupported()) {
+client.SendTraceSupported(timeout)) {
   trace_type = *trace_type_or_err;
   error_message = "";
   return true;
Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -55,6 +55,8 @@
   }
 
 protected:
+  // We don't have a process to get the interrupt timeout from, so make one up.
+  static std::chrono::seconds g_timeout;
   TestClient client;
   MockServer server;
   MockDelegate delegate;
@@ -62,7 +64,8 @@
 
   StateType SendCPacket(StringExtractorGDBRemote &response) {
 return client.SendContinuePacketAndWaitForResponse(delegate, LinuxSignals(),
-   "c", response);
+   "c", g_timeout, 
+   response);
   }
 
   void WaitForRunEvent() {
@@ -72,6 +75,8 @@
   }
 };
 
+std::chrono::seconds GDBRemoteClientBaseTest::g_timeout(10);
+
 } // end anonymous namespace
 
 TEST_F(GDBRemoteClientBaseTest, SendContinueAndWait) {
@@ -103,7 +108,7 @@
   StringExtractorGDBRemote continue_response, response;
 
   // SendAsyncSignal should do nothing when we are not running.
-  ASSERT_FALSE(client.SendAsyncSignal(0x47));
+  ASSERT_FALSE(client.SendAsyncSignal(0x47, g_timeout));
 
   // Continue. After the run packet is sent, send an async signal.
   std::future continue_state = std::async(
@@ -112,8 +117,9 @@
   ASSERT_EQ("c", response.GetStringRef());
   WaitForRunEvent();
 
-  std::future async_result = std::async(
-  std::launch::async, [&] { return client.SendAsyncSignal(0x47); });
+  std::future async_result = std::async(std::launch::async, [&] {
+return client.SendAsyncSignal(0x47, g_timeout);
+  });
 
   // First we'll get interrupted.
   ASSERT_EQ(PacketResult::Success, server.GetPacket(response));
@@ -133,7 +139,6 @@
 
 TEST_F(GDBRemoteClientBaseTest, SendContinueAndAsyncPacket) {
   StringExtractorGDBRemote continue_response, async_response, response;
-  const bool send_async = true;
 
   // Continue. After the run packet is sent, send an async packet.
   std::future continue_state = std::async(
@@ -143,13 +148,12 @@
   WaitForRunEvent();
 
   // Sending without async enabled should fail.

[Lldb-commits] [PATCH] D102085: Add an "interrupt timeout" to Process, fix a bug in handling interrupt timeouts in

2021-05-10 Thread Jim Ingham via Phabricator via lldb-commits
jingham marked an inline comment as done.
jingham added a comment.

Was that what you had in mind, Greg?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102085/new/

https://reviews.llvm.org/D102085

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


[Lldb-commits] [PATCH] D102085: Add an "interrupt timeout" to Process, fix a bug in handling interrupt timeouts in

2021-05-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

In D102085#2749112 , @jingham wrote:

> Was that what you had in mind, Greg?

Yes! Thanks for all the changes. LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102085/new/

https://reviews.llvm.org/D102085

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