Community
Participate
Working Groups
Created attachment 169891 [details] Screenshot of useless and empty editors This bug happens after the fix to bug 308835. We basically seen useless and empty editor being opened during multi-threaded all-stop programs with DSF-GDB. To reproduce, use the below program and set a breakpoint at the printf as indicated in the program. After the program stops at main, every time we press 'continue', an editor will be opened for the new value of the old selection, before the new selection is activated. E.g., if thread1.frame0 is selected and we continue, once the program stops, a new editor for the new thread1.frame0 will be opened, and right after, the editor for the new selection (where the program actually stopped) say thread2.frame0 will be opened. This happens over and over with each 'continue' and leaves all these editors opened. Please see screenshot. #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <sched.h> #include <errno.h> #include <time.h> #include <sys/types.h> #include <unistd.h> /* Infinite prints. The parameter is unused. Does not return. */ void *my_func(void *unused) { int j; struct timespec t; while (1) { j = sched_rr_get_interval(getpid(), &t); if (j != 0) { printf("Error: %d\n", errno); } else { printf("%d: %ld\n", (int)unused, t.tv_nsec); // add break here sleep(1); } } return NULL; } /* The main program. */ int main() { pthread_t *t_id; pthread_attr_t attr; int j = 0; for (j = 0; j < 75; j++) { pthread_attr_init(&attr); /* Create a new thread. The new thread will run the print_xs function. */ t_id = (pthread_t *) malloc(sizeof(pthread_t)); printf("Creating %d\n", j); pthread_create(t_id, &attr, &my_func, (void *)j); } while (1) { printf("In main()\n"); } return 0; }
*** Bug 322311 has been marked as a duplicate of this bug. ***
Created attachment 179154 [details] prevent multiple source not found editors The attached patch will prevent multiple source not found editors from opening.
Committed to HEAD.
*** cdt cvs genie on behalf of kryall *** Bug 314350 - [debug view] Multi-threaded programs can cause the opening of useless and empty editors [*] DsfSourceDisplayAdapter.java 1.18 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java?root=Tools_Project&r1=1.17&r2=1.18
Can we have the patch in CDT 7.0.2?