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 114416 Details for
Bug 248636
[memory] Memory service does not properly use the MemoryContext to select the proper process
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]
Original suggested fix
zpatch.txt (text/plain), 7.68 KB, created by
Marc Khouzam
on 2008-10-07 09:51:04 EDT
(
hide
)
Description:
Original suggested fix
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2008-10-07 09:51:04 EDT
Size:
7.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.dd.mi >Index: src/org/eclipse/dd/mi/service/MIProcesses.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIProcesses.java,v >retrieving revision 1.27 >diff -u -r1.27 MIProcesses.java >--- src/org/eclipse/dd/mi/service/MIProcesses.java 6 Oct 2008 17:41:55 -0000 1.27 >+++ src/org/eclipse/dd/mi/service/MIProcesses.java 7 Oct 2008 13:34:09 -0000 >@@ -674,4 +674,11 @@ > public void flushCache(IDMContext context) { > fContainerCommandCache.reset(context); > } >+ >+ public IMIExecutionDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc) { >+ // This method is meant to be used when we support multiple processes. >+ // This version of the service does not support that, so the caller will figure it out >+ // in its own. >+ return null; >+ } > } >Index: src/org/eclipse/dd/mi/service/IMIProcesses.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcesses.java,v >retrieving revision 1.8 >diff -u -r1.8 IMIProcesses.java >--- src/org/eclipse/dd/mi/service/IMIProcesses.java 6 Oct 2008 17:41:55 -0000 1.8 >+++ src/org/eclipse/dd/mi/service/IMIProcesses.java 7 Oct 2008 13:34:09 -0000 >@@ -63,5 +63,15 @@ > * @param threadId The thread id belonging to the container we want to create > */ > IMIContainerDMContext createContainerContextFromThreadId(ICommandControlDMContext controlDmc, String threadId); >+ >+ /** >+ * Get a list of all execution contexts belonging to a container. This call is synchronous, >+ * unlike the call to getProcessesBeingDebugged(). However, some services may not be able >+ * to fulfill this request synchronously and will have to rely on getProcessesBeingDebugged(). >+ * >+ * @param containerDmc The container for which we want to get the execution contexts >+ */ >+ IMIExecutionDMContext[] getExecutionContexts(IMIContainerDMContext containerDmc); >+ > } > >Index: src/org/eclipse/dd/mi/service/command/AbstractMIControl.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java,v >retrieving revision 1.22 >diff -u -r1.22 AbstractMIControl.java >--- src/org/eclipse/dd/mi/service/command/AbstractMIControl.java 3 Oct 2008 19:39:26 -0000 1.22 >+++ src/org/eclipse/dd/mi/service/command/AbstractMIControl.java 7 Oct 2008 13:34:11 -0000 >@@ -43,7 +43,9 @@ > import org.eclipse.dd.dsf.service.AbstractDsfService; > import org.eclipse.dd.dsf.service.DsfSession; > import org.eclipse.dd.mi.internal.MIPlugin; >+import org.eclipse.dd.mi.service.IMIContainerDMContext; > import org.eclipse.dd.mi.service.IMIExecutionDMContext; >+import org.eclipse.dd.mi.service.IMIProcesses; > import org.eclipse.dd.mi.service.command.commands.MICommand; > import org.eclipse.dd.mi.service.command.commands.MIStackSelectFrame; > import org.eclipse.dd.mi.service.command.commands.MIThreadSelect; >@@ -461,8 +463,26 @@ > > public String getThreadId() { > IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class); >- if(execCtx != null) >+ if (execCtx != null) { > return Integer.toString(execCtx.getThreadId()); >+ } >+ >+ // If we don't have an execution context, try to see if we have a container context. >+ // If we do, then we should specify this container to MI; however, the only way to do this >+ // is to specify some thread within the container. >+ IMIContainerDMContext containerCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIContainerDMContext.class); >+ if(containerCtx != null) { >+ IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class); >+ >+ if (procService != null) { >+ IMIExecutionDMContext[] execCtxs = procService.getExecutionContexts(containerCtx); >+ // Return any thread... let's take the first one. >+ if (execCtxs != null && execCtxs.length > 0) { >+ return Integer.toString(execCtxs[0].getThreadId()); >+ } >+ } >+ } >+ > return null; > } > >#P org.eclipse.dd.gdb >Index: src/org/eclipse/dd/gdb/internal/provisional/service/GDBRunControl_7_0.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GDBRunControl_7_0.java,v >retrieving revision 1.1 >diff -u -r1.1 GDBRunControl_7_0.java >--- src/org/eclipse/dd/gdb/internal/provisional/service/GDBRunControl_7_0.java 11 Sep 2008 19:36:53 -0000 1.1 >+++ src/org/eclipse/dd/gdb/internal/provisional/service/GDBRunControl_7_0.java 7 Oct 2008 13:34:12 -0000 >@@ -28,7 +28,6 @@ > import org.eclipse.dd.dsf.service.DsfSession; > import org.eclipse.dd.gdb.internal.GdbPlugin; > import org.eclipse.dd.gdb.internal.provisional.service.command.IGDBControl; >-import org.eclipse.dd.mi.internal.MIPlugin; > import org.eclipse.dd.mi.service.IMIExecutionDMContext; > import org.eclipse.dd.mi.service.IMIProcesses; > import org.eclipse.dd.mi.service.MIRunControl; >@@ -108,7 +107,7 @@ > IExecutionDMContext[] execDmcs = (IExecutionDMContext[])getData(); > rm.setData(execDmcs); > } else { >- rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid contexts", null)); //$NON-NLS-1$ >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid contexts", null)); //$NON-NLS-1$ > } > rm.done(); > } >Index: src/org/eclipse/dd/gdb/internal/provisional/service/GDBProcesses_7_0.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GDBProcesses_7_0.java,v >retrieving revision 1.17 >diff -u -r1.17 GDBProcesses_7_0.java >--- src/org/eclipse/dd/gdb/internal/provisional/service/GDBProcesses_7_0.java 6 Oct 2008 18:39:30 -0000 1.17 >+++ src/org/eclipse/dd/gdb/internal/provisional/service/GDBProcesses_7_0.java 7 Oct 2008 13:34:12 -0000 >@@ -10,9 +10,11 @@ > *******************************************************************************/ > package org.eclipse.dd.gdb.internal.provisional.service; > >+import java.util.ArrayList; > import java.util.HashMap; > import java.util.Hashtable; > import java.util.Iterator; >+import java.util.List; > import java.util.Map; > > import org.eclipse.core.runtime.IStatus; >@@ -448,6 +450,24 @@ > 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 = 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 IMIExecutionDMContext[0]); >+ } >+ > /** > * This method obtains the model data for a given IThreadDMContext object > * which can represent a thread or a process.
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 248636
:
114416
|
114481
|
114708
|
114833