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 179913 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]
Basic multi-process with disconnect working
zpatch.txt (text/plain), 12.26 KB, created by
Marc Khouzam
on 2010-09-29 22:20:29 EDT
(
hide
)
Description:
Basic multi-process with disconnect working
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2010-09-29 22:20:29 EDT
Size:
12.26 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.26 >diff -u -r1.26 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 20 Aug 2010 18:01:44 -0000 1.26 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 30 Sep 2010 02:14:34 -0000 >@@ -649,7 +649,10 @@ > rm.done(); > } > >- private boolean doIsDebuggerAttachSupported() { >+ /** >+ * @since 4.0 >+ */ >+ protected boolean doIsDebuggerAttachSupported() { > IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class); > if (backend != null) { > return backend.getIsAttachSession(); >@@ -689,7 +692,10 @@ > } > } > >- 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/GDBProcesses_7_2.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >diff -N src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,132 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 Ericsson 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: >+ * Ericsson - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb.service; >+ >+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.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; >+import org.eclipse.cdt.dsf.mi.service.IMICommandControl; >+import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; >+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; >+import org.eclipse.cdt.dsf.service.DsfSession; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+ >+/** >+ * @since 4.0 >+ */ >+public class GDBProcesses_7_2 extends GDBProcesses_7_1 { >+ >+ private CommandFactory fCommandFactory; >+ private IGDBControl fCommandControl; >+ >+ public GDBProcesses_7_2(DsfSession session) { >+ super(session); >+ } >+ >+ @Override >+ public void initialize(final RequestMonitor requestMonitor) { >+ super.initialize(new RequestMonitor(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleSuccess() { >+ doInitialize(requestMonitor); >+ } >+ }); >+ } >+ >+ /** >+ * This method initializes this service after our superclass's initialize() >+ * method succeeds. >+ * >+ * @param requestMonitor >+ * The call-back object to notify when this service's >+ * initialization is done. >+ */ >+ private void doInitialize(RequestMonitor requestMonitor) { >+ fCommandControl = getServicesTracker().getService(IGDBControl.class); >+ fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory(); >+ requestMonitor.done(); >+ } >+ >+ @Override >+ public void shutdown(RequestMonitor requestMonitor) { >+ super.shutdown(requestMonitor); >+ } >+ >+ @Override >+ public void attachDebuggerToProcess(final IProcessDMContext procCtx, final DataRequestMonitor<IDMContext> rm) { >+ if (procCtx instanceof IMIProcessDMContext) { >+ if (!doIsDebuggerAttachSupported()) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Attach not supported.", null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(procCtx, ICommandControlDMContext.class); >+ fCommandControl.queueCommand( >+ fCommandFactory.createMIAddInferior(controlDmc), >+ new DataRequestMonitor<MIAddInferiorInfo>(getExecutor(), rm) { >+ @Override >+ protected void handleSuccess() { >+ final String groupId = getData().getGroupId(); >+ if (groupId == null || groupId.trim().length() == 0) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid gdb group id.", null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ final IMIContainerDMContext containerDmc = createContainerContext(procCtx, groupId); >+ fCommandControl.queueCommand( >+ fCommandFactory.createMITargetAttach(containerDmc, ((IMIProcessDMContext)procCtx).getProcId()), >+ new DataRequestMonitor<MIInfo>(getExecutor(), rm) { >+ @Override >+ protected void handleSuccess() { >+ rm.setData(containerDmc); >+ rm.done(); >+ } >+ }); >+ } >+ }); >+ } else { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$ >+ rm.done(); >+ } >+ } >+ >+ @Override >+ public void detachDebuggerFromProcess(IDMContext dmc, final RequestMonitor rm) { >+ >+ IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); >+ >+ if (containerDmc != null) { >+ if (!doCanDetachDebuggerFromProcess()) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Detach not supported.", null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ fCommandControl.queueCommand( >+ fCommandFactory.createMITargetDetach(containerDmc), >+ new DataRequestMonitor<MIInfo>(getExecutor(), rm)); >+ } 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/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.14 >diff -u -r1.14 GdbDebugServicesFactory.java >--- src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 27 Sep 2010 01:13:38 -0000 1.14 >+++ src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 30 Sep 2010 02:14:35 -0000 >@@ -139,6 +139,9 @@ > > @Override > protected IProcesses createProcessesService(DsfSession session) { >+ if (GDB_7_2_VERSION.compareTo(fVersion) <= 0) { >+ return new GDBProcesses_7_2(session); >+ } > if (GDB_7_1_VERSION.compareTo(fVersion) <= 0) { > return new GDBProcesses_7_1(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.16 >diff -u -r1.16 CommandFactory.java >--- src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 2 Sep 2010 12:34:31 -0000 1.16 >+++ src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 30 Sep 2010 02:14:35 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommand; > 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.IMIContainerDMContext; > import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLIAttach; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLICatch; >@@ -667,10 +668,24 @@ > return new MITargetAttach(ctx, groupId); > } > >+ /** >+ * @since 4.0 >+ */ >+ public ICommand<MIInfo> createMITargetAttach(IMIContainerDMContext ctx, String groupId) { >+ return new MITargetAttach(ctx, groupId); >+ } >+ > public ICommand<MIInfo> createMITargetDetach(ICommandControlDMContext ctx, String groupId) { > return new MITargetDetach(ctx, groupId); > } > >+ /** >+ * @since 4.0 >+ */ >+ public ICommand<MIInfo> createMITargetDetach(IMIContainerDMContext ctx) { >+ return new MITargetDetach(ctx); >+ } >+ > public ICommand<MIInfo> createMITargetSelect(IDMContext ctx, String[] params) { > return new MITargetSelect(ctx, params); > } >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetAttach.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetAttach.java,v >retrieving revision 1.2 >diff -u -r1.2 MITargetAttach.java >--- src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetAttach.java 3 Jun 2010 00:09:35 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetAttach.java 30 Sep 2010 02:14:35 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008, 2009 Ericsson and others. >+ * Copyright (c) 2008, 2010 Ericsson 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 >@@ -11,6 +11,7 @@ > 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.IMIContainerDMContext; > import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; > > /** >@@ -25,4 +26,11 @@ > public MITargetAttach(ICommandControlDMContext ctx, String groupId) { > super(ctx, "-target-attach", new String[] {groupId}); //$NON-NLS-1$ > } >+ >+ /** >+ * @since 4.0 >+ */ >+ public MITargetAttach(IMIContainerDMContext ctx, String pid) { >+ super(ctx, "-target-attach", new String[] {"--thread-group", ctx.getGroupId()}, new String[] {pid}); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > } >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetDetach.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetDetach.java,v >retrieving revision 1.2 >diff -u -r1.2 MITargetDetach.java >--- src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetDetach.java 3 Jun 2010 00:09:35 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/MITargetDetach.java 30 Sep 2010 02:14:35 -0000 >@@ -11,6 +11,7 @@ > 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.IMIContainerDMContext; > import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; > > /** >@@ -25,4 +26,11 @@ > public MITargetDetach(ICommandControlDMContext ctx, String groupId) { > super(ctx, "-target-detach", new String[] {groupId}); //$NON-NLS-1$ > } >+ >+ /** >+ * @since 4.0 >+ */ >+ public MITargetDetach(IMIContainerDMContext ctx) { >+ super(ctx, "-target-detach", new String[] {"--thread-group", ctx.getGroupId()}); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > }
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 237306
:
166478
|
167440
|
168092
|
168093
|
168510
|
176501
|
178929
|
179595
|
179596
| 179913 |
182593
|
184318
|
185285
|
185617
|
185691
|
186266
|
187326
|
187357
|
190931
|
190997