TLDR: C program, hundreds of threads, Eclipse (Oxygen 3) CDT debug view with lengthy tree. How to search?
I'm debugging some software I've written (in C, FWIW) that can generate several hundred threads. About 300 of these are started at launch, and about as many others are started dynamically to perform tasks at runtime. During certain operations I can have well over 500 threads running.
In earlier versions of the software it was possible to exercise a problem to debug it in such a way that only a handful of threads were running when the failure (eg. segfault etc) occurred, so it was reasonable to just look through the thread list in the Debug view and have an understanding of what's going on. More recently I've made many more threads launch at the beginning and while that's had a huge benefit on performance, it means that at any time I'll have a list of threads that's just too long to manually look through.
How can I find a thread based on something I know about the thread, i.e. what function it was started with (passed to pthread_create())? Specifically, how can I search through the tree displayed in the Debug window? Alternatively, I've found a way to copy the contents of this view to the clipboard, but (inexplicably) this only copies what's visible, not the actual tree contents -- how can I auto-expand the entire tree so I can copy it and search in a text editor? Clicking the little arrows to expand each of hundreds of threads to their respective call stacks is just not reasonable.
I'm developing on a RHEL 6 platform (long story, migration to modernity is pending), and for the moment I've found roadblocks in upgrading beyond Eclipse Oxygen 3a (4.7.3a), so that's what I'm stuck with for now.
EDIT: I should clarify -- it's true that I can just press Ctrl-F in the Debug window, and I get a search dialog. However, and I'm seriously dropping my jaw in disbelief here, it also only searches what's visible, not the actual contents of the tree. So for this to be useful, I'd still have to expand every thread in the list manually; there still appears to be no command to do this.
It appears that there is simply no way of searching the list of threads within the Debug view in Eclipse, in a way that is actually useful. Again, the "Find" and "Copy Stack" functions (accessible via right-click) only operate on the text that's visible in the GUI view, not the real contents of the tree.
So, as far as I can tell the only way to get the information I want is to query gdb directly, through the Debugger Console view:
thread apply all bt
OF COURSE, the contents of the Debugger Console view are not directly searchable (unlike the regular Console and most other views in Eclipse), so the text listing must then be copied and pasted into some other editor and searched, to find the thread I'm looking for. Then, with that information I can scroll to it in the Debug list, expand that thread's trace, and continue debugging.