|
Lines 29-37
Link Here
|
| 29 |
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; |
29 |
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; |
| 30 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
30 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
| 31 |
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; |
31 |
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; |
|
|
32 |
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent; |
| 32 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
33 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
| 33 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
34 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
| 34 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
35 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
|
|
36 |
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; |
| 35 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
37 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
| 36 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
38 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
| 37 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
39 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
|
Lines 54-59
Link Here
|
| 54 |
*/ |
56 |
*/ |
| 55 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
57 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
| 56 |
|
58 |
|
|
|
59 |
/** |
| 60 |
* The id of the single thread to be used during event visualization. |
| 61 |
* @since 4.1 |
| 62 |
*/ |
| 63 |
protected static final String TRACE_VISUALIZATION_THREAD_ID = "1"; //$NON-NLS-1$ |
| 64 |
|
| 57 |
private CommandFactory fCommandFactory; |
65 |
private CommandFactory fCommandFactory; |
| 58 |
private IGDBControl fCommandControl; |
66 |
private IGDBControl fCommandControl; |
| 59 |
private IGDBBackend fBackend; |
67 |
private IGDBBackend fBackend; |
|
Lines 73-78
Link Here
|
| 73 |
* because we know the process will be restarted. |
81 |
* because we know the process will be restarted. |
| 74 |
*/ |
82 |
*/ |
| 75 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
83 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
|
|
84 |
|
| 85 |
/** |
| 86 |
* Indicates that we are currently visualizing trace data. |
| 87 |
*/ |
| 88 |
private boolean fTraceVisualization; |
| 76 |
|
89 |
|
| 77 |
public GDBProcesses_7_2(DsfSession session) { |
90 |
public GDBProcesses_7_2(DsfSession session) { |
| 78 |
super(session); |
91 |
super(session); |
|
Lines 107-112
Link Here
|
| 107 |
@Override |
120 |
@Override |
| 108 |
public void shutdown(RequestMonitor requestMonitor) { |
121 |
public void shutdown(RequestMonitor requestMonitor) { |
| 109 |
super.shutdown(requestMonitor); |
122 |
super.shutdown(requestMonitor); |
|
|
123 |
} |
| 124 |
|
| 125 |
/** @since 4.1 */ |
| 126 |
protected boolean getTraceVisualization() { |
| 127 |
return fTraceVisualization; |
| 128 |
} |
| 129 |
|
| 130 |
/** @since 4.1 */ |
| 131 |
protected void setTraceVisualization(boolean visualizing) { |
| 132 |
fTraceVisualization = visualizing; |
| 110 |
} |
133 |
} |
| 111 |
|
134 |
|
| 112 |
@Override |
135 |
@Override |
|
Lines 459-464
Link Here
|
| 459 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
482 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
| 460 |
} |
483 |
} |
| 461 |
|
484 |
|
|
|
485 |
@Override |
| 486 |
public void getProcessesBeingDebugged(final IDMContext dmc, final DataRequestMonitor<IDMContext[]> rm) { |
| 487 |
if (getTraceVisualization()) { |
| 488 |
// If we are visualizing data during a live session, we should not ask GDB for the list of threads, |
| 489 |
// because we will get the list of active threads, while GDB only cares about thread 1 for visualization. |
| 490 |
final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); |
| 491 |
if (containerDmc != null) { |
| 492 |
IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); |
| 493 |
rm.setData(new IMIExecutionDMContext[]{createExecutionContext(containerDmc, |
| 494 |
createThreadContext(procDmc, TRACE_VISUALIZATION_THREAD_ID), |
| 495 |
TRACE_VISUALIZATION_THREAD_ID)}); |
| 496 |
rm.done(); |
| 497 |
return; |
| 498 |
} |
| 499 |
} |
| 500 |
|
| 501 |
super.getProcessesBeingDebugged(dmc, rm); |
| 502 |
} |
| 503 |
|
| 462 |
/** |
504 |
/** |
| 463 |
* Creates the container context that is to be used for the new process that will |
505 |
* Creates the container context that is to be used for the new process that will |
| 464 |
* be created by the restart operation. |
506 |
* be created by the restart operation. |
|
Lines 535-539
Link Here
|
| 535 |
protected boolean needFixForGDB72Bug352998() { |
577 |
protected boolean needFixForGDB72Bug352998() { |
| 536 |
return true; |
578 |
return true; |
| 537 |
} |
579 |
} |
|
|
580 |
|
| 581 |
/** |
| 582 |
* @since 4.1 |
| 583 |
*/ |
| 584 |
@DsfServiceEventHandler |
| 585 |
public void eventDispatched(ITraceRecordSelectedChangedDMEvent e) { |
| 586 |
setTraceVisualization(e.isVisualizationModeEnabled()); |
| 587 |
} |
| 538 |
} |
588 |
} |
| 539 |
|
589 |
|