diff options
| author | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-13 11:21:08 -0700 |
|---|---|---|
| committer | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-13 13:44:51 -0700 |
| commit | ec05cf50daece35e0b01d3761e64ae54efe8a78e (patch) | |
| tree | edf9d5d8fc288eb5061bac411261d34581fd360a /lldb/source/Commands/CommandObjectProcess.cpp | |
| parent | 7f3d2cc26b47568a0ac93327ab579ed1f0e21546 (diff) | |
[lldb] Improve corefile saving ergonomics
This patch improves the way the user can save the process state into a
corefile by adding completion handler that would provide tab completion
for the corefile path and also resolves the corefile path to expand
relative path.
Differential Revision: https://reviews.llvm.org/D152842
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
| -rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 82d11687d377..ab047ee926c9 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1306,6 +1306,13 @@ public: Options *GetOptions() override { return &m_options; } + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eDiskFileCompletion, request, nullptr); + } + class CommandOptions : public Options { public: CommandOptions() = default; @@ -1354,6 +1361,7 @@ protected: if (process_sp) { if (command.GetArgumentCount() == 1) { FileSpec output_file(command.GetArgumentAtIndex(0)); + FileSystem::Instance().Resolve(output_file); SaveCoreStyle corefile_style = m_options.m_requested_save_core_style; Status error = PluginManager::SaveCore(process_sp, output_file, corefile_style, |
