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 192410 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]
Fix using a wildcard for the processId
z.patch (text/plain), 8.95 KB, created by
Marc Khouzam
on 2011-04-01 21:47:35 EDT
(
hide
)
Description:
Fix using a wildcard for the processId
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-04-01 21:47:35 EDT
Size:
8.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java,v >retrieving revision 1.14 >diff -u -r1.14 GdbLaunch.java >--- src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 7 Mar 2011 11:35:07 -0000 1.14 >+++ src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java 2 Apr 2011 01:25:53 -0000 >@@ -135,7 +135,7 @@ > GdbLaunchDelegate.GDB_DEBUG_MODEL_ID, getLaunchConfiguration(), fSession); > fSession.registerModelAdapter(IMemoryBlockRetrieval.class, fMemRetrieval); > >- IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), MIProcesses.UNIQUE_GROUP_ID); >+ IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), MIProcesses.UNKNOWN_PROCESS_ID); > IMemoryDMContext memoryDmc = (IMemoryDMContext)procService.createContainerContext(procDmc, MIProcesses.UNIQUE_GROUP_ID); > fMemRetrieval.initialize(memoryDmc); > } >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.22 >diff -u -r1.22 GDBProcesses.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java 1 Apr 2011 18:17:41 -0000 1.22 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java 2 Apr 2011 01:25:54 -0000 >@@ -164,7 +164,7 @@ > if (fProcId != null) { > processDmc = createProcessContext(controlDmc, fProcId); > } else { >- processDmc = createProcessContext(controlDmc, groupId); >+ processDmc = createProcessContext(controlDmc, MIProcesses.UNKNOWN_PROCESS_ID); > } > return createContainerContext(processDmc, groupId); > } >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.43 >diff -u -r1.43 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 1 Apr 2011 18:17:41 -0000 1.43 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 2 Apr 2011 01:25:54 -0000 >@@ -301,12 +301,37 @@ > > @Override > public boolean equals(Object obj) { >- return baseEquals(obj) && >- (((MIProcessDMC)obj).fId == null ? fId == null : ((MIProcessDMC)obj).fId.equals(fId)); >+ // We treat the UNKNOWN_PROCESS_ID as a wildcard. Any processId (except null) will be considered >+ // equal to the UNKNOWN_PROCESS_ID. This is important because before starting a process, we don't >+ // have a pid yet, but we still need to create a process context, and we must use UNKNOWN_PROCESS_ID. >+ // Bug 336890 >+ >+ if (!baseEquals(obj)) { >+ return false; >+ } >+ >+ MIProcessDMC other = (MIProcessDMC)obj; >+ if (fId == null || other.fId == null) { >+ return fId == null && other.fId == null; >+ } >+ >+ // Now that we know neither is null, check for UNKNOWN_PROCESS_ID wildcard >+ if (fId.equals(MIProcesses.UNKNOWN_PROCESS_ID) || other.fId.equals(MIProcesses.UNKNOWN_PROCESS_ID)) { >+ return true; >+ } >+ >+ 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 >+ // the wildCard MIProcesses.UNKNOWN_PROCESS_ID which is equal to any other fId. >+ // But we also need the hashCode of 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 +575,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 +666,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.7 >diff -u -r1.7 GDBProcesses_7_2.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 1 Apr 2011 18:17:41 -0000 1.7 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 2 Apr 2011 01:25:54 -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.UNKNOWN_PROCESS_ID; >+ } >+ IProcessDMContext processDmc = createProcessContext(controlDmc, pid); >+ return createContainerContext(processDmc, groupId); >+ } >+ > @Override > protected boolean doIsDebuggerAttachSupported() { > // Multi-process is not applicable to post-mortem sessions (core) >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.12 >diff -u -r1.12 MIProcesses.java >--- src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java 1 Apr 2011 18:17:41 -0000 1.12 >+++ src/org/eclipse/cdt/dsf/mi/service/MIProcesses.java 2 Apr 2011 01:25:54 -0000 >@@ -255,12 +255,37 @@ > > @Override > public boolean equals(Object obj) { >- return super.baseEquals(obj) && >- (((MIProcessDMC)obj).fId == null ? fId == null : ((MIProcessDMC)obj).fId.equals(fId)); >+ // We treat the UNKNOWN_PROCESS_ID as a wildcard. Any processId (except null) will be considered >+ // equal to the UNKNOWN_PROCESS_ID. This is important because before starting a process, we don't >+ // have a pid yet, but we still need to create a process context, and we must use UNKNOWN_PROCESS_ID. >+ // Bug 336890 >+ >+ if (!baseEquals(obj)) { >+ return false; >+ } >+ >+ MIProcessDMC other = (MIProcessDMC)obj; >+ if (fId == null || other.fId == null) { >+ return fId == null && other.fId == null; >+ } >+ >+ // Now that we know neither is null, check for UNKNOWN_PROCESS_ID wildcard >+ if (fId.equals(UNKNOWN_PROCESS_ID) || other.fId.equals(UNKNOWN_PROCESS_ID)) { >+ return true; >+ } >+ >+ return fId.equals(other.fId); > } > > @Override >- public int hashCode() { return super.baseHashCode() ^ (fId == null ? 0 : fId.hashCode()); } >+ public int hashCode() { >+ // We cannot use fId in the hashCode. This is because we support >+ // the wildCard MIProcesses.UNKNOWN_PROCESS_ID which is equal to any other fId. >+ // But we also need the hashCode of 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(); >+ } > } > > /* >@@ -315,6 +340,8 @@ > private static final String FAKE_THREAD_ID = "0"; //$NON-NLS-1$ > // The unique id should be an empty string so that the views know not to display the fake id > public static final String UNIQUE_GROUP_ID = ""; //$NON-NLS-1$ >+ /** @since 4.0 */ >+ public static final String UNKNOWN_PROCESS_ID = UNIQUE_GROUP_ID; > > public MIProcesses(DsfSession session) { > super(session); >@@ -420,7 +447,7 @@ > > /** @since 4.0 */ > public IMIContainerDMContext createContainerContextFromGroupId(ICommandControlDMContext controlDmc, String groupId) { >- IProcessDMContext processDmc = createProcessContext(controlDmc, groupId); >+ IProcessDMContext processDmc = createProcessContext(controlDmc, UNKNOWN_PROCESS_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