|
Lines 30-38
Link Here
|
| 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.internal.commands.MITargetDisconnect; |
32 |
import org.eclipse.cdt.dsf.gdb.internal.commands.MITargetDisconnect; |
|
|
33 |
import org.eclipse.cdt.dsf.gdb.internal.service.command.events.TraceRecordSelectedChangedEventListener; |
| 33 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
34 |
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; |
| 34 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
35 |
import org.eclipse.cdt.dsf.mi.service.IMICommandControl; |
| 35 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
36 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
|
|
37 |
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; |
| 36 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
38 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
| 37 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
39 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl; |
| 38 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
40 |
import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; |
|
Lines 55-60
Link Here
|
| 55 |
*/ |
57 |
*/ |
| 56 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
58 |
public class GDBProcesses_7_2 extends GDBProcesses_7_1 { |
| 57 |
|
59 |
|
|
|
60 |
/** |
| 61 |
* The id of the single thread to be used during event visualization. |
| 62 |
*/ |
| 63 |
private static final String TRACE_VISUALIZATION_THREAD_ID = "1"; //$NON-NLS-1$ |
| 64 |
|
| 58 |
private CommandFactory fCommandFactory; |
65 |
private CommandFactory fCommandFactory; |
| 59 |
private IGDBControl fCommandControl; |
66 |
private IGDBControl fCommandControl; |
| 60 |
private IGDBBackend fBackend; |
67 |
private IGDBBackend fBackend; |
|
Lines 74-79
Link Here
|
| 74 |
* because we know the process will be restarted. |
81 |
* because we know the process will be restarted. |
| 75 |
*/ |
82 |
*/ |
| 76 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
83 |
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); |
|
|
84 |
|
| 85 |
/* |
| 86 |
* Temporary to avoid API changes |
| 87 |
*/ |
| 88 |
private TraceRecordSelectedChangedEventListener fTraceVisualizationEventListener = new TraceRecordSelectedChangedEventListener(); |
| 77 |
|
89 |
|
| 78 |
public GDBProcesses_7_2(DsfSession session) { |
90 |
public GDBProcesses_7_2(DsfSession session) { |
| 79 |
super(session); |
91 |
super(session); |
|
Lines 102-112
Link Here
|
| 102 |
fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory(); |
114 |
fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory(); |
| 103 |
fBackend = getServicesTracker().getService(IGDBBackend.class); |
115 |
fBackend = getServicesTracker().getService(IGDBBackend.class); |
| 104 |
|
116 |
|
|
|
117 |
getSession().addServiceEventListener(fTraceVisualizationEventListener, null); |
| 118 |
|
| 105 |
requestMonitor.done(); |
119 |
requestMonitor.done(); |
| 106 |
} |
120 |
} |
| 107 |
|
121 |
|
| 108 |
@Override |
122 |
@Override |
| 109 |
public void shutdown(RequestMonitor requestMonitor) { |
123 |
public void shutdown(RequestMonitor requestMonitor) { |
|
|
124 |
getSession().removeServiceEventListener(fTraceVisualizationEventListener); |
| 125 |
|
| 110 |
super.shutdown(requestMonitor); |
126 |
super.shutdown(requestMonitor); |
| 111 |
} |
127 |
} |
| 112 |
|
128 |
|
|
Lines 461-466
Link Here
|
| 461 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
477 |
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); |
| 462 |
} |
478 |
} |
| 463 |
|
479 |
|
|
|
480 |
@Override |
| 481 |
public void getProcessesBeingDebugged(final IDMContext dmc, final DataRequestMonitor<IDMContext[]> rm) { |
| 482 |
if (fTraceVisualizationEventListener.fTracepointVisualizationEnabled) { |
| 483 |
// If we are visualizing data during a live session, we should not ask GDB for the list of threads, |
| 484 |
// because we will get the list of active threads, while GDB only cares about thread 1 for visualization. |
| 485 |
final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); |
| 486 |
if (containerDmc != null) { |
| 487 |
IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); |
| 488 |
rm.setData(new IMIExecutionDMContext[]{createExecutionContext(containerDmc, |
| 489 |
createThreadContext(procDmc, TRACE_VISUALIZATION_THREAD_ID), |
| 490 |
TRACE_VISUALIZATION_THREAD_ID)}); |
| 491 |
rm.done(); |
| 492 |
return; |
| 493 |
} |
| 494 |
} |
| 495 |
|
| 496 |
super.getProcessesBeingDebugged(dmc, rm); |
| 497 |
} |
| 498 |
|
| 464 |
/** |
499 |
/** |
| 465 |
* Creates the container context that is to be used for the new process that will |
500 |
* Creates the container context that is to be used for the new process that will |
| 466 |
* be created by the restart operation. |
501 |
* be created by the restart operation. |
|
Lines 528-534
Link Here
|
| 528 |
* |
563 |
* |
| 529 |
* See http://sourceware.org/ml/gdb-patches/2011-03/msg00531.html |
564 |
* See http://sourceware.org/ml/gdb-patches/2011-03/msg00531.html |
| 530 |
* and Bug 352998 |
565 |
* and Bug 352998 |
| 531 |
* */ |
566 |
*/ |
| 532 |
private boolean needFixForGDB72Bug352998() { |
567 |
private boolean needFixForGDB72Bug352998() { |
| 533 |
return true; |
568 |
return true; |
| 534 |
} |
569 |
} |