Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 311965 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java (-5 / +16 lines)
Lines 797-809 Link Here
797
		}
797
		}
798
		// END OF WORKAROUND to be removed when GDB 7.2 is available
798
		// END OF WORKAROUND to be removed when GDB 7.2 is available
799
		
799
		
800
		IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[groups.length];
800
		// With GDB 7.1, we can receive a bogus process when we are not debugging anything
801
		for (int i = 0; i < groups.length; i++) {
801
        // -list-thread-groups
802
			String groupId = groups[i].getGroupId();
802
        // ^done,groups=[{id="0",type="process",pid="0"}]
803
		// As for GDB 7.2, the pid field is missing altogether in this case
804
		// -list-thread-groups
805
		// ^done,groups=[{id="i1",type="process"}]
806
		// Just ignore that entry
807
		List<IMIContainerDMContext> containerDmcs = new ArrayList<IMIContainerDMContext>(groups.length);
808
		for (IThreadGroupInfo group : groups) {
809
			if (group.getPid() == null || 
810
					group.getPid().equals("") || group.getPid().equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$
811
				continue;
812
			}
813
			String groupId = group.getGroupId();
803
			IProcessDMContext procDmc = createProcessContext(controlDmc, groupId); 
814
			IProcessDMContext procDmc = createProcessContext(controlDmc, groupId); 
804
			containerDmcs[i] = createContainerContext(procDmc, groupId);
815
			containerDmcs.add(createContainerContext(procDmc, groupId));
805
		}
816
		}
806
		return containerDmcs;
817
		return containerDmcs.toArray(new IMIContainerDMContext[containerDmcs.size()]);
807
	}
818
	}
808
819
809
	public void getRunningProcesses(final IDMContext dmc, final DataRequestMonitor<IProcessDMContext[]> rm) {
820
	public void getRunningProcesses(final IDMContext dmc, final DataRequestMonitor<IProcessDMContext[]> rm) {
(-)src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java (-2 / +6 lines)
Lines 318-325 Link Here
318
					}
318
					}
319
				}
319
				}
320
			}
320
			}
321
			// In the case of -list-thread-groups --available, we can use the id as the pid
321
			// In the case of -list-thread-groups --available, the pid field is not present, but the
322
			if (pid.equals("")) { //$NON-NLS-1$
322
			// pid is used as the main id.  To know we are in this case, we check that we have
323
			// a description, that only happens for -list-thread-groups --available
324
			// We must check this because with GDB 7.2, there will be no pid field as a result
325
			// of -list-thread-groups, if no process is actually running yet.
326
			if (pid.equals("") && !desc.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
323
				pid = id;
327
				pid = id;
324
			}
328
			}
325
			fGroupList[i] = new ThreadGroupInfo(id, desc, type, pid, user, cores, exec);
329
			fGroupList[i] = new ThreadGroupInfo(id, desc, type, pid, user, cores, exec);

Return to bug 311965