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

2024-07-19 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan created https://github.com/llvm/llvm-project/pull/99736 This commit only adds support for the `SBProcess::ReverseContinue()` API. A user-accessible command for this will follow in a later commit. This feature depends on a gdbserver implementation (e.g. `rr`) provi

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

2024-07-19 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: BTW this was discussed in https://discourse.llvm.org/t/how-to-test-reverse-execution-support-in-lldb/79696. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > I've noticed you didn't check if this works both when the debugger is in > synchronous and asynchronous in your tests. OK, I've added this. > I'm not sure what additional information does the History Boundary stop > reason provides. Can it actually provide historical data

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -1395,6 +1395,91 @@ 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-20 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,79 @@ +import lldb +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 + + +class TestR

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,79 @@ +import lldb +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 + + +class TestR

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,12 @@ +static void start_recording() {} + +static void trigger_breakpoint() {} + +static void stop_recording() {} rocallahan wrote: None of that functionality interacts with reverse execution, so I don't think we need to test it in combination with re

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,79 @@ +import lldb +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 + + +class TestR

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -1881,18 +1970,24 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo( handled = true; } } else if (!signo) { -addr_t pc = thread_sp->GetRegisterContext()->GetPC(); -lldb::BreakpointSiteSP bp_site_sp = -thread_sp->GetProcess()-

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

2024-07-20 Thread Robert O'Callahan via lldb-commits
@@ -1881,18 +1970,24 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo( handled = true; } } else if (!signo) { -addr_t pc = thread_sp->GetRegisterContext()->GetPC(); -lldb::BreakpointSiteSP bp_site_sp = -thread_sp->GetProcess()-

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

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

[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
@@ -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
@@ -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: 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
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
@@ -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
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 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 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-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 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
@@ -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
@@ -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-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 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-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-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 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-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 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-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-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 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
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-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 #112079)

2024-10-11 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From c373425ab4be848bb376d2710e13efafb6058d11 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-10-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > added @skipIfDarwin markers to the TestReverseContinueBreakpoints.py and > TestReverseContinueNotSupported.py API tests because lldb-server is not > supported in gdbserver mode on Darwin systems So there is no LLDB-based daemon that implements the gdbserver protocol on Dar

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

2024-10-19 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > @rocallahan does rr work on Mac? No, it doesn't. It does work on Linux AAarch64 though. > This didn't work because we also build lldb-server on macOS. Hmm, so lldb-server is built on macOS but we're not supposed to use it? https://github.com/llvm/llvm-project/pull/112079 _

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

2024-10-19 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: I'd like the tests to work on Mac. I'm getting some assistance and we'll report back in a few days. https://github.com/llvm/llvm-project/pull/112079 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2024-10-10 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > @rocallahan Let me know if you need me to merge this on your behalf. Please do! Thanks! https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

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

2024-10-10 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: I don't know what your normal protocol is but maybe you should revert it while I debug the failure? The last successful CI run in this PR was from September 25. https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailin

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

2024-10-22 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From bb96e6ddd2d6448be01b1965591cf8ee77e14569 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 #112079)

2024-10-11 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan created https://github.com/llvm/llvm-project/pull/112079 This commit only adds support for the `SBProcess::ReverseContinue()` API. A user-accessible command for this will follow in a later commit. This feature depends on a gdbserver implementation (e.g. `rr`) prov

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

2024-10-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: I have created a new PR #112079 to continue work on this. Is there a way to run the full post-merge CI test suite against a Github PR? https://github.com/llvm/llvm-project/pull/99736 ___ lldb-commits mailing list lldb-commits@lists.ll

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

2024-10-11 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan edited 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-10-11 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From 9f33f8e5e0efb74772022c4ffadb65a6aefedf55 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 #112079)

2024-10-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: I adapted the code from here https://github.com/llvm/llvm-project/blob/a62768c427ec1f34d7c3823021a6c5a794709103/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py#L516 into `lldbgdbproxy.py`: ``` +lldb_server_exe = lldbgdbserverutils.get_lldb_server

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

2024-10-14 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > I'd say that this is failing because macos generates slightly different > packet sequences, and the test is not expecting those. Makes sense. But given Mac tests don't run against PRs, and I don't have a Mac, how am I supposed to debug this? https://github.com/llvm/llvm-pr

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

2024-11-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > My notion was that when you push a plan that has an intention to run in a > direction, if the plan above it on the stack was going in the opposite > direction, it has to be popped. That's in the current code in this PR but I agree that was the wrong direction. My experimen

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

2024-11-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: Giving ThreadPlans a direction gets complicated when there are multiple runnable threads, because the topmost plans for different runnable threads could disagree about the execution direction, which is obviously unworkable. In my experimental branch I linked above, I resolve

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

2024-11-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: The approach I implemented fails when evaluating a breakpoint condition requires running a function in the target process, e.g. evaluating a breakpoint condition that's a function call, or calling `mmap()` to allocate memory for JITted code. That pushes a `ThreadPlanCallFunct

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

2024-11-11 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: Thanks, that sounds OK but I don't see how it would help with my main question right now: > So what would be a good way to pop `ThreadPlanReverseContinue`? Put it another way: if we change the plan stack state to request reverse execution (push a `ThreadPlanReverseContinue`,

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

2024-11-12 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: > I worry that in a situation like this where there's a pending task people > will go the wrong way and lose important state because they forgot that > "continue" doesn't mean "continue what I was doing" - which is what it > currently means in lldb I don't know of any other

[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-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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
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] Unify/improve MainLoop signal handling (PR #115197)

2024-11-14 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: In any case I am OOO and mostly offline until Nov 26. Rob https://github.com/llvm/llvm-project/pull/115197 ___ 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-11-26 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From 6d8f3ccf7b30334853e07e141f41545d68870bb8 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 #112079)

2024-11-26 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From 91d40f5e331b97a202208c221ef6b11784dc8ca2 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 #112079)

2024-11-26 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From c0904fed59e42d957e2b40698c4343fdb5582b21 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 #112079)

2024-11-14 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: Ok, tell me what you think of this proposal: 1) Each thread plan has a virtual `GetDirection()` method returning `RunDirection`. Existing plans other than `ThreadBasePlan` return `eRunForward`. 2) There is a per-process `base direction` flag. `ThreadBasePlan::GetDirection()`

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-02-07 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: @adrian-prantl can we have that help please? Also, is that link supposed to be accessible to the public? Because it's 404 for me. https://github.com/llvm/llvm-project/pull/123945 ___ lldb-commits mailing list lldb-commits@lists.llvm.

[Lldb-commits] [lldb] [lldb] Add support for gdb-style 'x' packet (PR #124733)

2025-01-30 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: It sounds fine. rr HEAD uses the Gdb flavour for GDB and the old-LLDB flavor for LLDB. After a decent amount of time has passed I will update to the new regime. https://github.com/llvm/llvm-project/pull/124733 ___ lldb-commits maili

[Lldb-commits] [lldb] [lldb] Add support for gdb-style 'x' packet (PR #124733)

2025-01-30 Thread Robert O'Callahan via lldb-commits
rocallahan wrote: And thanks! https://github.com/llvm/llvm-project/pull/124733 ___ 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-17 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From b021a56268c74010eae017d2d1169ab8b79978b3 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 17 Dec 2024 23:40:34 + Subject: [PATCH 1/9] [lldb] Move thread-notification setup to happen later

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -115,14 +115,18 @@ class ThreadList : public ThreadCollection { /// If a thread can "resume" without having to resume the target, it /// will return false for WillResume, and then the process will not be /// restarted. + /// Sets *direction to the run direction of the

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -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 resu

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -583,6 +583,14 @@ SBError SBProcess::Continue() { return sb_error; } +SBError SBProcess::ContinueInDirection(RunDirection direction) { + ProcessSP process_sp(GetSP()); + if (process_sp) { +process_sp->SetBaseDirection(direction); + } rocallahan wro

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,185 @@ +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 #112079)

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,185 @@ +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 #112079)

2024-12-17 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From 0c9f80e8d0e925cc75e6ef2696955e2a60782689 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 17 Dec 2024 23:40:34 + Subject: [PATCH 1/9] Move thread-notification setup to happen later and ch

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -608,19 +594,47 @@ bool ThreadList::WillResume() { } bool need_to_resume = true; - 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

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,151 @@ +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 #112079)

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -199,6 +199,20 @@ uint64_t GDBRemoteCommunicationClient::GetRemoteMaxPacketSize() { return m_max_packet_size; } +bool GDBRemoteCommunicationClient::GetReverseContinueSupported() { + if (m_supports_reverse_continue == eLazyBoolCalculate) { +GetRemoteQSupported(); +

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
https://github.com/rocallahan updated https://github.com/llvm/llvm-project/pull/112079 >From 0c9f80e8d0e925cc75e6ef2696955e2a60782689 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 17 Dec 2024 23:40:34 + Subject: [PATCH 1/9] Move thread-notification setup to happen later and ch

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

2024-12-17 Thread Robert O'Callahan via lldb-commits
@@ -0,0 +1,185 @@ +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): +

  1   2   >