-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Implement CLI support for reverse-continue #132783
base: main
Are you sure you want to change the base?
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
This introduces the options "-F/--forward" and "-R/--reverse" to `process continue`. These only work if you're running with a gdbserver backend that supports reverse execution, such as rr. For testing we rely on the fake reverse- execution functionality in `lldbreverse.py`.
e6d07af
to
0067c5c
Compare
I suppose we need to add documentation for this but I'm not sure where... |
@jimingham @labath Here's a PR adding |
def thread_continue_forward : Option<"forward", "F">, Group<3>, | ||
Desc<"Execute in forward direction">; | ||
def thread_continue_reverse : Option<"reverse", "R">, Group<3>, | ||
Desc<"Execute in forward direction">; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/forward/reverse
Afaict, your code change should already be sufficient such that In addition, I guess we would eventually want to also document more generally how to use rr with lldb (how to start the rr replay, how to connect lldb to it, etc.) such that end users are able to discover this feature. However, I guess before doing so, we would like to also implement reverse single- stepping etc.? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably also want to test that
- reverse-continue on a non-reverse-capable process gives a decent error message
process continue --forward
also work for non-reverse-capable processes
case 'R': | ||
if (m_base_direction == lldb::RunDirection::eRunForward) { | ||
error = Status::FromErrorString( | ||
"cannot specify both 'forward' and 'reverse'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to add a test case for this error condition?
This introduces the options "-F/--forward" and "-R/--reverse" to
process continue
.These only work if you're running with a gdbserver backend that supports reverse execution, such as rr. For testing we rely on the fake reverse-execution functionality in
lldbreverse.py
.