Source:
<code>public static String getGDBVersion(final ILaunchConfiguration configuration) throws CoreException { String cmd = getGDBPath(configuration).toOSString(); String[] args = new String[] { cmd, "--version" }; Process process = null; Job timeoutJob = null; try { process = ProcessFactory.getFactory().exec(args, getLaunchEnvironment(configuration)); final Process finalProc = process; timeoutJob = new Job("GDB version timeout job") { { setSystem(true); } @Override protected IStatus run(IProgressMonitor arg) { finalProc.destroy(); return Status.OK_STATUS; } }; timeoutJob.schedule(10000); String streamOutput = readStream(process.getInputStream()); String gdbVersion = getGDBVersionFromText(streamOutput); if (gdbVersion == null || gdbVersion.isEmpty()) { Exception detailedException = null; if (!streamOutput.isEmpty()) { detailedException = new Exception("Unexpected output format: \n\n" + streamOutput); } else { streamOutput = readStream(process.getErrorStream()); if (!streamOutput.isEmpty()) { detailedException = new Exception(streamOutput); } } throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, <START> "Could not determine GDB version using command: " + cmd, END> detailedException)); } return gdbVersion; } catch (IOException e) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error with command: " + cmd, e)); } finally { if (timeoutJob != null) { timeoutJob.cancel(); } if (process != null) { process.destroy(); } } }</code><technical_language>Please StringUtil.join 'args' in GDBBackend</technical_language>

Target:
public static String getGDBVersion(final ILaunchConfiguration configuration) throws CoreException { String cmd = getGDBPath(configuration).toOSString(); String[] args = new String[] { cmd, "--version" }; Process process = null; Job timeoutJob = null; try { process = ProcessFactory.getFactory().exec(args, getLaunchEnvironment(configuration)); final Process finalProc = process; timeoutJob = new Job("GDB version timeout job") { { setSystem(true); } @Override protected IStatus run(IProgressMonitor arg) { finalProc.destroy(); return Status.OK_STATUS; } }; timeoutJob.schedule(10000); String streamOutput = readStream(process.getInputStream()); String gdbVersion = getGDBVersionFromText(streamOutput); if (gdbVersion == null || gdbVersion.isEmpty()) { Exception detailedException = null; if (!streamOutput.isEmpty()) { detailedException = new Exception("Unexpected output format: \n\n" + streamOutput); } else { streamOutput = readStream(process.getErrorStream()); if (!streamOutput.isEmpty()) { detailedException = new Exception(streamOutput); } } throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Could not determine GDB version using command: " + StringUtil.join(args, " "), detailedException)); } return gdbVersion; } catch (IOException e) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error with command: " + StringUtil.join(args, " "), e)); } finally { if (timeoutJob != null) { timeoutJob.cancel(); } if (process != null) { process.destroy(); } } }