[Lldb-commits] [PATCH] D100243: [LLDB][GUI] Expand selected thread tree item by default
Omar Emara via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 20 06:43:55 PDT 2021
OmarEmaraDev marked 2 inline comments as done.
OmarEmaraDev added inline comments.
================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:2211-2213
+ if (selected_thread->GetID() == thread->GetID()) {
+ item[i].Expand();
+ }
----------------
clayborg wrote:
> clayborg wrote:
> > Remove parens for single statement if due to LLVM coding guidelines.
> It would be great if we can also select the currently selected stack frame here. Something like:
>
> ```
> if (selected_thread && selected_thread->GetID() == thread->GetID()) {
> item[i].Expand();
> StackFrameSP selected_frame = thread->GetSelectedFrame();
> if (selected_frame) {
> // Add all frames and select the right one...
> }
> }
> ```
@clayborg I didn't implement selection in this patch because my implementation didn't look great and I thought selection could be refactored to to make handling easier.
I haven't looked at this in more details yet, but I was thinking that maybe instead of having linear selection, we would have it hierarchical.
Each tree item declares which of its children is selected, so the process item will declare which thread item is selected and the selected thread item will declare which frame item is selected and so on.
It could be more conceptually correct because when selecting a frame, you are also selecting its parent thread. And selection can be checked by traversing parents and highlighting can be done by checking for leaf items. Something like that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100243/new/
https://reviews.llvm.org/D100243
More information about the lldb-commits
mailing list