[Lldb-commits] [PATCH] D105655: [LLDB][GUI] Add Process Attach form

Omar Emara via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 13 04:09:22 PDT 2021


OmarEmaraDev planned changes to this revision.
OmarEmaraDev added a comment.

Currently working on the detach/kill form.



================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:2346
+      return;
+
+    if (process->GetShouldDetach()) {
----------------
clayborg wrote:
> We might want to pop up a dialog here asking the user if they want to kill or detach since we have a GUI. In the "process attach" command we confirm with the user if the terminal is interactive. 
> A few ways we can do this:
> - popup a form asking the user to kill/detach/cancel when the user hits submit on this form
> - pop up the dialog before even showing the this form and asking the user to kill or detach, then show this form after that has been handled
> - not allow the Process->Attach to happen by disabling the menu item when a process is running.
> 
> 
I think the first option is the best, because it delays this decision at the very end giving the user as much time as possible to cancel attaching without altering the debugger state.


================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:2420-2421
+
+    if (attach_info.GetContinueOnceAttached())
+      process_sp->Resume();
+
----------------
clayborg wrote:
> You shouldn't need to do this since you already called ProcessAttachInfo::SetContinueOnceAttached(true) on the attach_info. LLDB should take care of this for you already I think.
In the command code, there is this snippet of code at the end, so I though it might be necessary:

```lang=cpp
    // This supports the use-case scenario of immediately continuing the
    // process once attached.
    if (m_options.attach_info.GetContinueOnceAttached())
      m_interpreter.HandleCommand("process continue", eLazyBoolNo, result);
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105655/new/

https://reviews.llvm.org/D105655



More information about the lldb-commits mailing list