[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan updated 
https://github.com/llvm/llvm-project/pull/112079

>From d1b5c17974ec5c987ea1cadcad0517813308ccf7 Mon Sep 17 00:00:00 2001
From: Robert O'Callahan 
Date: Fri, 19 Jul 2024 22:46:42 +1200
Subject: [PATCH] [lldb] Implement basic support for reverse-continue

This commit only adds support for the
`SBProcess::ContinueInDirection()` API. A user-accessible command
for this will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`)
providing support for the `bc` and `bs` packets. `lldb-server`
does not support those packets, and there is no plan to change that.
with a Python implementation of *very limited* record-and-replay
functionality.
---
 lldb/include/lldb/API/SBProcess.h |   1 +
 lldb/include/lldb/Target/Process.h|  25 +-
 lldb/include/lldb/Target/StopInfo.h   |   7 +
 lldb/include/lldb/Target/Thread.h |  12 +-
 lldb/include/lldb/Target/ThreadList.h |   6 +-
 lldb/include/lldb/Target/ThreadPlan.h |  13 +
 lldb/include/lldb/Target/ThreadPlanBase.h |   2 +
 lldb/include/lldb/lldb-enumerations.h |   6 +
 .../Python/lldbsuite/test/gdbclientutils.py   |   5 +-
 .../Python/lldbsuite/test/lldbgdbproxy.py | 185 +++
 .../Python/lldbsuite/test/lldbreverse.py  | 489 ++
 .../Python/lldbsuite/test/lldbtest.py |   2 +
 .../tools/lldb-server/lldbgdbserverutils.py   |  15 +-
 lldb/source/API/SBProcess.cpp |   8 +
 lldb/source/API/SBThread.cpp  |   2 +
 .../source/Interpreter/CommandInterpreter.cpp |   3 +-
 .../Process/Linux/NativeThreadLinux.cpp   |   3 +
 .../Process/MacOSX-Kernel/ProcessKDP.cpp  |   9 +-
 .../Process/MacOSX-Kernel/ProcessKDP.h|   2 +-
 .../Process/Windows/Common/ProcessWindows.cpp |   9 +-
 .../Process/Windows/Common/ProcessWindows.h   |   2 +-
 .../GDBRemoteCommunicationClient.cpp  |  22 +
 .../gdb-remote/GDBRemoteCommunicationClient.h |   6 +
 .../GDBRemoteCommunicationServerLLGS.cpp  |   1 +
 .../Process/gdb-remote/ProcessGDBRemote.cpp   |  93 +++-
 .../Process/gdb-remote/ProcessGDBRemote.h |   2 +-
 .../Process/scripted/ScriptedProcess.cpp  |  11 +-
 .../Process/scripted/ScriptedProcess.h|   2 +-
 lldb/source/Target/Process.cpp|  25 +-
 lldb/source/Target/StopInfo.cpp   |  29 ++
 lldb/source/Target/Thread.cpp |  13 +-
 lldb/source/Target/ThreadList.cpp |  62 ++-
 lldb/source/Target/ThreadPlanBase.cpp |   4 +
 .../reverse-execution/Makefile|   3 +
 .../TestReverseContinueBreakpoints.py | 151 ++
 .../TestReverseContinueNotSupported.py|  30 ++
 .../functionalities/reverse-execution/main.c  |  14 +
 lldb/tools/lldb-dap/JSONUtils.cpp |   3 +
 lldb/tools/lldb-dap/LLDBUtils.cpp |   1 +
 39 files changed, 1207 insertions(+), 71 deletions(-)
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbgdbproxy.py
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbreverse.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/Makefile
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueNotSupported.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/main.c

diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index 1624e02070b1b2..882b8bd837131d 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -159,6 +159,7 @@ class LLDB_API SBProcess {
   lldb::SBError Destroy();
 
   lldb::SBError Continue();
+  lldb::SBError ContinueInDirection(lldb::RunDirection direction);
 
   lldb::SBError Stop();
 
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index a184e6dd891aff..552eb305b1152b 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1104,9 +1104,15 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  virtual Status DoResume() {
-return Status::FromErrorStringWithFormatv(
-"error: {0} does not support resuming processes", GetPluginName());
+  virtual Status DoResume(lldb::RunDirection direction) {
+if (direction == lldb::RunDirection::eRunForward) {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support resuming processes", GetPluginName());
+} else {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support reverse execution of processes",
+  GetPluginName());
+}
   }
 
   /// Called after resuming a process.
@@ -2676,6 +2682,18 @@ void PruneThreadPlans();
 const AddressRange &range, size_t alignment,
 

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan updated 
https://github.com/llvm/llvm-project/pull/112079

>From f8ec2662dce500071db697d8fa0cc4f5dce11e70 Mon Sep 17 00:00:00 2001
From: Robert O'Callahan 
Date: Fri, 19 Jul 2024 22:46:42 +1200
Subject: [PATCH] [lldb] Implement basic support for reverse-continue

This commit only adds support for the
`SBProcess::ContinueInDirection()` API. A user-accessible command
for this will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`)
providing support for the `bc` and `bs` packets. `lldb-server`
does not support those packets, and there is no plan to change that.
with a Python implementation of *very limited* record-and-replay
functionality.
---
 lldb/include/lldb/API/SBProcess.h |   1 +
 lldb/include/lldb/Target/Process.h|  25 +-
 lldb/include/lldb/Target/StopInfo.h   |   7 +
 lldb/include/lldb/Target/Thread.h |  12 +-
 lldb/include/lldb/Target/ThreadList.h |   6 +-
 lldb/include/lldb/Target/ThreadPlan.h |  13 +
 lldb/include/lldb/Target/ThreadPlanBase.h |   2 +
 lldb/include/lldb/lldb-enumerations.h |   6 +
 .../Python/lldbsuite/test/gdbclientutils.py   |   5 +-
 .../Python/lldbsuite/test/lldbgdbproxy.py | 185 +++
 .../Python/lldbsuite/test/lldbreverse.py  | 489 ++
 .../Python/lldbsuite/test/lldbtest.py |   2 +
 .../tools/lldb-server/lldbgdbserverutils.py   |  13 +-
 lldb/source/API/SBProcess.cpp |   8 +
 lldb/source/API/SBThread.cpp  |   2 +
 .../source/Interpreter/CommandInterpreter.cpp |   3 +-
 .../Process/Linux/NativeThreadLinux.cpp   |   3 +
 .../Process/MacOSX-Kernel/ProcessKDP.cpp  |   9 +-
 .../Process/MacOSX-Kernel/ProcessKDP.h|   2 +-
 .../Process/Windows/Common/ProcessWindows.cpp |   9 +-
 .../Process/Windows/Common/ProcessWindows.h   |   2 +-
 .../GDBRemoteCommunicationClient.cpp  |  22 +
 .../gdb-remote/GDBRemoteCommunicationClient.h |   6 +
 .../GDBRemoteCommunicationServerLLGS.cpp  |   1 +
 .../Process/gdb-remote/ProcessGDBRemote.cpp   |  93 +++-
 .../Process/gdb-remote/ProcessGDBRemote.h |   2 +-
 .../Process/scripted/ScriptedProcess.cpp  |  11 +-
 .../Process/scripted/ScriptedProcess.h|   2 +-
 lldb/source/Target/Process.cpp|  25 +-
 lldb/source/Target/StopInfo.cpp   |  29 ++
 lldb/source/Target/Thread.cpp |  13 +-
 lldb/source/Target/ThreadList.cpp |  62 ++-
 lldb/source/Target/ThreadPlanBase.cpp |   4 +
 .../reverse-execution/Makefile|   3 +
 .../TestReverseContinueBreakpoints.py | 151 ++
 .../TestReverseContinueNotSupported.py|  30 ++
 .../functionalities/reverse-execution/main.c  |  14 +
 lldb/tools/lldb-dap/JSONUtils.cpp |   3 +
 lldb/tools/lldb-dap/LLDBUtils.cpp |   1 +
 39 files changed, 1206 insertions(+), 70 deletions(-)
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbgdbproxy.py
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbreverse.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/Makefile
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueNotSupported.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/main.c

diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index 1624e02070b1b2..882b8bd837131d 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -159,6 +159,7 @@ class LLDB_API SBProcess {
   lldb::SBError Destroy();
 
   lldb::SBError Continue();
+  lldb::SBError ContinueInDirection(lldb::RunDirection direction);
 
   lldb::SBError Stop();
 
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index a184e6dd891aff..552eb305b1152b 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1104,9 +1104,15 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  virtual Status DoResume() {
-return Status::FromErrorStringWithFormatv(
-"error: {0} does not support resuming processes", GetPluginName());
+  virtual Status DoResume(lldb::RunDirection direction) {
+if (direction == lldb::RunDirection::eRunForward) {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support resuming processes", GetPluginName());
+} else {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support reverse execution of processes",
+  GetPluginName());
+}
   }
 
   /// Called after resuming a process.
@@ -2676,6 +2682,18 @@ void PruneThreadPlans();
 const AddressRange &range, size_t alignment,
 

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -2674,6 +2680,9 @@ void PruneThreadPlans();
 const AddressRange &range, size_t alignment,
 Status &error);
 
+  lldb::RunDirection GetBaseDirection() const { return m_base_direction; }

rocallahan wrote:

Add comments to `Process::GetBaseDirection()` and `Process::SetBaseDirection()`.
Added text to `ThreadPlan.h` novella.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -1363,9 +1375,51 @@ Status ProcessGDBRemote::DoResume() {
   }
 }
 
+if (direction == RunDirection::eRunReverse && continue_packet_error) {
+  if (num_continue_C_tids > 0 || num_continue_S_tids > 0) {
+LLDB_LOGF(log,
+  "ProcessGDBRemote::DoResumeReverse: Signals not supported");
+return Status::FromErrorString(
+"can't deliver signals while running in reverse");
+  }
+
+  if (num_continue_s_tids > 0) {
+if (num_continue_s_tids > 1) {
+  LLDB_LOGF(
+  log,
+  "ProcessGDBRemote::DoResumeReverse: can't step multiple 
threads");
+  return Status::FromErrorString(
+  "can't step multiple threads while reverse-stepping");
+}
+
+if (!m_gdb_comm.GetReverseStepSupported()) {

rocallahan wrote:

I cleaned this up so we check for support before we report the other kinds of 
errors.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -1265,14 +1280,11 @@ Status ProcessGDBRemote::DoResume() {
 } else
   continue_packet_error = true;
 
-if (continue_packet_error) {
+if (direction == RunDirection::eRunForward && continue_packet_error) {
   // Either no vCont support, or we tried to use part of the vCont packet
-  // that wasn't supported by the remote GDB server. We need to try and
-  // make a simple packet that can do our continue
-  const size_t num_continue_c_tids = m_continue_c_tids.size();
-  const size_t num_continue_C_tids = m_continue_C_tids.size();
-  const size_t num_continue_s_tids = m_continue_s_tids.size();
-  const size_t num_continue_S_tids = m_continue_S_tids.size();
+  // that wasn't supported by the remote GDB server, or it's the reverse

rocallahan wrote:

Removed "or it's the reverse..." from the comment.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -652,7 +652,7 @@ def assert_match(self, asserter, accumulated_output, 
context):
 if not accumulated_output:
 raise Exception("accumulated_output cannot be none")
 if not context:
-raise Exception("context cannot be none")
+raise Exception("context cannot be nvalione")

rocallahan wrote:

Stray garbage. Fixed.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -2318,6 +2376,8 @@ StateType 
ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
 description = std::string(ostr.GetString());
   } else if (key.compare("swbreak") == 0 || key.compare("hwbreak") == 0) {
 reason = "breakpoint";
+  } else if (key.compare("replaylog") == 0) {
+reason = "replaylog";

rocallahan wrote:

Changed to `history boundary`.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -608,19 +594,49 @@ bool ThreadList::WillResume() {
   }
 
   bool need_to_resume = true;
+  Log *log(GetLog(LLDBLog::Process | LLDBLog::Step));
 
   if (run_me_only_list.GetSize(false) == 0) {
+*direction = m_process.GetBaseDirection();
+// We've determined the direction so now we can determine which
+// threads need to step over breakpoints.
+for (pos = m_threads.begin(); pos != end; ++pos) {
+  if ((*pos)->GetResumeState() != eStateSuspended &&
+  (!wants_solo_run || (*pos)->GetCurrentPlan()->StopOthers())) {
+if ((*pos)->IsOperatingSystemPluginThread() &&
+!(*pos)->GetBackingThread())
+  continue;
+if ((*pos)->StepOverBreakpointIfNeeded(*direction)) {
+  run_me_only_list.AddThread(*pos);
+  break;
+}
+  }
+}
+  } // else we'll set *direction to the direction of the chosen thread later
+  if (run_me_only_list.GetSize(false) == 0) {
+// *direction has been set to m_process.GetBaseDirection().
 // Everybody runs as they wish:
 for (pos = m_threads.begin(); pos != end; ++pos) {
   ThreadSP thread_sp(*pos);
   StateType run_state;
-  if (thread_sp->GetResumeState() != eStateSuspended)
+  if (thread_sp->GetResumeState() != eStateSuspended) {
 run_state = thread_sp->GetCurrentPlan()->RunState();
-  else
+  } else {
 run_state = eStateSuspended;
+  }
   if (!thread_sp->ShouldResume(run_state))
 need_to_resume = false;
 }
+if (need_to_resume) {
+  for (pos = m_threads.begin(); pos != end; ++pos) {
+ThreadSP thread_sp(*pos);
+while (thread_sp->GetCurrentPlan()->GetDirection() != *direction) {
+  // This can't pop the base plan because its direction is
+  // m_process.GetBaseDirection() i.e. *direction.
+  thread_sp->PopPlan();

rocallahan wrote:

Good point, fixed.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -617,25 +617,26 @@ void Thread::WillStop() {
   current_plan->WillStop();
 }
 
-void Thread::SetupForResume() {
+bool Thread::StepOverBreakpointIfNeeded(RunDirection direction) {

rocallahan wrote:

Renamed it to `SetupForStepOverBreakpoint()`, hope that's good.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -182,10 +182,16 @@ void ScriptedProcess::DidResume() {
   m_pid = GetInterface().GetProcessID();
 }
 
-Status ScriptedProcess::DoResume() {
+Status ScriptedProcess::DoResume(RunDirection direction) {
   LLDB_LOGF(GetLog(LLDBLog::Process), "ScriptedProcess::%s resuming process", 
__FUNCTION__);
 
-  return GetInterface().Resume();
+  if (direction == RunDirection::eRunForward) {
+return GetInterface().Resume();
+  } else {
+return Status::FromErrorStringWithFormatv(

rocallahan wrote:

Done.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -3239,6 +3241,14 @@ Status Process::ConnectRemote(llvm::StringRef 
remote_url) {
   return error;
 }
 
+void Process::SetRunDirection(RunDirection direction) {
+  if (m_base_direction == direction) {
+return;
+  }
+  m_thread_list.DiscardThreadPlans();

rocallahan wrote:

Renamed this to `SetBaseDirection()` and added this to the comment on that 
method in `Process.h`.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits


@@ -1363,9 +1375,51 @@ Status ProcessGDBRemote::DoResume() {
   }
 }
 
+if (direction == RunDirection::eRunReverse && continue_packet_error) {

rocallahan wrote:

Removed `continue_packet_error` from here.

https://github.com/llvm/llvm-project/pull/112079
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2024-12-14 Thread Robert O'Callahan via lldb-commits

https://github.com/rocallahan updated 
https://github.com/llvm/llvm-project/pull/112079

>From 9fb782a15f2fc23f1509dd110e139d256482de63 Mon Sep 17 00:00:00 2001
From: Robert O'Callahan 
Date: Fri, 19 Jul 2024 22:46:42 +1200
Subject: [PATCH] [lldb] Implement basic support for reverse-continue

This commit only adds support for the
`SBProcess::ContinueInDirection()` API. A user-accessible command
for this will follow in a later commit.

This feature depends on a gdbserver implementation (e.g. `rr`)
providing support for the `bc` and `bs` packets. `lldb-server`
does not support those packets, and there is no plan to change that.
with a Python implementation of *very limited* record-and-replay
functionality.
---
 lldb/include/lldb/API/SBProcess.h |   1 +
 lldb/include/lldb/Target/Process.h|  25 +-
 lldb/include/lldb/Target/StopInfo.h   |   7 +
 lldb/include/lldb/Target/Thread.h |  12 +-
 lldb/include/lldb/Target/ThreadList.h |   6 +-
 lldb/include/lldb/Target/ThreadPlan.h |  13 +
 lldb/include/lldb/Target/ThreadPlanBase.h |   2 +
 lldb/include/lldb/lldb-enumerations.h |   6 +
 .../Python/lldbsuite/test/gdbclientutils.py   |   5 +-
 .../Python/lldbsuite/test/lldbgdbproxy.py | 185 +++
 .../Python/lldbsuite/test/lldbreverse.py  | 489 ++
 .../Python/lldbsuite/test/lldbtest.py |   2 +
 .../tools/lldb-server/lldbgdbserverutils.py   |  15 +-
 lldb/source/API/SBProcess.cpp |   8 +
 lldb/source/API/SBThread.cpp  |   2 +
 .../source/Interpreter/CommandInterpreter.cpp |   3 +-
 .../Process/Linux/NativeThreadLinux.cpp   |   3 +
 .../Process/MacOSX-Kernel/ProcessKDP.cpp  |   9 +-
 .../Process/MacOSX-Kernel/ProcessKDP.h|   2 +-
 .../Process/Windows/Common/ProcessWindows.cpp |   9 +-
 .../Process/Windows/Common/ProcessWindows.h   |   2 +-
 .../GDBRemoteCommunicationClient.cpp  |  22 +
 .../gdb-remote/GDBRemoteCommunicationClient.h |   6 +
 .../GDBRemoteCommunicationServerLLGS.cpp  |   1 +
 .../Process/gdb-remote/ProcessGDBRemote.cpp   |  92 +++-
 .../Process/gdb-remote/ProcessGDBRemote.h |   2 +-
 .../Process/scripted/ScriptedProcess.cpp  |  11 +-
 .../Process/scripted/ScriptedProcess.h|   2 +-
 lldb/source/Target/Process.cpp|  25 +-
 lldb/source/Target/StopInfo.cpp   |  29 ++
 lldb/source/Target/Thread.cpp |  13 +-
 lldb/source/Target/ThreadList.cpp |  62 ++-
 lldb/source/Target/ThreadPlanBase.cpp |   4 +
 .../reverse-execution/Makefile|   3 +
 .../TestReverseContinueBreakpoints.py | 151 ++
 .../TestReverseContinueNotSupported.py|  30 ++
 .../functionalities/reverse-execution/main.c  |  14 +
 lldb/tools/lldb-dap/JSONUtils.cpp |   3 +
 lldb/tools/lldb-dap/LLDBUtils.cpp |   1 +
 39 files changed, 1206 insertions(+), 71 deletions(-)
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbgdbproxy.py
 create mode 100644 lldb/packages/Python/lldbsuite/test/lldbreverse.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/Makefile
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
 create mode 100644 
lldb/test/API/functionalities/reverse-execution/TestReverseContinueNotSupported.py
 create mode 100644 lldb/test/API/functionalities/reverse-execution/main.c

diff --git a/lldb/include/lldb/API/SBProcess.h 
b/lldb/include/lldb/API/SBProcess.h
index 1624e02070b1b2..882b8bd837131d 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -159,6 +159,7 @@ class LLDB_API SBProcess {
   lldb::SBError Destroy();
 
   lldb::SBError Continue();
+  lldb::SBError ContinueInDirection(lldb::RunDirection direction);
 
   lldb::SBError Stop();
 
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index a184e6dd891aff..552eb305b1152b 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1104,9 +1104,15 @@ class Process : public 
std::enable_shared_from_this,
   /// \see Thread:Resume()
   /// \see Thread:Step()
   /// \see Thread:Suspend()
-  virtual Status DoResume() {
-return Status::FromErrorStringWithFormatv(
-"error: {0} does not support resuming processes", GetPluginName());
+  virtual Status DoResume(lldb::RunDirection direction) {
+if (direction == lldb::RunDirection::eRunForward) {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support resuming processes", GetPluginName());
+} else {
+  return Status::FromErrorStringWithFormatv(
+  "error: {0} does not support reverse execution of processes",
+  GetPluginName());
+}
   }
 
   /// Called after resuming a process.
@@ -2676,6 +2682,18 @@ void PruneThreadPlans();
 const AddressRange &range, size_t alignment,
 

[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread via lldb-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 331c2dd8b482e441d8ccddc09f21a02cc9454786 
3bf901b53d98378cee4a1868d039a1289e9e5277 --extensions h,cpp -- 
lldb/include/lldb/DataFormatters/TypeSynthetic.h 
lldb/include/lldb/DataFormatters/VectorIterator.h 
lldb/source/DataFormatters/VectorType.cpp 
lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp 
lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp 
lldb/source/Plugins/Language/CPlusPlus/Coroutines.h 
lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp 
lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxx.h 
lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxProxyArray.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxRangesRefView.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxSliceArray.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxSpan.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxValarray.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp 
lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp 
lldb/source/Plugins/Language/ObjC/NSArray.cpp 
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp 
lldb/source/Plugins/Language/ObjC/NSError.cpp 
lldb/source/Plugins/Language/ObjC/NSException.cpp 
lldb/source/Plugins/Language/ObjC/NSSet.cpp
``





View the diff from clang-format here.


``diff
diff --git a/lldb/source/Plugins/Language/ObjC/NSSet.cpp 
b/lldb/source/Plugins/Language/ObjC/NSSet.cpp
index 719e35ee41..753dec93e4 100644
--- a/lldb/source/Plugins/Language/ObjC/NSSet.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSSet.cpp
@@ -220,7 +220,7 @@ namespace Foundation1437 {
 }
   }
 }
-  
+
 } // namespace formatters
 } // namespace lldb_private
 

``




https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits


@@ -227,22 +221,6 @@ namespace Foundation1437 {
   }
 }
   
-class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
-public:
-  NSSetCodeRunningSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
-
-  ~NSSetCodeRunningSyntheticFrontEnd() override;
-
-  llvm::Expected CalculateNumChildren() override;
-
-  lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
-
-  lldb::ChildCacheState Update() override;
-
-  bool MightHaveChildren() override;

kastiglione wrote:

while auditing `MightHaveChildren` declarations, the name of this class caught 
my attention. I looked for uses and found none, so I've removed it.

https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione created 
https://github.com/llvm/llvm-project/pull/119977

None

>From 3bf901b53d98378cee4a1868d039a1289e9e5277 Mon Sep 17 00:00:00 2001
From: Dave Lee 
Date: Sat, 14 Dec 2024 09:26:17 -0800
Subject: [PATCH] [lldb] Provide default impl for MightHaveChildren (NFC)

---
 .../lldb/DataFormatters/TypeSynthetic.h   |  2 +-
 .../lldb/DataFormatters/VectorIterator.h  |  2 -
 lldb/source/DataFormatters/VectorType.cpp |  2 -
 .../Language/CPlusPlus/BlockPointer.cpp   |  3 --
 .../Plugins/Language/CPlusPlus/Coroutines.cpp |  5 ---
 .../Plugins/Language/CPlusPlus/Coroutines.h   |  2 -
 .../Language/CPlusPlus/GenericBitset.cpp  |  1 -
 .../Language/CPlusPlus/GenericOptional.cpp|  1 -
 .../Plugins/Language/CPlusPlus/LibCxx.cpp | 10 -
 .../Plugins/Language/CPlusPlus/LibCxx.h   |  4 --
 .../Language/CPlusPlus/LibCxxAtomic.cpp   |  7 ---
 .../CPlusPlus/LibCxxInitializerList.cpp   |  7 ---
 .../Plugins/Language/CPlusPlus/LibCxxList.cpp |  1 -
 .../Plugins/Language/CPlusPlus/LibCxxMap.cpp  | 14 --
 .../Language/CPlusPlus/LibCxxProxyArray.cpp   |  7 ---
 .../Language/CPlusPlus/LibCxxQueue.cpp|  1 -
 .../CPlusPlus/LibCxxRangesRefView.cpp |  2 -
 .../Language/CPlusPlus/LibCxxSliceArray.cpp   |  7 ---
 .../Plugins/Language/CPlusPlus/LibCxxSpan.cpp |  7 ---
 .../Language/CPlusPlus/LibCxxTuple.cpp|  1 -
 .../Language/CPlusPlus/LibCxxUnorderedMap.cpp | 14 --
 .../Language/CPlusPlus/LibCxxValarray.cpp |  7 ---
 .../Language/CPlusPlus/LibCxxVariant.cpp  |  1 -
 .../Language/CPlusPlus/LibCxxVector.cpp   |  9 
 .../Plugins/Language/CPlusPlus/LibStdcpp.cpp  | 10 -
 .../Language/CPlusPlus/LibStdcppTuple.cpp |  4 --
 .../CPlusPlus/LibStdcppUniquePointer.cpp  |  4 --
 lldb/source/Plugins/Language/ObjC/NSArray.cpp | 22 -
 .../Plugins/Language/ObjC/NSDictionary.cpp| 45 ---
 lldb/source/Plugins/Language/ObjC/NSError.cpp |  2 -
 .../Plugins/Language/ObjC/NSException.cpp |  2 -
 lldb/source/Plugins/Language/ObjC/NSSet.cpp   | 37 ---
 32 files changed, 1 insertion(+), 242 deletions(-)

diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h 
b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index bf6dc6a0c3c6bf..14e516964f2507 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -68,7 +68,7 @@ class SyntheticChildrenFrontEnd {
   // a false return value from this call if it returns true, then
   // CalculateNumChildren() can return any number >= 0 (0 being valid) it
   // should if at all possible be more efficient than CalculateNumChildren()
-  virtual bool MightHaveChildren() = 0;
+  virtual bool MightHaveChildren() { return true; }
 
   // if this function returns a non-null ValueObject, then the returned
   // ValueObject will stand for this ValueObject whenever a "value" request is
diff --git a/lldb/include/lldb/DataFormatters/VectorIterator.h 
b/lldb/include/lldb/DataFormatters/VectorIterator.h
index 70bcf50ca1b1d2..d095f085cabab6 100644
--- a/lldb/include/lldb/DataFormatters/VectorIterator.h
+++ b/lldb/include/lldb/DataFormatters/VectorIterator.h
@@ -30,8 +30,6 @@ class VectorIteratorSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 
   lldb::ChildCacheState Update() override;
 
-  bool MightHaveChildren() override;
-
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
diff --git a/lldb/source/DataFormatters/VectorType.cpp 
b/lldb/source/DataFormatters/VectorType.cpp
index cba107b7da8900..fa3fb1b674efbe 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -268,8 +268,6 @@ class VectorTypeSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  bool MightHaveChildren() override { return true; }
-
   size_t GetIndexOfChildWithName(ConstString name) override {
 const char *item_name = name.GetCString();
 uint32_t idx = ExtractIndexFromString(item_name);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
index d7d4654a6b5f44..6a22501c98aab8 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
@@ -144,9 +144,6 @@ class BlockPointerSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  // maybe return false if the block pointer is, say, null
-  bool MightHaveChildren() override { return true; }
-
   size_t GetIndexOfChildWithName(ConstString name) override {
 if (!m_block_struct_type.IsValid())
   return UINT32_MAX;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
index 5e63d1d7b21453..76a10d2393782c 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cp

[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Dave Lee (kastiglione)


Changes



---

Patch is 33.72 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/119977.diff


32 Files Affected:

- (modified) lldb/include/lldb/DataFormatters/TypeSynthetic.h (+1-1) 
- (modified) lldb/include/lldb/DataFormatters/VectorIterator.h (-2) 
- (modified) lldb/source/DataFormatters/VectorType.cpp (-2) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp (-3) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp (-5) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/Coroutines.h (-2) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp (-10) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxx.h (-4) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp (-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp 
(-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (-14) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxProxyArray.cpp (-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxRangesRefView.cpp 
(-2) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxSliceArray.cpp (-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxSpan.cpp (-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp 
(-14) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxValarray.cpp (-7) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp (-1) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp (-9) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp (-10) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp (-4) 
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp 
(-4) 
- (modified) lldb/source/Plugins/Language/ObjC/NSArray.cpp (-22) 
- (modified) lldb/source/Plugins/Language/ObjC/NSDictionary.cpp (-45) 
- (modified) lldb/source/Plugins/Language/ObjC/NSError.cpp (-2) 
- (modified) lldb/source/Plugins/Language/ObjC/NSException.cpp (-2) 
- (modified) lldb/source/Plugins/Language/ObjC/NSSet.cpp (-37) 


``diff
diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h 
b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index bf6dc6a0c3c6bf..14e516964f2507 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -68,7 +68,7 @@ class SyntheticChildrenFrontEnd {
   // a false return value from this call if it returns true, then
   // CalculateNumChildren() can return any number >= 0 (0 being valid) it
   // should if at all possible be more efficient than CalculateNumChildren()
-  virtual bool MightHaveChildren() = 0;
+  virtual bool MightHaveChildren() { return true; }
 
   // if this function returns a non-null ValueObject, then the returned
   // ValueObject will stand for this ValueObject whenever a "value" request is
diff --git a/lldb/include/lldb/DataFormatters/VectorIterator.h 
b/lldb/include/lldb/DataFormatters/VectorIterator.h
index 70bcf50ca1b1d2..d095f085cabab6 100644
--- a/lldb/include/lldb/DataFormatters/VectorIterator.h
+++ b/lldb/include/lldb/DataFormatters/VectorIterator.h
@@ -30,8 +30,6 @@ class VectorIteratorSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 
   lldb::ChildCacheState Update() override;
 
-  bool MightHaveChildren() override;
-
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
diff --git a/lldb/source/DataFormatters/VectorType.cpp 
b/lldb/source/DataFormatters/VectorType.cpp
index cba107b7da8900..fa3fb1b674efbe 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -268,8 +268,6 @@ class VectorTypeSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  bool MightHaveChildren() override { return true; }
-
   size_t GetIndexOfChildWithName(ConstString name) override {
 const char *item_name = name.GetCString();
 uint32_t idx = ExtractIndexFromString(item_name);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
index d7d4654a6b5f44..6a22501c98aab8 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
@@ -144,9 +144,6 @@ class BlockPointerSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  // maybe return f

[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione updated 
https://github.com/llvm/llvm-project/pull/119977

>From 3bf901b53d98378cee4a1868d039a1289e9e5277 Mon Sep 17 00:00:00 2001
From: Dave Lee 
Date: Sat, 14 Dec 2024 09:26:17 -0800
Subject: [PATCH 1/2] [lldb] Provide default impl for MightHaveChildren (NFC)

---
 .../lldb/DataFormatters/TypeSynthetic.h   |  2 +-
 .../lldb/DataFormatters/VectorIterator.h  |  2 -
 lldb/source/DataFormatters/VectorType.cpp |  2 -
 .../Language/CPlusPlus/BlockPointer.cpp   |  3 --
 .../Plugins/Language/CPlusPlus/Coroutines.cpp |  5 ---
 .../Plugins/Language/CPlusPlus/Coroutines.h   |  2 -
 .../Language/CPlusPlus/GenericBitset.cpp  |  1 -
 .../Language/CPlusPlus/GenericOptional.cpp|  1 -
 .../Plugins/Language/CPlusPlus/LibCxx.cpp | 10 -
 .../Plugins/Language/CPlusPlus/LibCxx.h   |  4 --
 .../Language/CPlusPlus/LibCxxAtomic.cpp   |  7 ---
 .../CPlusPlus/LibCxxInitializerList.cpp   |  7 ---
 .../Plugins/Language/CPlusPlus/LibCxxList.cpp |  1 -
 .../Plugins/Language/CPlusPlus/LibCxxMap.cpp  | 14 --
 .../Language/CPlusPlus/LibCxxProxyArray.cpp   |  7 ---
 .../Language/CPlusPlus/LibCxxQueue.cpp|  1 -
 .../CPlusPlus/LibCxxRangesRefView.cpp |  2 -
 .../Language/CPlusPlus/LibCxxSliceArray.cpp   |  7 ---
 .../Plugins/Language/CPlusPlus/LibCxxSpan.cpp |  7 ---
 .../Language/CPlusPlus/LibCxxTuple.cpp|  1 -
 .../Language/CPlusPlus/LibCxxUnorderedMap.cpp | 14 --
 .../Language/CPlusPlus/LibCxxValarray.cpp |  7 ---
 .../Language/CPlusPlus/LibCxxVariant.cpp  |  1 -
 .../Language/CPlusPlus/LibCxxVector.cpp   |  9 
 .../Plugins/Language/CPlusPlus/LibStdcpp.cpp  | 10 -
 .../Language/CPlusPlus/LibStdcppTuple.cpp |  4 --
 .../CPlusPlus/LibStdcppUniquePointer.cpp  |  4 --
 lldb/source/Plugins/Language/ObjC/NSArray.cpp | 22 -
 .../Plugins/Language/ObjC/NSDictionary.cpp| 45 ---
 lldb/source/Plugins/Language/ObjC/NSError.cpp |  2 -
 .../Plugins/Language/ObjC/NSException.cpp |  2 -
 lldb/source/Plugins/Language/ObjC/NSSet.cpp   | 37 ---
 32 files changed, 1 insertion(+), 242 deletions(-)

diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h 
b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index bf6dc6a0c3c6bf..14e516964f2507 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -68,7 +68,7 @@ class SyntheticChildrenFrontEnd {
   // a false return value from this call if it returns true, then
   // CalculateNumChildren() can return any number >= 0 (0 being valid) it
   // should if at all possible be more efficient than CalculateNumChildren()
-  virtual bool MightHaveChildren() = 0;
+  virtual bool MightHaveChildren() { return true; }
 
   // if this function returns a non-null ValueObject, then the returned
   // ValueObject will stand for this ValueObject whenever a "value" request is
diff --git a/lldb/include/lldb/DataFormatters/VectorIterator.h 
b/lldb/include/lldb/DataFormatters/VectorIterator.h
index 70bcf50ca1b1d2..d095f085cabab6 100644
--- a/lldb/include/lldb/DataFormatters/VectorIterator.h
+++ b/lldb/include/lldb/DataFormatters/VectorIterator.h
@@ -30,8 +30,6 @@ class VectorIteratorSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 
   lldb::ChildCacheState Update() override;
 
-  bool MightHaveChildren() override;
-
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
diff --git a/lldb/source/DataFormatters/VectorType.cpp 
b/lldb/source/DataFormatters/VectorType.cpp
index cba107b7da8900..fa3fb1b674efbe 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -268,8 +268,6 @@ class VectorTypeSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  bool MightHaveChildren() override { return true; }
-
   size_t GetIndexOfChildWithName(ConstString name) override {
 const char *item_name = name.GetCString();
 uint32_t idx = ExtractIndexFromString(item_name);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
index d7d4654a6b5f44..6a22501c98aab8 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
@@ -144,9 +144,6 @@ class BlockPointerSyntheticFrontEnd : public 
SyntheticChildrenFrontEnd {
 return lldb::ChildCacheState::eRefetch;
   }
 
-  // maybe return false if the block pointer is, say, null
-  bool MightHaveChildren() override { return true; }
-
   size_t GetIndexOfChildWithName(ConstString name) override {
 if (!m_block_struct_type.IsValid())
   return UINT32_MAX;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
index 5e63d1d7b21453..76a10d2393782c 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp

[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide default impl for MightHaveChildren (NFC) (PR #119977)

2024-12-14 Thread Dave Lee via lldb-commits

https://github.com/kastiglione edited 
https://github.com/llvm/llvm-project/pull/119977
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits