Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 550257

Summary: remote debugging multi-threaded application is extremely slow
Product: [Tools] CDT Reporter: Niko D <niko.d.facebook>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: CLOSED DUPLICATE QA Contact: Jonah Graham <jonah>
Severity: major    
Priority: P3 CC: cdtdoug, jonah, niko.d.facebook
Version: 9.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
gdb traces
none
remote gdb network log none

Description Niko D CLA 2019-08-20 05:45:46 EDT
I'm using Eclipse CDT to debug a remote C application on an embedded target.
The program has ~45 threads and the debugging performance is very poor.

It seems that on every step, the following actions are performed:
 1) Get thread-info for active thread (e.g. 2)
 2) Get thread-info individually for every (!) thread except the active thread (e.g. 1, 3, 4, ..., 43)
 3) Get the stack frames (stack-list-frames) for the active thread

The whole thing takes ~5s and a Wireshark capture shows that ~4000 (!) packets totalling 400kB are transferred in 4-5s.
Is it really necessary to issue the thread-info command individually for each thread?

In Wireshark I can see that for every thread, the full thread list is transferred (qXfer:threads:read) and the current stack trace (presumably) is read as well (read registers, read memory, ...).

Environment: Eclipse 4.12 running on a linux host with gdb 8.2.1. The debugged program is run on an ARM device with gdbserver 8.2.1.

The same problem also occurs with an older version of Eclipse (4.5.2 & CDT 8.8.1).
Comment 1 Niko D CLA 2019-08-20 05:46:40 EDT
Created attachment 279636 [details]
gdb traces
Comment 2 Niko D CLA 2019-08-20 05:47:10 EDT
Created attachment 279637 [details]
remote gdb network log
Comment 3 Jonah Graham CLA 2022-05-10 18:07:03 EDT
Umair in Bug 579877 is fixing this.

*** This bug has been marked as a duplicate of bug 579877 ***