diff options
author | Robert O'Callahan <rocallahan@google.com> | 2025-04-24 11:16:30 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-23 16:16:30 -0700 |
commit | 239718055d7260caa3e6631e82d68ac27e01c1f4 (patch) | |
tree | bc7b6df209f925167cb690e955cf3f53da47bd08 /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | 4f36ada1e205df08ad4377df88729f8defb36558 (diff) | |
download | llvm-239718055d7260caa3e6631e82d68ac27e01c1f4.zip llvm-239718055d7260caa3e6631e82d68ac27e01c1f4.tar.gz llvm-239718055d7260caa3e6631e82d68ac27e01c1f4.tar.bz2 |
[lldb] Implement CLI support for reverse-continue (#132783)
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`.
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 654dfa8..ed80c85 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -468,7 +468,13 @@ protected: case 'b': m_run_to_bkpt_args.AppendArgument(option_arg); m_any_bkpts_specified = true; - break; + break; + case 'F': + m_base_direction = lldb::RunDirection::eRunForward; + break; + case 'R': + m_base_direction = lldb::RunDirection::eRunReverse; + break; default: llvm_unreachable("Unimplemented option"); } @@ -479,6 +485,7 @@ protected: m_ignore = 0; m_run_to_bkpt_args.Clear(); m_any_bkpts_specified = false; + m_base_direction = std::nullopt; } llvm::ArrayRef<OptionDefinition> GetDefinitions() override { @@ -488,6 +495,7 @@ protected: uint32_t m_ignore = 0; Args m_run_to_bkpt_args; bool m_any_bkpts_specified = false; + std::optional<lldb::RunDirection> m_base_direction; }; void DoExecute(Args &command, CommandReturnObject &result) override { @@ -654,6 +662,9 @@ protected: } } + if (m_options.m_base_direction.has_value()) + process->SetBaseDirection(*m_options.m_base_direction); + const uint32_t iohandler_id = process->GetIOHandlerID(); StreamString stream; |