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 192324 Details for
Bug 336890
[multi-process] Should stop tracking breakpoints when a process is no longer being debugged
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]
Prototype overriding equals method
zpatch.prototype6.txt (text/plain), 8.18 KB, created by
Marc Khouzam
on 2011-03-31 16:18:41 EDT
(
hide
)
Description:
Prototype overriding equals method
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-03-31 16:18:41 EDT
Size:
8.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java,v >retrieving revision 1.21 >diff -u -r1.21 GDBProcesses.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java 11 Mar 2011 16:35:34 -0000 1.21 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java 31 Mar 2011 19:57:56 -0000 >@@ -164,7 +164,7 @@ > if (fProcId != null) { > processDmc = createProcessContext(controlDmc, fProcId); > } else { >- processDmc = createProcessContext(controlDmc, groupId); >+ processDmc = createProcessContext(controlDmc, MIProcesses.UNIQUE_GROUP_ID); > } > return createContainerContext(processDmc, groupId); > } >@@ -277,14 +277,16 @@ > } > > @Override >- public void detachDebuggerFromProcess(IDMContext dmc, final RequestMonitor rm) { >+ public void detachDebuggerFromProcess(final IDMContext dmc, final RequestMonitor rm) { > super.detachDebuggerFromProcess( > dmc, > new RequestMonitor(getExecutor(), rm) { > @Override > protected void handleSuccess() { > fProcId = null; >- rm.done(); >+ MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class); >+ IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class); >+ bpmService.stopTrackingBreakpoints(bpTargetDmc, rm); > } > }); > } >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.42 >diff -u -r1.42 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 11 Mar 2011 16:35:34 -0000 1.42 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 31 Mar 2011 19:57:57 -0000 >@@ -301,12 +301,34 @@ > > @Override > public boolean equals(Object obj) { >- return baseEquals(obj) && >- (((MIProcessDMC)obj).fId == null ? fId == null : ((MIProcessDMC)obj).fId.equals(fId)); >+ if (baseEquals(obj) == false) { >+ return false; >+ } >+ >+ MIProcessDMC other = (MIProcessDMC)obj; >+ if ( (fId != null && fId.length() == 0) || >+ (other.fId != null && other.fId.length() == 0) ) { >+ // If either of the ids is the empty string, we consider it a wild card >+ // and make it equal to anything >+ return true; >+ } >+ >+ if (fId == null) { >+ return other.fId == null; >+ } >+ >+ return fId.equals(other.fId); > } > > @Override >- public int hashCode() { return baseHashCode() ^ (fId == null ? 0 : fId.hashCode()); } >+ public int hashCode() { >+ // We cannot use fId in the hashCode. This is because we support >+ // a wildCard fId="" which is equal to any other fId. >+ // But we also need the hashCode to the wildCard to be the same >+ // as the one of all other fIds, which is why we need a constant hashCode >+ // See bug 336890 >+ return baseHashCode(); >+ } > } > > /** >@@ -550,6 +572,16 @@ > } > > /** @since 4.0 */ >+ protected int getNumConnected() { >+ return fNumConnected; >+ } >+ >+ /** @since 4.0 */ >+ protected void setNumConnected(int num) { >+ fNumConnected = num; >+ } >+ >+ /** @since 4.0 */ > protected boolean isInitialProcess() { > return fInitialProcess; > } >@@ -631,6 +663,7 @@ > > String pid = getGroupToPidMap().get(groupId); > if (pid == null) { >+ // For GDB 7.0 and 7.1, the groupId is the pid, so we can use it directly > pid = groupId; > } > IProcessDMContext processDmc = createProcessContext(controlDmc, pid); >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java,v >retrieving revision 1.6 >diff -u -r1.6 GDBProcesses_7_2.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 11 Mar 2011 16:35:34 -0000 1.6 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 31 Mar 2011 19:57:57 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; > import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; >+import org.eclipse.cdt.dsf.mi.service.MIProcesses; > import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; > import org.eclipse.cdt.dsf.mi.service.command.output.MIAddInferiorInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >@@ -83,6 +84,17 @@ > super.shutdown(requestMonitor); > } > >+ @Override >+ public IMIContainerDMContext createContainerContextFromGroupId(ICommandControlDMContext controlDmc, String groupId) { >+ String pid = getGroupToPidMap().get(groupId); >+ if (pid == null) { >+ // For GDB 7.2, the groupId is no longer the pid, so use our wildcard pid instead >+ pid = MIProcesses.UNIQUE_GROUP_ID; >+ } >+ IProcessDMContext processDmc = createProcessContext(controlDmc, pid); >+ return createContainerContext(processDmc, groupId); >+ } >+ > @Override > protected boolean doIsDebuggerAttachSupported() { > // Multi-process is not applicable to post-mortem sessions (core) >@@ -225,9 +237,26 @@ > } > > @Override >+ protected boolean doCanDetachDebuggerFromProcess() { >+ // Multi-process is not applicable to post-mortem sessions (core) >+ // or to non-attach remote sessions. >+ SessionType type = fBackend.getSessionType(); >+ >+ if (type == SessionType.CORE) { >+ return false; >+ } >+ >+ if (type == SessionType.REMOTE && !fBackend.getIsAttachSession()) { >+ return false; >+ } >+ >+ return getNumConnected() > 0; >+ } >+ >+ @Override > public void detachDebuggerFromProcess(IDMContext dmc, final RequestMonitor rm) { > >- ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); >+ final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); > final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); > > if (controlDmc != null && containerDmc != null) { >@@ -237,6 +266,12 @@ > return; > } > >+ // Stop tracking the breakpoints for the process we are about to detach from >+ MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class); >+ IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); >+ bpmService.stopTrackingBreakpoints(bpTargetDmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) { >+ @Override >+ protected void handleCompleted() { > fCommandControl.queueCommand( > fCommandFactory.createMITargetDetach(controlDmc, containerDmc.getGroupId()), > new DataRequestMonitor<MIInfo>(getExecutor(), rm) { >@@ -259,6 +294,8 @@ > } > } > }); >+ } >+ }); > } else { > rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid context.", null)); //$NON-NLS-1$ > rm.done(); >Index: src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java,v >retrieving revision 1.11 >diff -u -r1.11 MIProcesses.java >--- src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java 10 Mar 2011 01:51:17 -0000 1.11 >+++ src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java 31 Mar 2011 19:57:57 -0000 >@@ -419,7 +419,7 @@ > > /** @since 4.0 */ > public IMIContainerDMContext createContainerContextFromGroupId(ICommandControlDMContext controlDmc, String groupId) { >- IProcessDMContext processDmc = createProcessContext(controlDmc, groupId); >+ IProcessDMContext processDmc = createProcessContext(controlDmc, MIProcesses.UNIQUE_GROUP_ID); > return createContainerContext(processDmc, groupId); > } >
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 336890
:
192324
|
192410
|
192894