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

2024-10-07 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-10-01 Thread Med Ismail Bennani via lldb-commits
https://github.com/medismailben approved this pull request. https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-10-01 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. Any more thoughts on this, Greg? https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commit

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

2024-09-24 Thread via lldb-commits
@@ -510,8 +510,9 @@ def start(self): self._thread.start() def stop(self): -self._thread.join() -self._thread = None +if self._thread is not None: jimingham wrote: Ah, cool. https://github.com/llvm/llvm-project/pull/99736 _

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: I see @clayborg still has a "change requested" hold on this PR. As far as I can tell all his comments have been addressed. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From 4bc3e8453a2fffa7c444ed9aa4bdc51e8e54569f 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

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid, return error; } -Status ProcessWindows::DoResume() { +Status ProcessWindows::DoResume(RunDirection direction) { rocallahan wrote: The decision was to use a direction flag. https

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -3169,6 +3176,7 @@ void PruneThreadPlans(); // m_currently_handling_do_on_removals are true, // Resume will only request a resume, using this // flag to check. + lldb::RunDirection m_last_run_d

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -1129,10 +1129,15 @@ class Process : public std::enable_shared_from_this, /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - virtual Status DoResume() { + virtual Status DoResume(lldb::RunDirection direction) { rocallahan wr

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -182,10 +182,17 @@ void ScriptedProcess::DidResume() { m_pid = GetInterface().GetProcessID(); } -Status ScriptedProcess::DoResume() { +Status ScriptedProcess::DoResume(RunDirection direction) { rocallahan wrote: The decision was to use a direction flag.

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -52,7 +52,7 @@ class ScriptedProcess : public Process { void DidResume() override; - Status DoResume() override; + Status DoResume(lldb::RunDirection direction) override; rocallahan wrote: The decision was to use a direction flag. https://github.com/

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -90,7 +90,7 @@ class ProcessKDP : public lldb_private::Process { // Process Control lldb_private::Status WillResume() override; - lldb_private::Status DoResume() override; + lldb_private::Status DoResume(lldb::RunDirection direction) override; rocalla

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -111,7 +111,7 @@ class ProcessGDBRemote : public Process, // Process Control Status WillResume() override; - Status DoResume() override; + Status DoResume(lldb::RunDirection direction) override; rocallahan wrote: The decision was to use a direction f

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -874,10 +874,10 @@ class Process : public std::enable_shared_from_this, /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - Status Resume(); + Status Resume(lldb::RunDirection direction = lldb::eRunForward); rocallahan wrote:

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -402,9 +402,16 @@ lldb_private::DynamicLoader *ProcessKDP::GetDynamicLoader() { Status ProcessKDP::WillResume() { return Status(); } -Status ProcessKDP::DoResume() { +Status ProcessKDP::DoResume(RunDirection direction) { rocallahan wrote: The decision wa

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -3139,6 +3146,7 @@ void PruneThreadPlans(); // m_currently_handling_do_on_removals are true, // Resume will only request a resume, using this // flag to check. + lldb::RunDirection m_last_run_d

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -52,7 +52,7 @@ class ProcessWindows : public Process, public ProcessDebugger { Status DoAttachToProcessWithID( lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override; - Status DoResume() override; + Status DoResume(lldb::RunDirection d

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid, return error; } -Status ProcessWindows::DoResume() { +Status ProcessWindows::DoResume(RunDirection direction) { Log *log = GetLog(WindowsLog::Process); llvm::sys::ScopedLock lock(m_mutex);

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); rocallahan wrote: I have made this change. https://github.com/llvm/llvm-pro

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > Ack, sorry I'm bad at the formalities. No problem. Thank you for your time. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -3271,6 +3273,11 @@ Status Process::PrivateResume() { if (!GetModID().IsLastResumeForUserExpression()) ResetExtendedCrashInfoDict(); + if (m_last_run_direction != direction) { rocallahan wrote: Done. https://github.com/llvm/llvm-project/pull/99736

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -510,8 +510,9 @@ def start(self): self._thread.start() def stop(self): -self._thread.join() -self._thread = None +if self._thread is not None: rocallahan wrote: This is not an LLDB stop or an LLDB thread. `thread_` is t

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -142,6 +142,9 @@ class StopInfo : public std::enable_shared_from_this { static lldb::StopInfoSP CreateStopReasonProcessorTrace(Thread &thread, const char *description); + static lldb::StopInfoSP rocallahan wrote: Adding a comment. https://github.com

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

2024-09-24 Thread Robert O'Callahan via lldb-commits
@@ -3169,6 +3176,7 @@ void PruneThreadPlans(); // m_currently_handling_do_on_removals are true, // Resume will only request a resume, using this // flag to check. + lldb::RunDirection m_last_run_d

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

2024-09-23 Thread via lldb-commits
https://github.com/jimingham approved this pull request. LGTM. I went through and made a couple non-essential comment suggestions. But this looks ready to go in to me. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lld

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

2024-09-23 Thread via lldb-commits
jimingham wrote: > @clayborg @jimingham Can I please have some love? I don't want to keep > telling users "you should be using GDB" and I've done a significant amount of > work here. Ack, sorry I'm bad at the formalities. I was under the impression that most of the actual reviewing had been

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

2024-09-23 Thread via lldb-commits
@@ -3271,6 +3273,11 @@ Status Process::PrivateResume() { if (!GetModID().IsLastResumeForUserExpression()) ResetExtendedCrashInfoDict(); + if (m_last_run_direction != direction) { jimingham wrote: In the "resolved" discussion we talked about the fact th

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

2024-09-23 Thread via lldb-commits
@@ -510,8 +510,9 @@ def start(self): self._thread.start() def stop(self): -self._thread.join() -self._thread = None +if self._thread is not None: jimingham wrote: It's not obvious when you'd get a stop with no thread. Why

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

2024-09-23 Thread via lldb-commits
@@ -142,6 +142,9 @@ class StopInfo : public std::enable_shared_from_this { static lldb::StopInfoSP CreateStopReasonProcessorTrace(Thread &thread, const char *description); + static lldb::StopInfoSP jimingham wrote: Ah, okay, you do for eStopReasonHistor

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

2024-09-23 Thread via lldb-commits
@@ -142,6 +142,9 @@ class StopInfo : public std::enable_shared_from_this { static lldb::StopInfoSP CreateStopReasonProcessorTrace(Thread &thread, const char *description); + static lldb::StopInfoSP jimingham wrote: Do you somewhere make it obvious what

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

2024-09-23 Thread via lldb-commits
@@ -3169,6 +3176,7 @@ void PruneThreadPlans(); // m_currently_handling_do_on_removals are true, // Resume will only request a resume, using this // flag to check. + lldb::RunDirection m_last_run_d

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

2024-09-21 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: @clayborg @jimingham Can I please have some love? I don't want to keep telling users "you should be using GDB" and I've done a significant amount of work here. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing

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

2024-08-20 Thread Adrian Vogelsgesang via lldb-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-08-19 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: @clayborg @jimingham I think the issues you have raised so far are satisfactorily addressed by the current code. Can you confirm that is true? And if so, can we proceed with the actual code review? Thanks. https://github.com/llvm/llvm-project/pull/99736 __

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

2024-08-09 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From 3aa5a6f08487314f12b7b0d2d13ccd20f306f16c 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

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

2024-08-09 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From 52b133ee9fda7b6cc3b6300756e7b8ec82a6a9bf 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

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

2024-08-09 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > > @clayborg as far as I can tell, the ball is currently in your court to > > respond to @jimingham ... thanks in advance > > Sounds like Jim is on the fence with a SetDirection + existing APIs and > adding a direction to the calls. I am fine with either approach as long as

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

2024-08-09 Thread Greg Clayton via lldb-commits
clayborg wrote: > @clayborg as far as I can tell, the ball is currently in your court to > respond to @jimingham ... thanks in advance Sounds like Jim is on the fence with a SetDirection + existing APIs and adding a direction to the calls. I am fine with either approach as long as Jim is ok w

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

2024-08-04 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: @clayborg as far as I can tell, the ball is currently in your court to respond to @jimingham ... thanks in advance https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://list

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

2024-07-29 Thread via lldb-commits
jimingham wrote: > On Jul 29, 2024, at 3:16 PM, rocallahan ***@***.***> wrote: > > > Is there a notion of "reverse stepping" like "take me to the line that > preceded this one in execution history", and if so what contains the logic > that does that? > > rr supports the "bs" gdbserver pack

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

2024-07-29 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > Is there a notion of "reverse stepping" like "take me to the line that > preceded this one in execution history", and if so what contains the logic > that does that? rr supports the "bs" gdbserver packet to reverse-step a single instruction (and so does the test proxy I'm

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

2024-07-29 Thread via lldb-commits
jimingham wrote: > On Jul 29, 2024, at 1:06 PM, rocallahan ***@***.***> wrote: > > > As it stands, this will allow "reverse continue to a breakpoint", right? > > Using rr as the backend you can reverse-continue to any stop, including > signals, watchpoints and the "history boundary" i.e. st

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

2024-07-29 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > As it stands, this will allow "reverse continue to a breakpoint", right? Using rr as the backend you can reverse-continue to any stop, including signals, watchpoints and the "history boundary" i.e. start of time. I expect the other stop types don't work well yet. I plan to

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

2024-07-29 Thread via lldb-commits
jimingham wrote: > > First off, for systems that do past motion and forward motion, there are > > things you really can't do effectively in the past, like set variable > > values and have that make any difference. So we probably will need to know > > whether we're executing in the immutable pa

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

2024-07-26 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > The two are different when it comes to the ABI Yeah OK. I've fixed that. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb

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

2024-07-26 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From e9a44b4cfd2e3423fbf5ac75124530cc2bb8afed 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

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

2024-07-26 Thread Pavel Labath via lldb-commits
labath wrote: > One thing that's not entirely clear to me from the discussion so far: > apparently the public API rules allow adding an overload of > `SBProcess::Continue()` with a direction parameter. Do they allow just adding > a direction parameter to the existing overload _with a default v

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

2024-07-26 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: One thing that's not entirely clear to me from the discussion so far: apparently the public API rules allow adding an overload of `SBProcess::Continue()` with a direction parameter. Do they allow just adding a direction parameter to the existing overload *with a default value

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

2024-07-25 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > First off, for systems that do past motion and forward motion, there are > things you really can't do effectively in the past, like set variable values > and have that make any difference. So we probably will need to know whether > we're executing in the immutable past or t

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

2024-07-25 Thread via lldb-commits
jimingham wrote: > On Jul 25, 2024, at 3:34 PM, Greg Clayton ***@***.***> wrote: > > > @clayborg commented on this pull request. > > In lldb/include/lldb/API/SBProcess.h > : > > > - lldb::SBError Continue(); > + lldb

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

2024-07-25 Thread via lldb-commits
jimingham wrote: > On Jul 25, 2024, at 4:58 PM, rocallahan ***@***.***> wrote: > > > Most of the execution control logic should just know "forward" and > "backwards", but then whether those are implemented by using the reverse > debugging machinery or by allowing the program to run for real

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

2024-07-25 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > Most of the execution control logic should just know "forward" and > "backwards", but then whether those are implemented by using the reverse > debugging machinery or by allowing the program to run for realz will be know > deeper in the execution control machinery - most li

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

2024-07-25 Thread Greg Clayton via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); clayborg wrote: @jimingham: do you want all process control function to rema

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

2024-07-25 Thread via lldb-commits
jimingham wrote: BTW, another reason I want to focus here on direction and not on explicitly stating "reverse continue" and "actual resume" is that a lot of "forward" motion in a debug session with reverse debugging capability is actually going to be going "forward" but using the "reverse" mac

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

2024-07-23 Thread via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); jimingham wrote: I think it should be possible for most of lldb not to care

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

2024-07-23 Thread via lldb-commits
@@ -1363,6 +1374,43 @@ Status ProcessGDBRemote::DoResume() { } } +if (direction == RunDirection::eRunReverse && continue_packet_error) { + if (num_continue_C_tids > 0 || num_continue_S_tids > 0) { +error.SetErrorString("can't deliver signals while ru

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

2024-07-23 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From 026930762e967f84f48f8958c2448734692ad62f 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

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

2024-07-23 Thread Robert O'Callahan via lldb-commits
@@ -1363,6 +1374,43 @@ Status ProcessGDBRemote::DoResume() { } } +if (direction == RunDirection::eRunReverse && continue_packet_error) { + if (num_continue_C_tids > 0 || num_continue_S_tids > 0) { +error.SetErrorString("can't deliver signals while ru

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

2024-07-23 Thread Robert O'Callahan via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); rocallahan wrote: Yeah, I originally wrote everything as you suggested, and

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

2024-07-23 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,119 @@ +import lldb +import time +import unittest +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbreverse import ReverseTestBase +from lldbsuite.test import lldbutil +

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

2024-07-23 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,176 @@ +import logging +import os +import os.path +import random + +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +import lldbgdbserverutils +from lldbsuite.support import seven + + +class GDBProxyTestBase(TestBase): +

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

2024-07-23 Thread via lldb-commits
jimingham wrote: More generally, I think it will be more natural if reverse and forward continuations to be as much as possible "the exact same execution control machinery with a direction" not separate "forward" and "reverse" facilities. So I'd rather we not start off separating them artific

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

2024-07-23 Thread via lldb-commits
jimingham wrote: > On Jul 23, 2024, at 9:47 AM, Greg Clayton ***@***.***> wrote: > > > @clayborg requested changes on this pull request. > > In lldb/include/lldb/API/SBProcess.h > : > > > - lldb::SBError Continue(); >

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

2024-07-23 Thread via lldb-commits
@@ -1363,6 +1374,43 @@ Status ProcessGDBRemote::DoResume() { } } +if (direction == RunDirection::eRunReverse && continue_packet_error) { + if (num_continue_C_tids > 0 || num_continue_S_tids > 0) { +error.SetErrorString("can't deliver signals while ru

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

2024-07-23 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -158,7 +158,7 @@ class LLDB_API SBProcess { lldb::SBError Destroy(); - lldb::SBError Continue(); + lldb::SBError Continue(RunDirection direction = RunDirection::eRunForward); clayborg wrote: Our public API has rules: - can't change any existing API ca

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -1129,10 +1129,15 @@ class Process : public std::enable_shared_from_this, /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - virtual Status DoResume() { + virtual Status DoResume(lldb::RunDirection direction) { clayborg wrot

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -135,6 +135,9 @@ FLAGS_ENUM(LaunchFlags){ /// Thread Run Modes. enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping }; +/// Execution directions +enum RunDirection { eRunForward, eRunReverse }; + clayborg wrote: If we don't add an overload to

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid, return error; } -Status ProcessWindows::DoResume() { +Status ProcessWindows::DoResume(RunDirection direction) { clayborg wrote: We should use `DoResumeReverse()` in Process.h and

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -52,7 +52,7 @@ class ProcessWindows : public Process, public ProcessDebugger { Status DoAttachToProcessWithID( lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override; - Status DoResume() override; + Status DoResume(lldb::RunDirection d

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -402,9 +402,16 @@ lldb_private::DynamicLoader *ProcessKDP::GetDynamicLoader() { Status ProcessKDP::WillResume() { return Status(); } -Status ProcessKDP::DoResume() { +Status ProcessKDP::DoResume(RunDirection direction) { clayborg wrote: We should use `Do

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -52,7 +52,7 @@ class ScriptedProcess : public Process { void DidResume() override; - Status DoResume() override; + Status DoResume(lldb::RunDirection direction) override; clayborg wrote: We should use `DoResumeReverse()` in Process.h and this change w

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -182,10 +182,17 @@ void ScriptedProcess::DidResume() { m_pid = GetInterface().GetProcessID(); } -Status ScriptedProcess::DoResume() { +Status ScriptedProcess::DoResume(RunDirection direction) { clayborg wrote: We should use `DoResumeReverse()` in Process

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -203,11 +203,17 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid, return error; } -Status ProcessWindows::DoResume() { +Status ProcessWindows::DoResume(RunDirection direction) { Log *log = GetLog(WindowsLog::Process); llvm::sys::ScopedLock lock(m_mutex);

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -874,10 +874,10 @@ class Process : public std::enable_shared_from_this, /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - Status Resume(); + Status Resume(lldb::RunDirection direction = lldb::eRunForward); clayborg wrote:

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

2024-07-23 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -90,7 +90,7 @@ class ProcessKDP : public lldb_private::Process { // Process Control lldb_private::Status WillResume() override; - lldb_private::Status DoResume() override; + lldb_private::Status DoResume(lldb::RunDirection direction) override; claybor

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -111,7 +111,7 @@ class ProcessGDBRemote : public Process, // Process Control Status WillResume() override; - Status DoResume() override; + Status DoResume(lldb::RunDirection direction) override; clayborg wrote: We should use `DoResumeReverse()` in Pr

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

2024-07-23 Thread Greg Clayton via lldb-commits
@@ -3139,6 +3146,7 @@ void PruneThreadPlans(); // m_currently_handling_do_on_removals are true, // Resume will only request a resume, using this // flag to check. + lldb::RunDirection m_last_run_d

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

2024-07-23 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-07-23 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,119 @@ +import lldb +import time +import unittest +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbreverse import ReverseTestBase +from lldbsuite.test import lldbutil +

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

2024-07-23 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,176 @@ +import logging +import os +import os.path +import random + +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +import lldbgdbserverutils +from lldbsuite.support import seven + + +class GDBProxyTestBase(TestBase): +

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

2024-07-23 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I've only really reviewed the test code, but that looks (mostly) good to me. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -3281,7 +3288,11 @@ Status Process::PrivateResume() { "Process::PrivateResume PreResumeActions failed, not resuming."); } else { m_mod_id.BumpResumeID(); -error = DoResume(); +if (direction == eRunForward) { + error = DoResu

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/99736 >From 5ecca71b03027e132f3b75612c0783a68eafdf4f 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

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

2024-07-22 Thread via lldb-commits
jimingham wrote: > On Jul 22, 2024, at 3:44 PM, rocallahan ***@***.***> wrote: > > > You might have to be careful in the case where someone runs a function call, > stops at a breakpoint in the function call and decides to go backwards in the > function execution (if that's possible). > > T

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

2024-07-22 Thread via lldb-commits
jimingham wrote: > On Jul 22, 2024, at 2:54 PM, rocallahan ***@***.***> wrote: > > > @rocallahan commented on this pull request. > > In lldb/source/Target/Process.cpp > : > > > @@ -3264,6 +3266,11 @@ Status Process::Pr

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > You might have to be careful in the case where someone runs a function call, > stops at a breakpoint in the function call and decides to go backwards in the > function execution (if that's possible). That is not possible in rr. During user function calls it responds to reve

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

2024-07-22 Thread via lldb-commits
jimingham wrote: > On Jul 22, 2024, at 2:56 PM, rocallahan ***@***.***> wrote: > > > @rocallahan commented on this pull request. > > In lldb/source/Target/Process.cpp > : > > > @@ -3264,6 +3266,11 @@ Status Process::Pr

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

2024-07-22 Thread via lldb-commits
jimingham wrote: > On Jul 22, 2024, at 2:52 PM, rocallahan ***@***.***> wrote: > > > @rocallahan commented on this pull request. > > In lldb/source/Target/Process.cpp > : > > > @@ -3264,6 +3266,11 @@ Status Process::Pr

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -3281,7 +3288,11 @@ Status Process::PrivateResume() { "Process::PrivateResume PreResumeActions failed, not resuming."); } else { m_mod_id.BumpResumeID(); -error = DoResume(); +if (direction == eRunForward) { + error = DoResu

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan edited https://github.com/llvm/llvm-project/pull/99736 ___ 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 #99736)

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -3264,6 +3266,11 @@ Status Process::PrivateResume() { // filters before resuming. UpdateAutomaticSignalFiltering(); + if (m_last_run_direction != direction) { rocallahan wrote: If the user does "continue", hits a breakpoint, does "reverse-step", and t

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -3264,6 +3266,11 @@ Status Process::PrivateResume() { // filters before resuming. UpdateAutomaticSignalFiltering(); + if (m_last_run_direction != direction) { rocallahan wrote: I'm a bit worried that in general thread plans have a lot of complexity, a

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -3264,6 +3266,11 @@ Status Process::PrivateResume() { // filters before resuming. UpdateAutomaticSignalFiltering(); + if (m_last_run_direction != direction) { rocallahan wrote: TBH I don't understand thread plans very well yet so I was trying to avoid

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -1395,6 +1395,94 @@ Status ProcessGDBRemote::DoResume() { return error; } +Status ProcessGDBRemote::DoResumeReverse() { + Status error; + Log *log = GetLog(GDBRLog::Process); + LLDB_LOGF(log, "ProcessGDBRemote::DoResumeReverse()"); + + ListenerSP listener_sp( + L

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

2024-07-22 Thread Robert O'Callahan via lldb-commits
@@ -160,6 +160,8 @@ class LLDB_API SBProcess { lldb::SBError Continue(); + lldb::SBError ReverseContinue(); rocallahan wrote: Yeah OK. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing li

  1   2   >