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 185334 Details for
Bug 286162
Debug core logs spawner IO exception when running C/C++ executable on Linux
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]
Use PTY I/O.
20101216_286162.patch (text/plain), 3.42 KB, created by
Pawel Piech
on 2010-12-16 10:56:06 EST
(
hide
)
Description:
Use PTY I/O.
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2010-12-16 10:56:06 EST
Size:
3.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.launch >Index: src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java,v >retrieving revision 1.13 >diff -u -r1.13 LocalCDILaunchDelegate.java >--- src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java 28 Nov 2010 19:58:42 -0000 1.13 >+++ src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java 16 Dec 2010 15:51:27 -0000 >@@ -14,6 +14,8 @@ > > import java.io.File; > import java.io.IOException; >+import java.io.InputStream; >+import java.io.OutputStream; > import java.util.ArrayList; > import java.util.Arrays; > >@@ -93,7 +95,33 @@ > String[] commandArray = (String[])command.toArray(new String[command.size()]); > boolean usePty = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT); > monitor.worked(2); >- Process process = exec(commandArray, getEnvironment(config), wd, usePty); >+ PTY pty = null; >+ if (usePty && PTY.isSupported()) { >+ try { >+ pty = new PTY(); >+ } catch (IOException e) { >+ abort(LaunchMessages.LocalCDILaunchDelegate_8, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); >+ } >+ } >+ Process process = exec(commandArray, getEnvironment(config), wd, pty); >+ if (pty != null) { >+ final Process _spawner = process; >+ final PTY _pty = pty; >+ process = new Process() { >+ @Override >+ public void destroy() { _spawner.destroy(); } >+ @Override >+ public int exitValue() { return _spawner.exitValue(); } >+ @Override >+ public OutputStream getOutputStream() { return _pty.getOutputStream(); } >+ @Override >+ public InputStream getInputStream() { return _pty.getInputStream(); } >+ @Override >+ public InputStream getErrorStream() { return _spawner.getErrorStream(); } >+ @Override >+ public int waitFor() throws InterruptedException { return _spawner.waitFor(); } >+ }; >+ } > monitor.worked(6); > DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0])); > } finally { >@@ -356,15 +384,15 @@ > * cancelled > * @see Runtime > */ >- protected Process exec(String[] cmdLine, String[] environ, File workingDirectory, boolean usePty) throws CoreException { >+ protected Process exec(String[] cmdLine, String[] environ, File workingDirectory, PTY pty) throws CoreException { > Process p = null; > try { > if (workingDirectory == null) { > p = ProcessFactory.getFactory().exec(cmdLine, environ); > } > else { >- if (usePty && PTY.isSupported()) { >- p = ProcessFactory.getFactory().exec(cmdLine, environ, workingDirectory, new PTY()); >+ if (pty != null) { >+ p = ProcessFactory.getFactory().exec(cmdLine, environ, workingDirectory, pty); > } > else { > p = ProcessFactory.getFactory().exec(cmdLine, environ, workingDirectory); >@@ -385,7 +413,7 @@ > if (handler != null) { > Object result = handler.handleStatus(status, this); > if (result instanceof Boolean && ((Boolean)result).booleanValue()) { >- p = exec(cmdLine, environ, null, usePty); >+ p = exec(cmdLine, environ, null, pty); > } > } > }
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 286162
:
185334
|
185407
|
185465