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 167440 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.
GDBProcesses_7_1
gdbprocesspatch.txt (text/plain), 12.68 KB, created by
Onur Akdemir
on 2010-05-07 04:24:17 EDT
(
hide
)
Description:
GDBProcesses_7_1
Filename:
MIME Type:
Creator:
Onur Akdemir
Created:
2010-05-07 04:24:17 EDT
Size:
12.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >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.20 >diff -u -r1.20 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 29 Apr 2010 19:17:18 -0000 1.20 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 7 May 2010 08:15:49 -0000 >@@ -374,17 +374,17 @@ > /** > * A map of thread id to thread group id. We use this to find out to which threadGroup a thread belongs. > */ >- private Map<String, String> fThreadToGroupMap = new HashMap<String, String>(); >+ protected Map<String, String> fThreadToGroupMap = new HashMap<String, String>(); > >- private IGDBControl fCommandControl; >- private IGDBBackend fBackend; >- private CommandFactory fCommandFactory; >+ protected IGDBControl fCommandControl; >+ protected IGDBBackend fBackend; >+ protected CommandFactory fCommandFactory; > > // A cache for commands about the threadGroups >- private CommandCache fContainerCommandCache; >+ protected CommandCache fContainerCommandCache; > > //A cache for commands about the threads >- private CommandCache fThreadCommandCache; >+ protected CommandCache fThreadCommandCache; > > // A temporary cache to avoid using -list-thread-groups --available more than once at the same time. > // We cannot cache this command because it lists all available processes, which can >@@ -392,7 +392,7 @@ > // the same time. This cache will help us avoid that. The idea is that we cache the command, > // but as soon as it returns, we clear the cache. So the cache will only trigger for those > // overlapping situations. >- private CommandCache fListThreadGroupsAvailableCache; >+ protected CommandCache fListThreadGroupsAvailableCache; > > // A map of process id to process names. A name is fetched whenever we start > // debugging a process, and removed when we stop. >@@ -401,7 +401,7 @@ > // This map also serves as a list of processes we are currently debugging. > // This is important because we cannot always ask GDB for the list, since it may > // be running at the time. Bug 303503 >- private Map<String, String> fDebuggedProcessesAndNames = new HashMap<String, String>(); >+ protected Map<String, String> fDebuggedProcessesAndNames = new HashMap<String, String>(); > > private static final String FAKE_THREAD_ID = "0"; //$NON-NLS-1$ > >@@ -463,16 +463,20 @@ > fCommandControl.addEventListener(this); > > // Register this service. >+ registerProcService(); >+ >+ requestMonitor.done(); >+ } >+ >+ // Register this service. New procservices needs to override this method >+ protected void registerProcService(){ > register(new String[] { IProcesses.class.getName(), > IMIProcesses.class.getName(), > IGDBProcesses.class.getName(), > GDBProcesses_7_0.class.getName() }, > new Hashtable<String, String>()); >- >- requestMonitor.done(); > } > >- > /** > * This method shuts down this service. It unregisters the service, stops > * receiving service events, and calls the superclass shutdown() method to >@@ -554,6 +558,7 @@ > return execDmcList.toArray(new IMIExecutionDMContext[0]); > } > >+ int nullInferiorId = 1; > public void getExecutionData(IThreadDMContext dmc, final DataRequestMonitor<IThreadDMData> rm) { > if (dmc instanceof IMIProcessDMContext) { > String id = ((IMIProcessDMContext)dmc).getProcId(); >@@ -573,9 +578,11 @@ > } else { > name = fDebuggedProcessesAndNames.get(id); > if (name == null) { >+ name = "New Inferior"; //$NON-NLS-1$ >+ id = "null"; > // We don't have the name in our map. Should not happen. >- name = "Unknown name"; //$NON-NLS-1$ >- assert false : "Don't have entry for process ID: " + id; //$NON-NLS-1$ >+ //name = "Unknown name"; //$NON-NLS-1$ >+ //assert false : "Don't have entry for process ID: " + id; //$NON-NLS-1$ > } else if (name.length() == 0) { > // Probably will not happen, but just in case...use the > // binary file name (absolute path) >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >diff -N src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,102 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+ >+package org.eclipse.cdt.dsf.gdb.service; >+ >+import java.util.Hashtable; >+import java.util.Map; >+ >+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; >+import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >+import org.eclipse.cdt.dsf.datamodel.DMContexts; >+import org.eclipse.cdt.dsf.datamodel.IDMContext; >+import org.eclipse.cdt.dsf.debug.service.IProcesses; >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIProcesses; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+import org.eclipse.cdt.dsf.service.DsfSession; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+ >+public class GDBProcesses_7_1 extends GDBProcesses_7_0 { >+ >+ public GDBProcesses_7_1(DsfSession session) { >+ super(session); >+ // TODO Auto-generated constructor stub >+ } >+ >+ >+ @Override >+ protected void registerProcService() { >+ register(new String[] { IProcesses.class.getName(), >+ IMIProcesses.class.getName(), >+ IGDBProcesses.class.getName(), >+ GDBProcesses_7_1.class.getName() }, >+ new Hashtable<String, String>()); >+ } >+ >+ public boolean doIsRunNewProcessSupported() { >+ return true; >+ } >+ >+ @Override >+ public void isRunNewProcessSupported(IDMContext dmc, >+ DataRequestMonitor<Boolean> rm) { >+ rm.setData(true); >+ rm.done(); >+ } >+ >+ @Override >+ public void runNewProcess(IDMContext dmc, String file, >+ Map<String, Object> attributes, >+ DataRequestMonitor<IProcessDMContext> rm) { >+ final RequestMonitor requestMonitor; >+ >+ if (rm != null){ >+ requestMonitor = rm; >+ }else{ >+ requestMonitor = new RequestMonitor(getExecutor(),null); >+ } >+ >+ if (dmc instanceof GDBControlDMContext) { >+ >+ if ( !doIsRunNewProcessSupported() ) { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Multi-process debug not supported.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ return; >+ } >+ >+ final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); >+ fCommandControl.queueCommand( >+ fCommandFactory.createCLIAddInferior( controlDmc ), >+ new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleSuccess() { >+ IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class); >+ if (procService != null) { >+ IProcessDMContext procDmc = procService.createProcessContext(controlDmc, null); >+ IMIContainerDMContext containerDmc = createContainerContext(procDmc, null); >+ getSession().dispatchEvent(new ContainerStartedDMEvent(containerDmc), getProperties()); >+ } >+ requestMonitor.done(); >+ } >+ }); >+ >+ } else { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ } >+ >+ } >+} >Index: src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java,v >retrieving revision 1.11 >diff -u -r1.11 GdbDebugServicesFactory.java >--- src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 28 Apr 2010 23:50:48 -0000 1.11 >+++ src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 7 May 2010 08:15:50 -0000 >@@ -45,6 +45,7 @@ > // This should eventually be "7.0" once GDB 7.0 is released > private static final String GDB_7_0_VERSION = "6.8.50.20090218"; //$NON-NLS-1$ > private static final String GDB_7_2_VERSION = "7.1.50"; //$NON-NLS-1$ >+ private static final String GDB_7_1_VERSION = "7.1"; //$NON-NLS-1$ > > private final String fVersion; > >@@ -133,7 +134,9 @@ > > @Override > protected IProcesses createProcessesService(DsfSession session) { >- if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) { >+ if (GDB_7_1_VERSION.compareTo(fVersion) <= 0) { >+ return new GDBProcesses_7_1(session); >+ }else if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) { > return new GDBProcesses_7_0(session); > } > return new GDBProcesses(session); >Index: src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java,v >retrieving revision 1.5 >diff -u -r1.5 CommandFactory.java >--- src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 28 Apr 2010 23:50:49 -0000 1.5 >+++ src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 7 May 2010 08:15:50 -0000 >@@ -9,6 +9,7 @@ > * QNX Software Systems - Initial API and implementation > * ENEA Software AB - CLI command extension - fix for bug 190277 > * Ericsson - Implementation for DSF-GDB >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support - bug 237306 > *******************************************************************************/ > > package org.eclipse.cdt.dsf.mi.service.command; >@@ -26,6 +27,7 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceTargetDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; >+import org.eclipse.cdt.dsf.mi.service.command.commands.CLIAddInferior; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLIAttach; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLICatch; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLIDetach; >@@ -172,6 +174,10 @@ > */ > public class CommandFactory { > >+ public ICommand<MIInfo> createCLIAddInferior(ICommandControlDMContext ctx) { >+ return new CLIAddInferior(ctx); >+ } >+ > public ICommand<MIInfo> createCLIAttach(IDMContext ctx, int pid) { > return new CLIAttach(ctx, pid); > } >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >diff -N src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.mi.service.command.commands; >+ >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+ >+/** >+ * This command adds a new - null inferior >+ * TODO Native interface may change. >+ */ >+public class CLIAddInferior extends CLICommand<MIInfo> { >+ >+ public CLIAddInferior(ICommandControlDMContext ctx) { >+ super(ctx, "add-inferior"); //$NON-NLS-1$ >+ } >+ >+}
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 Raw
Actions:
View
Attachments on
bug 237306
:
166478
|
167440
|
168092
|
168093
|
168510
|
176501
|
178929
|
179595
|
179596
|
179913
|
182593
|
184318
|
185285
|
185617
|
185691
|
186266
|
187326
|
187357
|
190931
|
190997