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 108679 Details for
Bug 241985
[services] Service factory should be used to create ICommandControl
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]
Cleanup of GDBControl constructor
zpatch.txt (text/plain), 10.54 KB, created by
Marc Khouzam
on 2008-07-29 14:07:44 EDT
(
hide
)
Description:
Cleanup of GDBControl constructor
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2008-07-29 14:07:44 EDT
Size:
10.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.dd.gdb >Index: src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java,v >retrieving revision 1.18 >diff -u -r1.18 GDBControl.java >--- src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java 29 Jul 2008 17:12:15 -0000 1.18 >+++ src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java 29 Jul 2008 18:03:39 -0000 >@@ -30,6 +30,7 @@ > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; >@@ -43,6 +44,7 @@ > import org.eclipse.dd.dsf.service.DsfSession; > import org.eclipse.dd.gdb.internal.GdbPlugin; > import org.eclipse.dd.gdb.internal.provisional.launching.GdbLaunch; >+import org.eclipse.dd.gdb.internal.provisional.launching.LaunchUtils; > import org.eclipse.dd.mi.service.command.AbstractCLIProcess; > import org.eclipse.dd.mi.service.command.AbstractMIControl; > import org.eclipse.dd.mi.service.command.CLIEventProcessor; >@@ -59,6 +61,7 @@ > import org.eclipse.dd.mi.service.command.output.MIBreakInsertInfo; > import org.eclipse.dd.mi.service.command.output.MIInfo; > import org.eclipse.debug.core.DebugException; >+import org.eclipse.debug.core.ILaunchConfiguration; > import org.osgi.framework.BundleContext; > > /** >@@ -117,15 +120,16 @@ > fControlDmc = new GDBControlDMContext(session.getId(), "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$ > } > >- public void setGdbPath(IPath path) { fGdbPath = path; } >- >- public void setExecPath(IPath path) { fExecPath = path; } >- >- public void setSessionType(SessionType type) { fSessionType = type; } >- >- public void setAttach(boolean attach) { fAttach = attach; } >- >- public void setLaunchTimeout(int timeout) { fGDBLaunchTimeout = timeout; } >+ public void initData(ILaunchConfiguration config) { >+ fSessionType = LaunchUtils.getSessionType(config); >+ fAttach = LaunchUtils.getIsAttach(config); >+ fGdbPath = LaunchUtils.getGDBPath(config); >+ try { >+ fExecPath = LaunchUtils.verifyProgramPath(config, LaunchUtils.getCProject(config)); >+ } catch (CoreException e) { >+ fExecPath = new Path(""); //$NON-NLS-1$ >+ } >+ } > > @Deprecated > public GDBControl(DsfSession session, IPath gdbPath, IPath execPath, SessionType sessionType, boolean attach, int gdbLaunchTimeout) { >Index: src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunchDelegate.java,v >retrieving revision 1.19 >diff -u -r1.19 GdbLaunchDelegate.java >--- src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunchDelegate.java 27 Jul 2008 18:22:55 -0000 1.19 >+++ src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunchDelegate.java 29 Jul 2008 18:03:39 -0000 >@@ -17,7 +17,6 @@ > > import org.eclipse.cdt.core.model.ICModelMarker; > import org.eclipse.cdt.core.model.ICProject; >-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; > import org.eclipse.core.resources.IMarker; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -88,8 +87,8 @@ > return; > } > >- SessionType sessionType = getSessionType(config); >- boolean attach = getIsAttach(config); >+ SessionType sessionType = LaunchUtils.getSessionType(config); >+ boolean attach = LaunchUtils.getIsAttach(config); > > final GdbLaunch launch = (GdbLaunch)l; > >@@ -159,25 +158,7 @@ > return new FinalLaunchSequence(executor, launch, type, attach); > } > >- private SessionType getSessionType(ILaunchConfiguration config) { >- try { >- String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); >- if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { >- return SessionType.LOCAL; >- } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { >- return SessionType.LOCAL; >- } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { >- return SessionType.CORE; >- } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { >- return SessionType.REMOTE; >- } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { >- return SessionType.REMOTE; >- } >- } catch (CoreException e) { >- } >- return SessionType.LOCAL; >- } >- >+ > private boolean isNonStopSession(ILaunchConfiguration config) { > try { > boolean nonStopMode = config.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, >@@ -187,31 +168,12 @@ > } > return false; > } >- >- private boolean getIsAttach(ILaunchConfiguration config) { >- try { >- String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); >- if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { >- return false; >- } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { >- return true; >- } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { >- return false; >- } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { >- return false; >- } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { >- return true; >- } >- } catch (CoreException e) { >- } >- return false; >- } >- >+ > > @Override > public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException { > // no pre launch check for core file >- if (mode.equals(ILaunchManager.DEBUG_MODE) && getSessionType(config) == SessionType.CORE) return true; >+ if (mode.equals(ILaunchManager.DEBUG_MODE) && LaunchUtils.getSessionType(config) == SessionType.CORE) return true; > > return super.preLaunchCheck(config, mode, monitor); > } >Index: src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java,v >retrieving revision 1.3 >diff -u -r1.3 LaunchUtils.java >--- src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java 26 Jul 2008 19:05:04 -0000 1.3 >+++ src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java 29 Jul 2008 18:03:39 -0000 >@@ -37,6 +37,7 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.dd.gdb.internal.GdbPlugin; > import org.eclipse.dd.gdb.internal.provisional.IGDBLaunchConfigurationConstants; >+import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl.SessionType; > import org.eclipse.debug.core.DebugException; > import org.eclipse.debug.core.ILaunchConfiguration; > >@@ -227,5 +228,44 @@ > > return version; > } >+ >+ public static boolean getIsAttach(ILaunchConfiguration config) { >+ try { >+ String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); >+ if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { >+ return false; >+ } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { >+ return true; >+ } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { >+ return false; >+ } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { >+ return false; >+ } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { >+ return true; >+ } >+ } catch (CoreException e) { >+ } >+ return false; >+ } >+ >+ public static SessionType getSessionType(ILaunchConfiguration config) { >+ try { >+ String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); >+ if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { >+ return SessionType.LOCAL; >+ } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { >+ return SessionType.LOCAL; >+ } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { >+ return SessionType.CORE; >+ } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { >+ return SessionType.REMOTE; >+ } else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { >+ return SessionType.REMOTE; >+ } >+ } catch (CoreException e) { >+ } >+ return SessionType.LOCAL; >+ } >+ > } > >Index: src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.dd.dsf/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java,v >retrieving revision 1.11 >diff -u -r1.11 ServicesLaunchSequence.java >--- src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java 27 Jul 2008 19:12:00 -0000 1.11 >+++ src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java 29 Jul 2008 18:03:39 -0000 >@@ -41,12 +41,7 @@ > // Create the connection. > // > fCommandControl = fLaunch.getServiceFactory().createService(fSession, GDBControl.class); >- >- fCommandControl.setAttach(fAttach); >- fCommandControl.setExecPath(fExecPath); >- fCommandControl.setGdbPath(LaunchUtils.getGDBPath(fLaunch.getLaunchConfiguration())); >- fCommandControl.setSessionType(fSessionType); >- >+ fCommandControl.initData(fLaunch.getLaunchConfiguration()); > fCommandControl.initialize(requestMonitor); > } > },
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:
cdtdoug
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 241985
:
108369
|
108506
| 108679 |
108683