mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Bug 338136: Show the proper inferior console when selecting a container in the debug view. This support is for multi-process.
This commit is contained in:
parent
745fbced67
commit
85a953ca4c
1 changed files with 23 additions and 7 deletions
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.GDBProcess;
|
import org.eclipse.cdt.dsf.gdb.launching.GDBProcess;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.InferiorRuntimeProcess;
|
import org.eclipse.cdt.dsf.gdb.launching.InferiorRuntimeProcess;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.debug.core.ILaunch;
|
import org.eclipse.debug.core.ILaunch;
|
||||||
import org.eclipse.debug.core.model.IProcess;
|
import org.eclipse.debug.core.model.IProcess;
|
||||||
|
@ -140,7 +141,7 @@ public class ConsolePageParticipant implements IConsolePageParticipant, IDebugCo
|
||||||
// We have to check that the process is actually from a DSF-GDB session,
|
// We have to check that the process is actually from a DSF-GDB session,
|
||||||
// since the current context could be for any debug session
|
// since the current context could be for any debug session
|
||||||
if (processes[0] instanceof GDBProcess) {
|
if (processes[0] instanceof GDBProcess) {
|
||||||
return launch.getProcesses()[0];
|
return processes[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,12 +155,27 @@ public class ConsolePageParticipant implements IConsolePageParticipant, IDebugCo
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
ILaunch launch = (ILaunch)context.getAdapter(ILaunch.class);
|
ILaunch launch = (ILaunch)context.getAdapter(ILaunch.class);
|
||||||
if (launch != null) {
|
if (launch != null) {
|
||||||
for (IProcess process : launch.getProcesses()) {
|
IProcess[] processes = launch.getProcesses();
|
||||||
String groupId = process.getAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR);
|
if (processes != null && processes.length > 0) {
|
||||||
if (container.getGroupId().equals(groupId)) {
|
for (IProcess process : launch.getProcesses()) {
|
||||||
return process;
|
if (process instanceof InferiorRuntimeProcess) {
|
||||||
}
|
String groupId = process.getAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR);
|
||||||
}
|
|
||||||
|
if (groupId == null || groupId.equals(MIProcesses.UNIQUE_GROUP_ID) ||
|
||||||
|
container.getGroupId().equals(groupId)) {
|
||||||
|
// if the groupId is not set in the process we know we are dealing
|
||||||
|
// with single process debugging and we can just return the inferior.
|
||||||
|
// If the groupId is set, then we must find the proper inferior
|
||||||
|
return process;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// No inferior? return the gdb process
|
||||||
|
if (processes[0] instanceof GDBProcess) {
|
||||||
|
return processes[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue