} catch (IOException ignored) {
debugSession.stop();
return null;
}
final Gdb gdbProcess = debugProcess.m_gdb;
// Queue startup commands
gdbProcess.sendCommand("-list-features", new Gdb.GdbEventCallback() {
@Override
public void onGdbCommandCompleted(GdbEvent event) {
gdbProcess.onGdbCapabilitiesReady(event);
}
});
gdbProcess.sendCommand("add-auto-load-safe-path " + goRootPath);
String pythonRuntime = goRootPath + "/src/pkg/runtime/runtime-gdb.py";
if (GoSdkUtil.checkFileExists(pythonRuntime)) {
gdbProcess.sendCommand("source " + pythonRuntime);
}
gdbProcess.sendCommand("file " + execName);
//If we got any script arguments, pass them into gdb
if(!configuration.scriptArguments.equals("")) {
gdbProcess.sendCommand("set args " + configuration.scriptArguments);
}
debugSession.initBreakpoints();
// Send startup commands
String[] commandsArray = configuration.STARTUP_COMMANDS.split("\\r?\\n");
for (String command : commandsArray) {
command = command.trim();
if (!command.isEmpty()) {
gdbProcess.sendCommand(command);
}
}
if (configuration.autoStartGdb) {
gdbProcess.sendCommand("run");
}
return debugSession.getRunContentDescriptor();
}
}