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 338136 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/console/ConsolePageParticipant.java (-7 / +23 lines)
Lines 16-21 Link Here
16
import org.eclipse.cdt.dsf.gdb.launching.GDBProcess;
16
import org.eclipse.cdt.dsf.gdb.launching.GDBProcess;
17
import org.eclipse.cdt.dsf.gdb.launching.InferiorRuntimeProcess;
17
import org.eclipse.cdt.dsf.gdb.launching.InferiorRuntimeProcess;
18
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
18
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
19
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
19
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.debug.core.ILaunch;
21
import org.eclipse.debug.core.ILaunch;
21
import org.eclipse.debug.core.model.IProcess;
22
import org.eclipse.debug.core.model.IProcess;
Lines 140-146 Link Here
140
        		// We have to check that the process is actually from a DSF-GDB session,
141
        		// We have to check that the process is actually from a DSF-GDB session,
141
        		// since the current context could be for any debug session
142
        		// since the current context could be for any debug session
142
        		if (processes[0] instanceof GDBProcess) {
143
        		if (processes[0] instanceof GDBProcess) {
143
        			return launch.getProcesses()[0];
144
        			return processes[0];
144
        		}
145
        		}
145
        	}
146
        	}
146
        	
147
        	
Lines 154-165 Link Here
154
			if (container != null) {
155
			if (container != null) {
155
				ILaunch launch = (ILaunch)context.getAdapter(ILaunch.class);
156
				ILaunch launch = (ILaunch)context.getAdapter(ILaunch.class);
156
				if (launch != null) {
157
				if (launch != null) {
157
					for (IProcess process : launch.getProcesses()) {
158
		        	IProcess[] processes = launch.getProcesses();
158
						String groupId = process.getAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR);
159
		        	if (processes != null && processes.length > 0) {
159
						if (container.getGroupId().equals(groupId)) {
160
		        		for (IProcess process : launch.getProcesses()) {
160
							return process;
161
		        			if (process instanceof InferiorRuntimeProcess) {
161
						}
162
		        				String groupId = process.getAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR);
162
					}
163
164
		        				if (groupId == null || groupId.equals(MIProcesses.UNIQUE_GROUP_ID) || 
165
		        					container.getGroupId().equals(groupId)) {
166
		        					// if the groupId is not set in the process we know we are dealing
167
		        					// with single process debugging and we can just return the inferior.
168
		        					// If the groupId is set, then we must find the proper inferior
169
		        					return process;
170
		        				}
171
		        			}
172
		        		}
173
174
		        		// No inferior?  return the gdb process
175
		        		if (processes[0] instanceof GDBProcess) {
176
		        			return processes[0];
177
		        		}
178
		        	}
163
				}
179
				}
164
			}
180
			}
165
		}
181
		}

Return to bug 338136