Community
Participate
Working Groups
The run control service bases its knowledge of thread list and thread state on Suspended and Resumed event. We currently have no way to refresh that information. We should be able to update that entire information. GDB has the command -list-thread-groups --recurse 1 which gives the list of threads and their state for all processes.
This refreshing is valuable in non-stop mode where some threads could get out-of-sync between CDT and GDB. In all-stop mode, either all threads are running or all of them are stopped, so the chance of getting out-of-sync is much smaller.
Created attachment 200614 [details] Fix to ask GDB about all threads state and update our own structures When pressing the refresh button, we will send "-list-thread-groups --recurse 1" and compare the GDB thread states with our own structures. For each difference we will send the Suspended/Resumed event that we missed. I've only made this change starting with GDB 7.2 to keep things simpler. GDB 7.3 is out, so I don't see the value in adding complexity to add this fix for GDB 7.1 (which is the earliest version that supports the --recurse option). Committed to master.
*** cdt git genie on behalf of Marc Khouzam *** Bug 353423: Need a way to refresh the thread list and state in the run control service [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d2c51aec89dfaf71d8f4f0ff41c162861f8dc9af
Created attachment 200660 [details] Simpler fix for cdt_8_0 While trying to do the fix for cdt_8_0, I found that -thread-info with no arguments gave the information I needed. No need to use the more obscure -list-thread-groups --recurse 1 So, this patch needs no API changes, which is what I needed for the maintenance branch. Committed to cdt_8_0 For consistency and simplicity, I will change master to use -thread-info as well.
Created attachment 200661 [details] Update for master to use -thread-info instead Here is the patch to make master use -thread-info instead of -list-thread-groups --recurse 1, which is more obscure.
I committed the last patch to master. BTW, another value in this fix, and my true motivation, was to show the correct threads when we stop thread visualization(see Bug 347514 comment 4). Pawel, can you review?
*** cdt git genie on behalf of Marc Khouzam *** Bug 353423: Need a way to refresh the thread list and state in the run control service [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d2e7a581bcaa0f2473f64e38273cd770108bc300
*** cdt git genie on behalf of Marc Khouzam *** Bug 353423: Simpler solution using -thread-info instead of -list-thread-groups --recurse 1 [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fd690737ac882933c09e3217efe5863e3dd94f16
Since the final solution uses -thread-info, we can use it as early as GDB 7.0. I'm re-opening the bug to move the code from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS.
Created attachment 200752 [details] Move refresh from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS for master Move refresh logic from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS for the master branch
Created attachment 200753 [details] Move refresh from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS for cdt_8_0 Move refresh logic from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS for the cdt_8_0 branch. I will commit both patches (master and cdt_8_0)
Back to fixed
*** cdt git genie on behalf of Marc Khouzam *** Bug 353423: Move refreshing of thread states from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS since -thread-info is available since GDB 7.0 [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=dba1e9d2bfb0c8fd08581b483f4fccc44a229205
*** cdt git genie on behalf of Marc Khouzam *** Bug 353423: Move refreshing of thread states from GDBRunControl_7_2_NS to GDBRunControl_7_0_NS since -thread-info is available since GDB 7.0 [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fc7775773ba515c894226f35ef1e3c09d35d775d