[Lldb-commits] [PATCH] D106985: [lldb] [gdb-remote] Sync vFile:open mode constants with GDB

2021-08-01 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

@jasonmolenda, thanks for the review. Could you also look at D106984 
 which is a prerequisite for this?


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

https://reviews.llvm.org/D106985

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


[Lldb-commits] [PATCH] D107161: [lldb] Fix lookup of .debug_loclists with split-dwarf

2021-08-01 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil accepted this revision.
jankratochvil added a comment.
This revision is now accepted and ready to land.

LGTM with some those adjustments.




Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:450
+if (!contribution)
+  return;
+offset += contribution->Offset;

There could be some `ReportError`.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:466
 "Failed to extract location list table at offset 0x%" PRIx64 ": %s",
 loclists_base, toString(std::move(E)).c_str());
   }

`loclists_base` should be adjusted or printed also together with `offset` or so.




Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:15-16
+nop
+.Ltmp0:
+nop
+.Ltmp1:

.Ltmp0 is not used.




Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:55
+.quad   1026699901672188186  # DWO id
+.byte   1   # Abbrev [1] 0xc:0x5f 
DW_TAG_compile_unit
+.asciz  "debug_loclists-dwp.dwo"  # DW_AT_dwo_name

Offsets not valid.



Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:186
+.quad   1026699901672188186  # DWO id
+.byte   1   # Abbrev [1] 0xb:0x50 
DW_TAG_compile_unit
+.asciz  "Hand-written DWARF"# DW_AT_producer

These offsets are no longer valid.




Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:189
+.short  12  # DW_AT_language
+.byte   2   # Abbrev [2] 0x2a:0x29 
DW_TAG_subprogram
+.byte   0   # DW_AT_low_pc

Likewise.



Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:204
+.Lint:
+.byte   4   # Abbrev [4] 0x53:0x7 DW_TAG_base_type
+.asciz  "int"   # DW_AT_name

Likewise.



Comment at: lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwp.s:211-236
+  .section .debug_cu_index, "", @progbits
+## Header:
+   .short 5# Version
+   .short 0# Padding
+   .long 3 # Section count
+   .long 1 # Unit count
+   .long 2 # Slot count

There could be the standard indentation.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107161

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


[Lldb-commits] [lldb] 41d0b20 - [lldb] Avoid moving ThreadPlanSP from plans vector

2021-08-01 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2021-08-01T10:40:04-07:00
New Revision: 41d0b20cc90f2aea25b4306f6c8f6c258ca3d377

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

LOG: [lldb] Avoid moving ThreadPlanSP from plans vector

Change `ThreadPlanStack::PopPlan` and `::DiscardPlan` to not do the following:

1. Move the last plan, leaving a moved `ThreadPlanSP` in the plans vector
2. Operate on the last plan
3. Pop the last plan off the plans vector

This leaves a period of time where the last element in the plans vector has 
been moved. I am not sure what, if any, guarantees there are when doing this, 
but it seems like it would/could leave a null `ThreadPlanSP` in the container. 
There are asserts in place to prevent empty/null `ThreadPlanSP` instances from 
being pushed on to the stack, and so this could break that invariant during 
multithreaded access to the thread plan stack.

An open question is whether this use of `std::move` was the result of a measure 
performance problem.

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

Added: 


Modified: 
lldb/include/lldb/Target/ThreadPlan.h
lldb/include/lldb/Target/ThreadPlanCallFunction.h
lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
lldb/source/Target/ThreadPlan.cpp
lldb/source/Target/ThreadPlanCallFunction.cpp
lldb/source/Target/ThreadPlanCallUserExpression.cpp
lldb/source/Target/ThreadPlanStack.cpp
lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/ThreadPlan.h 
b/lldb/include/lldb/Target/ThreadPlan.h
index 5e14a1fd6577d..58d6ef5fef8ba 100644
--- a/lldb/include/lldb/Target/ThreadPlan.h
+++ b/lldb/include/lldb/Target/ThreadPlan.h
@@ -81,7 +81,7 @@ namespace lldb_private {
 //
 //  Cleaning up after your plans:
 //
-//  When the plan is moved from the plan stack its WillPop method is always
+//  When the plan is moved from the plan stack its DidPop method is always
 //  called, no matter why.  Once it is moved off the plan stack it is done, and
 //  won't get a chance to run again.  So you should undo anything that affects
 //  target state in this method.  But be sure to leave the plan able to
@@ -413,7 +413,7 @@ class ThreadPlan : public 
std::enable_shared_from_this,
 
   virtual void DidPush();
 
-  virtual void WillPop();
+  virtual void DidPop();
 
   ThreadPlanKind GetKind() const { return m_kind; }
 

diff  --git a/lldb/include/lldb/Target/ThreadPlanCallFunction.h 
b/lldb/include/lldb/Target/ThreadPlanCallFunction.h
index 24c5736f44c3f..cb6e7caebb4ad 100644
--- a/lldb/include/lldb/Target/ThreadPlanCallFunction.h
+++ b/lldb/include/lldb/Target/ThreadPlanCallFunction.h
@@ -68,10 +68,10 @@ class ThreadPlanCallFunction : public ThreadPlan {
   // been cleaned up.
   lldb::addr_t GetFunctionStackPointer() { return m_function_sp; }
 
-  // Classes that derive from FunctionCaller, and implement their own WillPop
+  // Classes that derive from FunctionCaller, and implement their own DidPop
   // methods should call this so that the thread state gets restored if the
   // plan gets discarded.
-  void WillPop() override;
+  void DidPop() override;
 
   // If the thread plan stops mid-course, this will be the stop reason that
   // interrupted us. Once DoTakedown is called, this will be the real stop

diff  --git a/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h 
b/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
index adaea6c7056fe..11e126a2da9cb 100644
--- a/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
+++ b/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
@@ -32,7 +32,7 @@ class ThreadPlanCallUserExpression : public 
ThreadPlanCallFunction {
 
   void DidPush() override;
 
-  void WillPop() override;
+  void DidPop() override;
 
   lldb::StopInfoSP GetRealStopInfo() override;
 

diff  --git a/lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h 
b/lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
index 86f7798487c30..1f3aff45c49ab 100644
--- a/lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+++ b/lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
@@ -26,7 +26,7 @@ class ThreadPlanStepOverBreakpoint : public ThreadPlan {
   bool StopOthers() override;
   lldb::StateType GetPlanRunState() override;
   bool WillStop() override;
-  void WillPop() override;
+  void DidPop() override;
   bool MischiefManaged() override;
   void ThreadDestroyed() override;
   void SetAutoContinue(bool do_it);

diff  --git a/lldb/source/Target/ThreadPlan.cpp 
b/lldb/source/Target/ThreadPlan.cpp
index 6b55f3912d11b..b996cb1d432a2 100644
--- a/lldb/source/Target/ThreadPlan.cpp
+++ b/lldb/source/Target/ThreadPlan.cpp
@@ -149,7 +149,7 @@ lldb::user_id_t ThreadPl

[Lldb-commits] [PATCH] D106171: [lldb] Avoid moving ThreadPlanSP from plans vector

2021-08-01 Thread Dave Lee via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG41d0b20cc90f: [lldb] Avoid moving ThreadPlanSP from plans 
vector (authored by kastiglione).

Changed prior to commit:
  https://reviews.llvm.org/D106171?vs=362880&id=363345#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106171

Files:
  lldb/include/lldb/Target/ThreadPlan.h
  lldb/include/lldb/Target/ThreadPlanCallFunction.h
  lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
  lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
  lldb/source/Target/ThreadPlan.cpp
  lldb/source/Target/ThreadPlanCallFunction.cpp
  lldb/source/Target/ThreadPlanCallUserExpression.cpp
  lldb/source/Target/ThreadPlanStack.cpp
  lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp

Index: lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
===
--- lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
+++ lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
@@ -124,9 +124,7 @@
   return true;
 }
 
-void ThreadPlanStepOverBreakpoint::WillPop() {
-  ReenableBreakpointSite();
-}
+void ThreadPlanStepOverBreakpoint::DidPop() { ReenableBreakpointSite(); }
 
 bool ThreadPlanStepOverBreakpoint::MischiefManaged() {
   lldb::addr_t pc_addr = GetThread().GetRegisterContext()->GetPC();
Index: lldb/source/Target/ThreadPlanStack.cpp
===
--- lldb/source/Target/ThreadPlanStack.cpp
+++ lldb/source/Target/ThreadPlanStack.cpp
@@ -150,10 +150,13 @@
   std::lock_guard guard(m_stack_mutex);
   assert(m_plans.size() > 1 && "Can't pop the base thread plan");
 
-  lldb::ThreadPlanSP plan_sp = std::move(m_plans.back());
-  m_completed_plans.push_back(plan_sp);
-  plan_sp->WillPop();
+  // Note that moving the top element of the vector would leave it in an
+  // undefined state, and break the guarantee that the stack's thread plans are
+  // all valid.
+  lldb::ThreadPlanSP plan_sp = m_plans.back();
   m_plans.pop_back();
+  m_completed_plans.push_back(plan_sp);
+  plan_sp->DidPop();
   return plan_sp;
 }
 
@@ -161,10 +164,13 @@
   std::lock_guard guard(m_stack_mutex);
   assert(m_plans.size() > 1 && "Can't discard the base thread plan");
 
-  lldb::ThreadPlanSP plan_sp = std::move(m_plans.back());
-  m_discarded_plans.push_back(plan_sp);
-  plan_sp->WillPop();
+  // Note that moving the top element of the vector would leave it in an
+  // undefined state, and break the guarantee that the stack's thread plans are
+  // all valid.
+  lldb::ThreadPlanSP plan_sp = m_plans.back();
   m_plans.pop_back();
+  m_discarded_plans.push_back(plan_sp);
+  plan_sp->DidPop();
   return plan_sp;
 }
 
Index: lldb/source/Target/ThreadPlanCallUserExpression.cpp
===
--- lldb/source/Target/ThreadPlanCallUserExpression.cpp
+++ lldb/source/Target/ThreadPlanCallUserExpression.cpp
@@ -59,8 +59,8 @@
 m_user_expression_sp->WillStartExecuting();
 }
 
-void ThreadPlanCallUserExpression::WillPop() {
-  ThreadPlanCallFunction::WillPop();
+void ThreadPlanCallUserExpression::DidPop() {
+  ThreadPlanCallFunction::DidPop();
   if (m_user_expression_sp)
 m_user_expression_sp.reset();
 }
Index: lldb/source/Target/ThreadPlanCallFunction.cpp
===
--- lldb/source/Target/ThreadPlanCallFunction.cpp
+++ lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -209,7 +209,7 @@
   }
 }
 
-void ThreadPlanCallFunction::WillPop() { DoTakedown(PlanSucceeded()); }
+void ThreadPlanCallFunction::DidPop() { DoTakedown(PlanSucceeded()); }
 
 void ThreadPlanCallFunction::GetDescription(Stream *s, DescriptionLevel level) {
   if (level == eDescriptionLevelBrief) {
Index: lldb/source/Target/ThreadPlan.cpp
===
--- lldb/source/Target/ThreadPlan.cpp
+++ lldb/source/Target/ThreadPlan.cpp
@@ -149,7 +149,7 @@
 
 void ThreadPlan::DidPush() {}
 
-void ThreadPlan::WillPop() {}
+void ThreadPlan::DidPop() {}
 
 bool ThreadPlan::OkayToDiscard() {
   return IsMasterPlan() ? m_okay_to_discard : true;
Index: lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
===
--- lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+++ lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
@@ -26,7 +26,7 @@
   bool StopOthers() override;
   lldb::StateType GetPlanRunState() override;
   bool WillStop() override;
-  void WillPop() override;
+  void DidPop() override;
   bool MischiefManaged() override;
   void ThreadDestroyed() override;
   void SetAutoContinue(bool do_it);
Index: lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
===
--- lldb/incl

[Lldb-commits] [PATCH] D106035: Remove conditional compilation for WCHAR support in libedit

2021-08-01 Thread Neal via Phabricator via lldb-commits
nealsid updated this revision to Diff 363358.
nealsid added a comment.

Update against HEAD (I still need to do a bit more testing but wanted to get 
the buildbot results in the meantime)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106035

Files:
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/include/lldb/Host/Editline.h
  lldb/source/Host/common/Editline.cpp

Index: lldb/source/Host/common/Editline.cpp
===
--- lldb/source/Host/common/Editline.cpp
+++ lldb/source/Host/common/Editline.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include 
+#include 
 #include 
 
 #include "lldb/Host/Editline.h"
@@ -61,40 +62,12 @@
 #define ANSI_UP_N_ROWS ESCAPE "[%dA"
 #define ANSI_DOWN_N_ROWS ESCAPE "[%dB"
 
-#if LLDB_EDITLINE_USE_WCHAR
-
-#define EditLineConstString(str) L##str
-#define EditLineStringFormatSpec "%ls"
-
-#else
-
 #define EditLineConstString(str) str
 #define EditLineStringFormatSpec "%s"
 
-// use #defines so wide version functions and structs will resolve to old
-// versions for case of libedit not built with wide char support
-#define history_w history
-#define history_winit history_init
-#define history_wend history_end
-#define HistoryW History
-#define HistEventW HistEvent
-#define LineInfoW LineInfo
-
-#define el_wgets el_gets
-#define el_wgetc el_getc
-#define el_wpush el_push
-#define el_wparse el_parse
-#define el_wset el_set
-#define el_wget el_get
-#define el_wline el_line
-#define el_winsertstr el_insertstr
-#define el_wdeletestr el_deletestr
-
-#endif // #if LLDB_EDITLINE_USE_WCHAR
-
-bool IsOnlySpaces(const EditLineStringType &content) {
-  for (wchar_t ch : content) {
-if (ch != EditLineCharType(' '))
+bool IsOnlySpaces(const std::string &content) {
+  for (char ch : content) {
+if (ch != ' ')
   return false;
   }
   return true;
@@ -132,17 +105,16 @@
   llvm_unreachable("Fully covered switch!");
 }
 
-
-EditLineStringType CombineLines(const std::vector &lines) {
-  EditLineStringStreamType combined_stream;
-  for (EditLineStringType line : lines) {
+std::string CombineLines(const std::vector &lines) {
+  std::stringstream combined_stream;
+  for (const std::string &line : lines) {
 combined_stream << line.c_str() << "\n";
   }
   return combined_stream.str();
 }
 
-std::vector SplitLines(const EditLineStringType &input) {
-  std::vector result;
+std::vector SplitLines(const std::string &input) {
+  std::vector result;
   size_t start = 0;
   while (start < input.length()) {
 size_t end = input.find('\n', start);
@@ -161,23 +133,18 @@
   return result;
 }
 
-EditLineStringType FixIndentation(const EditLineStringType &line,
-  int indent_correction) {
+std::string FixIndentation(const std::string &line, int indent_correction) {
   if (indent_correction == 0)
 return line;
   if (indent_correction < 0)
 return line.substr(-indent_correction);
-  return EditLineStringType(indent_correction, EditLineCharType(' ')) + line;
+  return std::string(indent_correction, ' ') + line;
 }
 
-int GetIndentation(const EditLineStringType &line) {
-  int space_count = 0;
-  for (EditLineCharType ch : line) {
-if (ch != EditLineCharType(' '))
-  break;
-++space_count;
-  }
-  return space_count;
+int GetIndentation(const std::string &line) {
+  auto firstNonSpace = std::find_if(line.begin(), line.end(),
+[](const char ch) { return ch != ' '; });
+  return firstNonSpace - line.begin();
 }
 
 bool IsInputPending(FILE *file) {
@@ -206,10 +173,10 @@
   // these objects
   EditlineHistory(const std::string &prefix, uint32_t size, bool unique_entries)
   : m_history(nullptr), m_event(), m_prefix(prefix), m_path() {
-m_history = history_winit();
-history_w(m_history, &m_event, H_SETSIZE, size);
+m_history = history_init();
+history(m_history, &m_event, H_SETSIZE, size);
 if (unique_entries)
-  history_w(m_history, &m_event, H_SETUNIQUE, 1);
+  history(m_history, &m_event, H_SETUNIQUE, 1);
   }
 
   const char *GetHistoryFilePath() {
@@ -222,11 +189,7 @@
   // LLDB stores its history in ~/.lldb/. If for some reason this directory
   // isn't writable or cannot be created, history won't be available.
   if (!llvm::sys::fs::create_directory(lldb_history_file)) {
-#if LLDB_EDITLINE_USE_WCHAR
-std::string filename = m_prefix + "-widehistory";
-#else
 std::string filename = m_prefix + "-history";
-#endif
 llvm::sys::path::append(lldb_history_file, filename);
 m_path = std::string(lldb_history_file.str());
   }
@@ -243,7 +206,7 @@
 Save();
 
 if (m_history) {
-  history_wend(m_history);
+  history_end(m_history);
   m_history = nullptr;
 }
   }
@@ -268,18 +231,18 @@
 
   bool IsValid() const { return m_histo

[Lldb-commits] [lldb] 8f30db8 - [LLDB] Skip random failing tests on Arm/AArch64 Linux bots

2021-08-01 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-08-02T05:24:05+05:00
New Revision: 8f30db8794125db2a768fbb3b20b0b1511ea211c

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

LOG: [LLDB] Skip random failing tests on Arm/AArch64 Linux bots

Following tests have been failing randomly on LLDB Arm and AArch64 Linux
builtbots:

TestMultilineNavigation.py
TestMultilineCompletion.py
TestIOHandlerCompletion.py
TestGuiBasic.py

I have increased allocated CPU resources to these bots but it has not
improved situation to an acceptable level. This patch marks them as
skipped on Arm/AArch64 for now.

Added: 


Modified: 

lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py

lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
lldb/test/API/commands/gui/basic/TestGuiBasic.py
lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py

Removed: 




diff  --git 
a/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py
 
b/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py
index 0d6f19f7c6cba..d580d936dc4a2 100644
--- 
a/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py
+++ 
b/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py
@@ -31,6 +31,7 @@ def exit_expression_editor(self):
 @skipIfAsan
 @skipIfEditlineSupportMissing
 @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr49408')
+@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
 def test_basic_completion(self):
 """Test that we can complete a simple multiline expression"""
 self.build()

diff  --git 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
index 95ad2c8857088..0cd0a5d447b56 100644
--- 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -19,6 +19,7 @@ class TestCase(PExpectTest):
 @skipIfAsan
 @skipIfEditlineSupportMissing
 @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
 def test_nav_arrow_up(self):
 """Tests that we can navigate back to the previous line with the up 
arrow"""
 self.launch()

diff  --git a/lldb/test/API/commands/gui/basic/TestGuiBasic.py 
b/lldb/test/API/commands/gui/basic/TestGuiBasic.py
index d501b266cc12c..4e1a0f990a683 100644
--- a/lldb/test/API/commands/gui/basic/TestGuiBasic.py
+++ b/lldb/test/API/commands/gui/basic/TestGuiBasic.py
@@ -15,6 +15,7 @@ class BasicGuiCommandTest(PExpectTest):
 # under ASAN on a loaded machine..
 @skipIfAsan
 @skipIfCursesSupportMissing
+@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
 def test_gui(self):
 self.build()
 

diff  --git a/lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py 
b/lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py
index 183143c28cb87..2f49b810fb4c2 100644
--- a/lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py
+++ b/lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py
@@ -18,6 +18,7 @@ class IOHandlerCompletionTest(PExpectTest):
 @skipIfAsan
 @skipIfEditlineSupportMissing
 @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr49408')
+@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
 def test_completion(self):
 self.launch(dimensions=(100,500))
 



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


[Lldb-commits] [lldb] a94fbb2 - Revert "Revert "[LLDB][GUI] Expand selected thread tree item by default""

2021-08-01 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-08-02T05:29:32+05:00
New Revision: a94fbb25de5fef6f20027f5ec9466fec821ba92f

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

LOG: Revert "Revert "[LLDB][GUI] Expand selected thread tree item by default""

This reverts commit fd18f0e84cca023df6cb19e88c07c0e2059f659b.

I reverted this change to see its effect on failing GUI tests on LLDB
Arm/AArch64 Linux buildbots. I could not find any evidence against this
particular change so reverting it back.

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

Added: 
lldb/test/API/commands/gui/expand-threads-tree/Makefile
lldb/test/API/commands/gui/expand-threads-tree/TestGuiExpandThreadsTree.py
lldb/test/API/commands/gui/expand-threads-tree/main.c

Modified: 
lldb/source/Core/IOHandlerCursesGUI.cpp

Removed: 




diff  --git a/lldb/source/Core/IOHandlerCursesGUI.cpp 
b/lldb/source/Core/IOHandlerCursesGUI.cpp
index e824f702aba21..010f9300aa2e5 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -3768,8 +3768,13 @@ class TreeDelegate {
 
   virtual void TreeDelegateDrawTreeItem(TreeItem &item, Window &window) = 0;
   virtual void TreeDelegateGenerateChildren(TreeItem &item) = 0;
+  virtual void TreeDelegateUpdateSelection(TreeItem &root, int 
&selection_index,
+   TreeItem *&selected_item) {
+return;
+  }
   virtual bool TreeDelegateItemSelected(
   TreeItem &item) = 0; // Return true if we need to update views
+  virtual bool TreeDelegateExpandRootByDefault() { return false; }
 };
 
 typedef std::shared_ptr TreeDelegateSP;
@@ -3779,7 +3784,10 @@ class TreeItem {
   TreeItem(TreeItem *parent, TreeDelegate &delegate, bool might_have_children)
   : m_parent(parent), m_delegate(delegate), m_user_data(nullptr),
 m_identifier(0), m_row_idx(-1), m_children(),
-m_might_have_children(might_have_children), m_is_expanded(false) {}
+m_might_have_children(might_have_children), m_is_expanded(false) {
+if (m_parent == nullptr)
+  m_is_expanded = m_delegate.TreeDelegateExpandRootByDefault();
+  }
 
   TreeItem &operator=(const TreeItem &rhs) {
 if (this != &rhs) {
@@ -4008,6 +4016,8 @@ class TreeWindowDelegate : public WindowDelegate {
   const int num_visible_rows = NumVisibleRows();
   m_num_rows = 0;
   m_root.CalculateRowIndexes(m_num_rows);
+  m_delegate_sp->TreeDelegateUpdateSelection(m_root, m_selected_row_idx,
+ m_selected_item);
 
   // If we unexpanded while having something selected our total number of
   // rows is less than the num visible rows, then make sure we show all the
@@ -4309,7 +4319,7 @@ class ThreadsTreeDelegate : public TreeDelegate {
 public:
   ThreadsTreeDelegate(Debugger &debugger)
   : TreeDelegate(), m_thread_delegate_sp(), m_debugger(debugger),
-m_stop_id(UINT32_MAX) {
+m_stop_id(UINT32_MAX), m_update_selection(false) {
 FormatEntity::Parse("process ${process.id}{, name = ${process.name}}",
 m_format);
   }
@@ -4337,6 +4347,7 @@ class ThreadsTreeDelegate : public TreeDelegate {
 
   void TreeDelegateGenerateChildren(TreeItem &item) override {
 ProcessSP process_sp = GetProcess();
+m_update_selection = false;
 if (process_sp && process_sp->IsAlive()) {
   StateType state = process_sp->GetState();
   if (StateIsStoppedState(state, true)) {
@@ -4345,6 +4356,7 @@ class ThreadsTreeDelegate : public TreeDelegate {
   return; // Children are already up to date
 
 m_stop_id = stop_id;
+m_update_selection = true;
 
 if (!m_thread_delegate_sp) {
   // Always expand the thread item the first time we show it
@@ -4356,11 +4368,15 @@ class ThreadsTreeDelegate : public TreeDelegate {
 TreeItem t(&item, *m_thread_delegate_sp, false);
 ThreadList &threads = process_sp->GetThreadList();
 std::lock_guard guard(threads.GetMutex());
+ThreadSP selected_thread = threads.GetSelectedThread();
 size_t num_threads = threads.GetSize();
 item.Resize(num_threads, t);
 for (size_t i = 0; i < num_threads; ++i) {
-  item[i].SetIdentifier(threads.GetThreadAtIndex(i)->GetID());
+  ThreadSP thread = threads.GetThreadAtIndex(i);
+  item[i].SetIdentifier(thread->GetID());
   item[i].SetMightHaveChildren(true);
+  if (selected_thread->GetID() == thread->GetID())
+item[i].Expand();
 }
 return;
   }
@@ -4368,12 +4384,42 @@ class ThreadsTreeDelegate : public TreeDelegate {
 item.ClearChildren();
   }
 
+  void TreeDelegateUpdateSelection(TreeItem &root, int &selection_i

[Lldb-commits] [lldb] 97c6ef4 - [LLDB] Change pexpect timeout to 30 to 60

2021-08-01 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-08-02T06:34:11+05:00
New Revision: 97c6ef4ea678ef9a69e1feaf9d77a0880bca09ba

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

LOG: [LLDB] Change pexpect timeout to 30 to 60

Test dependent on pexpect fail randomly with timeouts on Arm/AArch64 Linux
buildbots. I am setting pexpect timeout from 30 to 60.

I will revert this back if this doesnt improve random failures.

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/lldbpexpect.py
lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py 
b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
index 388e91892888e..f7c0e490105af 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -23,7 +23,7 @@ class PExpectTest(TestBase):
 def expect_prompt(self):
 self.child.expect_exact(self.PROMPT)
 
-def launch(self, executable=None, extra_args=None, timeout=30, 
dimensions=None):
+def launch(self, executable=None, extra_args=None, timeout=60, 
dimensions=None):
 logfile = getattr(sys.stdout, 'buffer',
 sys.stdout) if self.TraceOn() else None
 

diff  --git a/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py 
b/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
index 4bebe1158478c..589d5ec924656 100644
--- a/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
+++ b/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
@@ -30,7 +30,7 @@ class SpawnBase(object):
 pid = None
 flag_eof = False
 
-def __init__(self, timeout=30, maxread=2000, searchwindowsize=None,
+def __init__(self, timeout=60, maxread=2000, searchwindowsize=None,
  logfile=None, encoding=None, codec_errors='strict'):
 self.stdin = sys.stdin
 self.stdout = sys.stdout



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