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 185617 Details for
Bug 237306
[multicore][multi-process] Support for Multi-Process debugging
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]
Breakpoint discussion patch
breakpoint_M1_12.21.2010.txt (text/plain), 21.84 KB, created by
Onur Akdemir
on 2010-12-21 04:35:59 EST
(
hide
)
Description:
Breakpoint discussion patch
Filename:
MIME Type:
Creator:
Onur Akdemir
Created:
2010-12-21 04:35:59 EST
Size:
21.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf >Index: src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java,v >retrieving revision 1.4 >diff -u -r1.4 IBreakpoints.java >--- src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java 3 Jun 2010 00:11:48 -0000 1.4 >+++ src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java 21 Dec 2010 09:19:20 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.cdt.dsf.datamodel.IDMContext; > import org.eclipse.cdt.dsf.datamodel.IDMData; > import org.eclipse.cdt.dsf.datamodel.IDMEvent; >+import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; > import org.eclipse.cdt.dsf.service.IDsfService; > > /** >@@ -33,7 +34,7 @@ > /** > * Marker interface for a context for which breakpoints can be installed > */ >- public interface IBreakpointsTargetDMContext extends IDMContext {} >+ public interface IBreakpointsTargetDMContext extends IContainerDMContext {} > > /** > * Specific breakpoint context >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java,v >retrieving revision 1.17 >diff -u -r1.17 FinalLaunchSequence.java >--- src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java 5 Nov 2010 01:28:48 -0000 1.17 >+++ src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java 21 Dec 2010 09:19:21 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; > import org.eclipse.cdt.dsf.datamodel.IDMContext; > import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; >+import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext; > import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; > import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; > import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; >@@ -37,6 +38,7 @@ > import org.eclipse.cdt.dsf.gdb.service.SessionType; > import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; > import org.eclipse.cdt.dsf.mi.service.CSourceLookup; >+import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIProcesses; > import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; > import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; >@@ -64,7 +66,8 @@ > private CommandFactory fCommandFactory; > > private DsfServicesTracker fTracker; >- >+ private IMIContainerDMContext fInitialContainerCtx; >+ > public FinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach, IProgressMonitor pm) { > super(executor, pm, LaunchMessages.getString("FinalLaunchSequence.0"), LaunchMessages.getString("FinalLaunchSequence.1")); //$NON-NLS-1$ //$NON-NLS-2$ > fLaunch = launch; >@@ -131,6 +134,12 @@ > return; > } > >+ // We can cheat a little. Since we know GDB starts off focused on the one >+ // groupId it automatically created, we can simply create a container with the 'null' >+ // groupId, which will get ignored and will use the process currently in focus. >+ IProcessDMContext procCtx = fProcService.createProcessContext(fCommandControl.getContext(), null); >+ fInitialContainerCtx = fProcService.createContainerContext(procCtx, null); >+ > requestMonitor.done(); > } > >@@ -285,7 +294,7 @@ > final IPath execPath = fGDBBackend.getProgramPath(); > if (!noFileCommand && execPath != null && !execPath.isEmpty()) { > fCommandControl.queueCommand( >- fCommandFactory.createMIFileExecAndSymbols(fCommandControl.getContext(), >+ fCommandFactory.createMIFileExecAndSymbols(fInitialContainerCtx, > execPath.toPortableString()), > new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor)); > } else { >@@ -670,7 +679,7 @@ > public void stepStartTrackingBreakpoints(final RequestMonitor requestMonitor) { > if (fSessionType != SessionType.CORE) { > MIBreakpointsManager bpmService = fTracker.getService(MIBreakpointsManager.class); >- IBreakpointsTargetDMContext breakpointDmc = (IBreakpointsTargetDMContext)fCommandControl.getContext(); >+ IBreakpointsTargetDMContext breakpointDmc = fInitialContainerCtx; > > bpmService.startTrackingBreakpoints(breakpointDmc, requestMonitor); > } else { >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java,v >retrieving revision 1.28 >diff -u -r1.28 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 22 Nov 2010 15:45:12 -0000 1.28 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 21 Dec 2010 09:19:22 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent; > import org.eclipse.cdt.dsf.datamodel.DMContexts; > import org.eclipse.cdt.dsf.datamodel.IDMContext; >+import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; > import org.eclipse.cdt.dsf.debug.service.ICachingService; > import org.eclipse.cdt.dsf.debug.service.IMemory.IMemoryDMContext; > import org.eclipse.cdt.dsf.debug.service.IProcesses; >@@ -164,12 +165,12 @@ > */ > @Immutable > private static class MIContainerDMC extends AbstractDMContext >- implements IMIContainerDMContext >+ implements IMIContainerDMContext,IBreakpointsTargetDMContext > { > /** > * String ID that is used to identify the thread group in the GDB/MI protocol. > */ >- private final String fId; >+ private String fId; > > /** > * Constructor for the context. It should not be called directly by clients. >@@ -201,6 +202,11 @@ > > @Override > public int hashCode() { return baseHashCode() ^ (fId == null ? 0 : fId.hashCode()); } >+ >+ public void setGroupId(String gId) { >+ fId = gId; >+ >+ } > } > > private class GDBContainerDMC extends MIContainerDMC >@@ -592,22 +598,34 @@ > return createContainerContext(processDmc, groupId); > } > >- public IMIExecutionDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc) { >- String groupId = containerDmc.getGroupId(); >- List<IMIExecutionDMContext> execDmcList = new ArrayList<IMIExecutionDMContext>(); >- Iterator<Map.Entry<String, String>> iterator = getThreadToGroupMap().entrySet().iterator(); >- while (iterator.hasNext()){ >- Map.Entry<String, String> entry = iterator.next(); >- if (entry.getValue().equals(groupId)) { >- String threadId = entry.getKey(); >- IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); >- IMIExecutionDMContext execDmc = createExecutionContext(containerDmc, >- createThreadContext(procDmc, threadId), >- threadId); >- execDmcList.add(execDmc); >- } >+ >+ public IDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc) { >+ if ( containerDmc != null) { >+ String groupId = containerDmc.getGroupId(); >+ List<IMIExecutionDMContext> execDmcList = new ArrayList<IMIExecutionDMContext>(); >+ Iterator<Map.Entry<String, String>> iterator = fThreadToGroupMap.entrySet().iterator(); >+ while (iterator.hasNext()){ >+ Map.Entry<String, String> entry = iterator.next(); >+ if (entry.getValue().equals(groupId)) { >+ String threadId = entry.getKey(); >+ IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); >+ IMIExecutionDMContext execDmc = createExecutionContext(containerDmc, >+ createThreadContext(procDmc, threadId), >+ threadId); >+ execDmcList.add(execDmc); >+ } >+ } >+ return execDmcList.toArray(new IDMContext[0]); >+ }else{ // containerDmc null , return all group information. >+ List<IMIContainerDMContext> containerDmcList = new ArrayList<IMIContainerDMContext>(); >+ Iterator<Map.Entry<String, String>> iterator = fThreadToGroupMap.entrySet().iterator(); >+ while (iterator.hasNext()){ >+ Map.Entry<String, String> entry = iterator.next(); >+ IMIContainerDMContext conDmc = createContainerContextFromGroupId(fCommandControl.getContext(), entry.getValue()); >+ containerDmcList.add(conDmc); >+ } >+ return containerDmcList.toArray(new IDMContext[0]); > } >- return execDmcList.toArray(new IMIExecutionDMContext[0]); > } > > public void getExecutionData(IThreadDMContext dmc, final DataRequestMonitor<IThreadDMData> rm) { >@@ -689,7 +707,8 @@ > rm.done(); > } > >- private boolean doIsDebuggerAttachSupported() { >+ /** @since 4.0 */ >+ protected boolean doIsDebuggerAttachSupported() { > IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class); > if (backend != null) { > return backend.getIsAttachSession(); >@@ -728,7 +747,8 @@ > } > } > >- private boolean doCanDetachDebuggerFromProcess() { >+ /** @since 4.0 */ >+ protected boolean doCanDetachDebuggerFromProcess() { > IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class); > if (backend != null) { > return backend.getIsAttachSession() && fCommandControl.isConnected(); >Index: src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java,v >retrieving revision 1.5 >diff -u -r1.5 IGDBProcesses.java >--- src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java 30 Jul 2010 17:45:41 -0000 1.5 >+++ src/org/eclipse/cdt/dsf/gdb/service/IGDBProcesses.java 21 Dec 2010 09:19:22 -0000 >@@ -11,8 +11,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.service; > >+import org.eclipse.cdt.dsf.datamodel.IDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; >-import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIProcesses; > > public interface IGDBProcesses extends IMIProcesses { >@@ -49,6 +49,6 @@ > * > * @param containerDmc The container for which we want to get the execution contexts > */ >- IMIExecutionDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc); >+ IDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc); > > } >Index: src/org/eclipse/cdt/dsf/mi/service/IMIContainerDMContext.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/IMIContainerDMContext.java,v >retrieving revision 1.2 >diff -u -r1.2 IMIContainerDMContext.java >--- src/org/eclipse/cdt/dsf/mi/service/IMIContainerDMContext.java 3 Jun 2010 00:09:36 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/mi/service/IMIContainerDMContext.java 21 Dec 2010 09:19:22 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.mi.service; > >+import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; > import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; > > /** >@@ -18,7 +19,7 @@ > * identifier. These thread groups are the basis for this context. > * @since 1.1 > */ >-public interface IMIContainerDMContext extends IContainerDMContext >+public interface IMIContainerDMContext extends IContainerDMContext , IBreakpointsTargetDMContext > { > /** > * Returns the GDB/MI thread group identifier of this context. >Index: src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java,v >retrieving revision 1.20 >diff -u -r1.20 MIBreakpointsManager.java >--- src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java 27 Sep 2010 16:21:33 -0000 1.20 >+++ src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java 21 Dec 2010 09:19:22 -0000 >@@ -55,6 +55,7 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommandControl; > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses; > import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.BreakpointAddedEvent; > import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.BreakpointRemovedEvent; > import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.BreakpointUpdatedEvent; >@@ -113,6 +114,7 @@ > IBreakpoints fBreakpoints; > IBreakpointManager fBreakpointManager; // Platform breakpoint manager (not this!) > BreakpointActionManager fBreakpointActionManager; >+ IGDBProcesses fProcService; > > /////////////////////////////////////////////////////////////////////////// > // Breakpoints tracking >@@ -122,7 +124,7 @@ > > // Holds the set of platform breakpoints with their corresponding back-end > // breakpoint attributes, per context (i.e. each platform breakpoint is >- // replicated for each execution context). >+ // replicated import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointDMContext;for each execution context). > // - Context entry added/removed on start/stopTrackingBreakpoints() > // - Augmented on breakpointAdded() > // - Modified on breakpointChanged() >@@ -244,6 +246,7 @@ > fBreakpoints = getServicesTracker().getService(IBreakpoints.class); > fBreakpointManager = DebugPlugin.getDefault().getBreakpointManager(); > fBreakpointActionManager = CDebugCorePlugin.getDefault().getBreakpointActionManager(); >+ fProcService = getServicesTracker().getService(IGDBProcesses.class); > > // Register to the useful events > getSession().addServiceEventListener(this, null); >@@ -547,6 +550,7 @@ > // breakpoint creation. However, it is conceivable that an enhanced Editor > // would permit it. > final Set<String> threads = getThreads(attributes); >+ final Set<String> threadGroups = getThreadGroups(); > > // Update the breakpoint state when all back-end breakpoints have been installed > final CountingRequestMonitor installRM = new CountingRequestMonitor(getExecutor(), rm) { >@@ -561,69 +565,71 @@ > > // Install the back-end breakpoint(s) > for (final String thread : threads) { >- DataRequestMonitor<IBreakpointDMContext> drm = >- new DataRequestMonitor<IBreakpointDMContext>(getExecutor(), installRM) { >- @Override >- protected void handleSuccess() { >- // Add the new back-end breakpoint to the map >- Vector<IBreakpointDMContext> list = breakpointIDs.get(breakpoint); >- if (list == null) >- list = new Vector<IBreakpointDMContext>(); >- IBreakpointDMContext targetBP = getData(); >- list.add(targetBP); >- breakpointIDs.put(breakpoint, list); >- >- // Add the reverse mapping >- targetBPs.put(targetBP, breakpoint); >- >- // And update the corresponding thread list >- Set<String> thrds = threadsIDs.get(breakpoint); >- if (thrds == null) >- thrds = new HashSet<String>(); >- thrds.add(thread); >- threadsIDs.put(breakpoint, thrds); >- >- // Reset the thread (is it necessary?) >- attributes.put(ATTR_THREAD_ID, NULL_STRING); >- >- // Remove breakpoint problem marker (if any) >- removeBreakpointProblemMarker(breakpoint); >- >- // Check for a pending breakpoint before showing that it was properly installed >- fBreakpoints.getBreakpointDMData(targetBP, new DataRequestMonitor<IBreakpointDMData>(getExecutor(), null) { >- @Override >- protected void handleCompleted() { >- boolean pending = false; >- if (isSuccess()) { >- IBreakpointDMData data = getData(); >- if (data instanceof MIBreakpointDMData) { >- pending = ((MIBreakpointDMData)data).isPending(); >- } >- } >- // Finally, update the platform breakpoint to show it was installed, unless we have a pending breakpoint >- if (!pending) { >- try { >- breakpoint.incrementInstallCount(); >- } catch (CoreException e) { >- } >- } >- installRM.done(); >- } >- }); >- } >- >- @Override >- protected void handleError() { >- String description = MessageFormat.format(Messages.Breakpoint_attribute_problem, new Object[] { Messages.Breakpoint_installation_failed }); >- addBreakpointProblemMarker(breakpoint, description, IMarker.SEVERITY_WARNING); >- installRM.done(); >- } >- }; >- >- // Convert the breakpoint attributes for the back-end >- attributes.put(ATTR_THREAD_ID, thread); >- Map<String,Object> targetAttributes = convertToTargetBreakpoint(breakpoint, attributes); >- fBreakpoints.insertBreakpoint(dmc, targetAttributes, drm); >+ for (final String threadgroup : threadGroups) { >+ DataRequestMonitor<IBreakpointDMContext> drm = >+ new DataRequestMonitor<IBreakpointDMContext>(getExecutor(), installRM) { >+ @Override >+ protected void handleSuccess() { >+ // Add the new back-end breakpoint to the map >+ Vector<IBreakpointDMContext> list = breakpointIDs.get(breakpoint); >+ if (list == null) >+ list = new Vector<IBreakpointDMContext>(); >+ IBreakpointDMContext targetBP = getData(); >+ list.add(targetBP); >+ breakpointIDs.put(breakpoint, list); >+ >+ // Add the reverse mapping >+ targetBPs.put(targetBP, breakpoint); >+ >+ // And update the corresponding thread list >+ Set<String> thrds = threadsIDs.get(breakpoint); >+ if (thrds == null) >+ thrds = new HashSet<String>(); >+ thrds.add(thread); >+ threadsIDs.put(breakpoint, thrds); >+ >+ // Reset the thread (is it necessary?) >+ attributes.put(ATTR_THREAD_ID, NULL_STRING); >+ >+ // Remove breakpoint problem marker (if any) >+ removeBreakpointProblemMarker(breakpoint); >+ >+ // Check for a pending breakpoint before showing that it was properly installed >+ fBreakpoints.getBreakpointDMData(targetBP, new DataRequestMonitor<IBreakpointDMData>(getExecutor(), null) { >+ @Override >+ protected void handleCompleted() { >+ boolean pending = false; >+ if (isSuccess()) { >+ IBreakpointDMData data = getData(); >+ if (data instanceof MIBreakpointDMData) { >+ pending = ((MIBreakpointDMData)data).isPending(); >+ } >+ } >+ // Finally, update the platform breakpoint to show it was installed, unless we have a pending breakpoint >+ if (!pending) { >+ try { >+ breakpoint.incrementInstallCount(); >+ } catch (CoreException e) { >+ } >+ } >+ installRM.done(); >+ } >+ }); >+ } >+ >+ @Override >+ protected void handleError() { >+ String description = MessageFormat.format(Messages.Breakpoint_attribute_problem, new Object[] { Messages.Breakpoint_installation_failed }); >+ addBreakpointProblemMarker(breakpoint, description, IMarker.SEVERITY_WARNING); >+ installRM.done(); >+ } >+ }; >+ >+ // Convert the breakpoint attributes for the back-end >+ attributes.put(ATTR_THREAD_ID, thread); >+ Map<String,Object> targetAttributes = convertToTargetBreakpoint(breakpoint, attributes); >+ fBreakpoints.insertBreakpoint(dmc, targetAttributes, drm); >+ } > } > } > >@@ -1647,6 +1653,15 @@ > return threads; > } > >+ private Set<String> getThreadGroups() { >+ Set<String> groupIds = new HashSet<String>(); >+ IDMContext[] containerList = fProcService.getExecutionContexts(null); >+ for ( int i = 0 ; i < containerList.length ; i++ ){ >+ groupIds.add(((IMIContainerDMContext)containerList[i]).getGroupId()); >+ } >+ return groupIds; >+ } >+ > /** > * Get the list of threads from the platform breakpoint attributes > *
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
Actions:
View
|
Diff
Attachments on
bug 237306
:
166478
|
167440
|
168092
|
168093
|
168510
|
176501
|
178929
|
179595
|
179596
|
179913
|
182593
|
184318
|
185285
|
185617
|
185691
|
186266
|
187326
|
187357
|
190931
|
190997