Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 200220 Details for
Bug 347514
[tracepoints] Tracepoint visualization should be prepared for multi-threaded programs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Potential fix for maintenance branch
z.patch (text/plain), 10.92 KB, created by
Marc Khouzam
on 2011-07-22 15:24:06 EDT
(
hide
)
Description:
Potential fix for maintenance branch
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-07-22 15:24:06 EDT
Size:
10.92 KB
patch
obsolete
>From 5bf832553afe00ed0aa04c4c105ab02bc3e4d668 Fri, 22 Jul 2011 15:22:21 -0400 >From: Marc Khouzam <marc.khouzam@ericsson.com> >Date: Fri, 22 Jul 2011 15:22:09 -0400 >Subject: [PATCH] Bug 347514: [tracepoints] Tracepoint visualization should be prepared for multi-threaded programs. Solution for maintenance branch > >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSelectNextTraceRecordCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSelectNextTraceRecordCommand.java >index b2a8f7e..1c0c05c 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSelectNextTraceRecordCommand.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSelectNextTraceRecordCommand.java >@@ -80,14 +80,21 @@ > new DataRequestMonitor<ITraceRecordDMContext>(fExecutor, rm) { > @Override > protected void handleSuccess() { >- final ITraceRecordDMContext nextDmc = traceControl.createNextRecordContext(getData()); >- traceControl.selectTraceRecord(nextDmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) { >- @Override >- protected void handleSuccess() { >- fSession.dispatchEvent(new TraceRecordSelectedChangedEvent(nextDmc), new Hashtable<String, String>()); >- rm.done(); >- } >- }); >+ final ITraceRecordDMContext previousDmc = getData(); >+ ITraceRecordDMContext nextDmc = traceControl.createNextRecordContext(previousDmc); >+ // Must send the event right away to tell the services we are starting visualization >+ // If we don't the services won't behave accordingly soon enough >+ // Bug 347514 >+ fSession.dispatchEvent(new TraceRecordSelectedChangedEvent(nextDmc), new Hashtable<String, String>()); >+ >+ traceControl.selectTraceRecord(nextDmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) { >+ @Override >+ protected void handleError() { >+ // If we weren't able to select the next record, we must notify that we are still on the previous one. >+ fSession.dispatchEvent(new TraceRecordSelectedChangedEvent(previousDmc), new Hashtable<String, String>()); >+ rm.done(); >+ } >+ }); > }; > }); > } else { >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java >index 9b15f74..aa68219 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java >@@ -26,6 +26,7 @@ > import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.LaunchRootVMNode; > import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StackFramesVMNode; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; >+import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITracingStartedDMEvent; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITracingStoppedDMEvent; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITracingSupportedChangeDMEvent; >@@ -45,6 +46,9 @@ > public class LaunchVMProvider extends AbstractLaunchVMProvider > implements IDebugEventSetListener, ILaunchesListener2 > { >+ >+ private boolean fVisualizationModeEnabled; >+ > @ThreadSafe > public LaunchVMProvider(AbstractVMAdapter adapter, IPresentationContext presentationContext, DsfSession session) > { >@@ -107,6 +111,19 @@ > return; > } > >+ if (event instanceof ITraceRecordSelectedChangedDMEvent) { >+ ITraceRecordSelectedChangedDMEvent recordChanged = (ITraceRecordSelectedChangedDMEvent)event; >+ // If trace visualization has changed we have to refresh the debug view >+ if (recordChanged.isVisualizationModeEnabled() != fVisualizationModeEnabled) { >+ fVisualizationModeEnabled = recordChanged.isVisualizationModeEnabled(); >+ >+ // Refresh the view because the set of threads has totally changed. >+ refresh(); >+ rm.done(); >+ return; >+ } >+ } >+ > super.handleEvent(event, rm); > } > >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/.settings/.api_filters b/dsf-gdb/org.eclipse.cdt.dsf.gdb/.settings/.api_filters >new file mode 100644 >index 0000000..ddac317 >--- /dev/null >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/.settings/.api_filters >@@ -0,0 +1,11 @@ >+<?xml version="1.0" encoding="UTF-8" standalone="no"?> >+<component id="org.eclipse.cdt.dsf.gdb" version="2"> >+ <resource path="META-INF/MANIFEST.MF"> >+ <filter comment="Shouldn't increase the version for a maintenance branch" id="924844039"> >+ <message_arguments> >+ <message_argument value="4.0.0"/> >+ <message_argument value="4.0.0"/> >+ </message_arguments> >+ </filter> >+ </resource> >+</component> >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >index 73a55d3..655b21e 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >@@ -27,9 +27,11 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; > import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent; > import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; > import org.eclipse.cdt.dsf.mi.service.IMICommandControl; > import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIRunControl; > import org.eclipse.cdt.dsf.mi.service.IMIRunControl.MIRunMode; >@@ -52,6 +54,8 @@ > */ > public class GDBProcesses_7_2 extends GDBProcesses_7_1 { > >+ private static final String TRACE_VISUALIZATION_THREAD_ID = "1"; //$NON-NLS-1$ >+ > private CommandFactory fCommandFactory; > private IGDBControl fCommandControl; > private IGDBBackend fBackend; >@@ -62,6 +66,12 @@ > * because we know the process will be restarted. > */ > private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>(); >+ >+ /** >+ * Indicates that we are currently visualizing trace data. >+ * In this case, some errors should not be reported. >+ */ >+ private boolean fTraceVisualization; > > public GDBProcesses_7_2(DsfSession session) { > super(session); >@@ -343,6 +353,25 @@ > return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm); > } > >+ @Override >+ public void getProcessesBeingDebugged(final IDMContext dmc, final DataRequestMonitor<IDMContext[]> rm) { >+ if (fTraceVisualization) { >+ // If we are visualizing data during a live session, we should not ask GDB for the list of threads, >+ // because we will get the list of active threads, while GDB only cares about thread 1 for visualization. >+ final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); >+ if (containerDmc != null) { >+ IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); >+ rm.setData(new IMIExecutionDMContext[]{createExecutionContext(containerDmc, >+ createThreadContext(procDmc, TRACE_VISUALIZATION_THREAD_ID), >+ TRACE_VISUALIZATION_THREAD_ID)}); >+ rm.done(); >+ return; >+ } >+ } >+ >+ super.getProcessesBeingDebugged(dmc, rm); >+ } >+ > /** > * Creates the container context that is to be used for the new process that will > * be created by the restart operation. >@@ -402,5 +431,17 @@ > > super.eventDispatched(e); > } >+ >+ /** >+ * @since 4.0 Added on the CDT 8.0 maintenance branch only. >+ */ >+ @DsfServiceEventHandler >+ public void eventDispatched(ITraceRecordSelectedChangedDMEvent e) { >+ if (e.isVisualizationModeEnabled()) { >+ fTraceVisualization = true; >+ } else { >+ fTraceVisualization = false; >+ } >+ } > } > >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java >index b90b214..9598103 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java >@@ -972,7 +972,7 @@ > // process? > IContainerDMContext processContainerDmc = (IContainerDMContext)(getData()[0]); > >- // Now find the proper thread. We must do this hear because in post-mortem debugging >+ // Now find the proper thread. We must do this here because in post-mortem debugging > // we cannot rely on MIRunControl using 'thread', as it will fail > IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class); > if (procService == null) { >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java >index f098ca7..925bd51 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java >@@ -345,18 +345,6 @@ > /** @since 3.0 */ > @DsfServiceEventHandler > public void eventDispatched(ITraceRecordSelectedChangedDMEvent e) { >- if (e.isVisualizationModeEnabled()) { >- // Once we start looking at trace frames, we should not use >- // the --thread or --frame options because GDB does not handle >- // it well, there are no actual threads running. >- // We only need to do this once, but it won't hurt to do it >- // every time. >- setUseThreadAndFrameOptions(false); >- } else { >- // We stopped looking at trace frames, so we can start >- // using --thread and --frame again >- setUseThreadAndFrameOptions(true); >- } > } > > public static class InitializationShutdownStep extends Sequence.Step {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 347514
:
200220
|
200725
|
200757
|
200758