|
Lines 27-35
Link Here
|
| 27 |
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; |
27 |
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; |
| 28 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
28 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
| 29 |
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; |
29 |
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; |
|
|
30 |
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent; |
| 30 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
31 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
| 31 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
32 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
| 32 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
33 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
|
|
34 |
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; |
| 33 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
35 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
| 34 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
36 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
| 35 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
37 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
|
Lines 52-57
Link Here
|
| 52 |
*/ |
54 |
*/ |
| 53 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
55 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
| 54 |
|
56 |
|
|
|
57 |
private static final String TRACE_VISUALIZATION_THREAD_ID = "1"; //$NON-NLS-1$ |
| 58 |
|
| 55 |
private CommandFactory fCommandFactory; |
59 |
private CommandFactory fCommandFactory; |
| 56 |
private IGDBControl fCommandControl; |
60 |
private IGDBControl fCommandControl; |
| 57 |
private IGDBBackend fBackend; |
61 |
private IGDBBackend fBackend; |
|
Lines 62-67
Link Here
|
| 62 |
* because we know the process will be restarted. |
66 |
* because we know the process will be restarted. |
| 63 |
*/ |
67 |
*/ |
| 64 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
68 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
|
|
69 |
|
| 70 |
/** |
| 71 |
* Indicates that we are currently visualizing trace data. |
| 72 |
* In this case, some errors should not be reported. |
| 73 |
*/ |
| 74 |
private boolean fTraceVisualization; |
| 65 |
|
75 |
|
| 66 |
public GDBProcesses_7_2(DsfSession session) { |
76 |
public GDBProcesses_7_2(DsfSession session) { |
| 67 |
super(session); |
77 |
super(session); |
|
Lines 343-348
Link Here
|
| 343 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
353 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
| 344 |
} |
354 |
} |
| 345 |
|
355 |
|
|
|
356 |
@Override |
| 357 |
public void getProcessesBeingDebugged(final IDMContext dmc, final DataRequestMonitor<IDMContext[]> rm) { |
| 358 |
if (fTraceVisualization) { |
| 359 |
// If we are visualizing data during a live session, we should not ask GDB for the list of threads, |
| 360 |
// because we will get the list of active threads, while GDB only cares about thread 1 for visualization. |
| 361 |
final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); |
| 362 |
if (containerDmc != null) { |
| 363 |
IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); |
| 364 |
rm.setData(new IMIExecutionDMContext[]{createExecutionContext(containerDmc, |
| 365 |
createThreadContext(procDmc, TRACE_VISUALIZATION_THREAD_ID), |
| 366 |
TRACE_VISUALIZATION_THREAD_ID)}); |
| 367 |
rm.done(); |
| 368 |
return; |
| 369 |
} |
| 370 |
} |
| 371 |
|
| 372 |
super.getProcessesBeingDebugged(dmc, rm); |
| 373 |
} |
| 374 |
|
| 346 |
/** |
375 |
/** |
| 347 |
* Creates the container context that is to be used for the new process that will |
376 |
* Creates the container context that is to be used for the new process that will |
| 348 |
* be created by the restart operation. |
377 |
* be created by the restart operation. |
|
Lines 402-406
Link Here
|
| 402 |
|
431 |
|
| 403 |
super.eventDispatched(e); |
432 |
super.eventDispatched(e); |
| 404 |
} |
433 |
} |
|
|
434 |
|
| 435 |
/** |
| 436 |
* @since 4.0 Added on the CDT 8.0 maintenance branch only. |
| 437 |
*/ |
| 438 |
@DsfServiceEventHandler |
| 439 |
public void eventDispatched(ITraceRecordSelectedChangedDMEvent e) { |
| 440 |
if (e.isVisualizationModeEnabled()) { |
| 441 |
fTraceVisualization = true; |
| 442 |
} else { |
| 443 |
fTraceVisualization = false; |
| 444 |
} |
| 445 |
} |
| 405 |
} |
446 |
} |
| 406 |
|
447 |
|