1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

2004-11-16 Alain Magloire

Remove some warnings and use the new Launch key
	to decide whether or not to use pseudo tty.
	* mi/org/eclipse/cdt/debug/mi/core/TxThread.java
	* mi/org/eclipse/cdt/debug/mi/core/command/RawCommand.java
	* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
This commit is contained in:
Alain Magloire 2004-11-17 03:24:14 +00:00
parent f1002fe6a3
commit e5f9c0c311
8 changed files with 27 additions and 17 deletions

View file

@ -1,3 +1,10 @@
2004-11-16 Alain Magloire
Remove some warnings and use the new Launch key
to decide whether or not to use pseudo tty.
* mi/org/eclipse/cdt/debug/mi/core/TxThread.java
* mi/org/eclipse/cdt/debug/mi/core/command/RawCommand.java
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
2004-11-16 Alain Magloire
NPE when watchpoints are set in the gdb console.
* cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java

View file

@ -36,7 +36,6 @@ public class TxThread extends Thread {
public void run () {
try {
RxThread rxThread = session.getRxThread();
// signal by the session of time to die.
OutputStream out;

View file

@ -29,7 +29,7 @@ public class RawCommand extends Command {
public String toString() {
if (fRaw == null) {
fRaw = "\n"; //$NON-NLS-1$;
} else if (! fRaw.endsWith("\n")) {
} else if (! fRaw.endsWith("\n")) { //$NON-NLS-1$
fRaw += "\n"; //$NON-NLS-1$
}
return fRaw;

View file

@ -94,9 +94,14 @@ public class GDBCDIDebugger implements ICDIDebugger {
boolean failed = false;
try {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
boolean usePty = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, true);
File cwd = getProjectPath(config).toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), cwd, gdbinit, monitor);
if (usePty) {
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), cwd, gdbinit, monitor);
} else {
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), cwd, gdbinit, null, monitor);
}
initializeLibraries(config, session);
return session;
} catch (Exception e) {
@ -127,7 +132,7 @@ public class GDBCDIDebugger implements ICDIDebugger {
int pid = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_ATTACH_PROCESS_ID, -1);
File cwd = getProjectPath(config).toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), pid, null, cwd, gdbinit, monitor);
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), pid, null, cwd, gdbinit, monitor);
initializeLibraries(config, session);
return session;
} catch (Exception e) {
@ -158,7 +163,7 @@ public class GDBCDIDebugger implements ICDIDebugger {
File cwd = getProjectPath(config).toFile();
IPath coreFile = new Path(config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, (String)null));
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), coreFile.toFile(), cwd, gdbinit, monitor);
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), coreFile.toFile(), cwd, gdbinit, monitor);
initializeLibraries(config, session);
return session;
} catch (Exception e) {

View file

@ -75,7 +75,7 @@ public class GDBDebugger implements ICDebugger {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit, null);
session = MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit, null);
initializeLibraries(config, session);
return session;
} catch (IOException e) {
@ -107,7 +107,7 @@ public class GDBDebugger implements ICDebugger {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit, null);
session = MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit, null);
initializeLibraries(config, session);
return session;
} catch (IOException e) {
@ -139,7 +139,7 @@ public class GDBDebugger implements ICDebugger {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit, null);
session = MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit, null);
initializeLibraries(config, session);
return session;
} catch (IOException e) {

View file

@ -50,7 +50,7 @@ public class GDBServerCDIDebugger extends GDBCDIDebugger {
remote += ":"; //$NON-NLS-1$
remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$
String[] args = new String[] {"remote", remote}; //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), 0, args, cwd, gdbinit, monitor);
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), 0, args, cwd, gdbinit, monitor);
} else {
MIPlugin plugin = MIPlugin.getDefault();
Preferences prefs = plugin.getPluginPreferences();
@ -58,7 +58,7 @@ public class GDBServerCDIDebugger extends GDBCDIDebugger {
String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$
String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), -1, null, cwd, gdbinit, monitor);
session = MIPlugin.getDefault().createCSession(gdb, exe.getPath().toFile(), -1, null, cwd, gdbinit, monitor);
ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i];

View file

@ -70,7 +70,7 @@ public class GDBServerDebugger implements ICDebugger {
remote += ":"; //$NON-NLS-1$
remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$
String[] args = new String[] {"remote", remote}; //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit, null);
session = MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit, null);
} else {
MIPlugin plugin = MIPlugin.getDefault();
Preferences prefs = plugin.getPluginPreferences();
@ -78,7 +78,7 @@ public class GDBServerDebugger implements ICDebugger {
String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$
String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit, null);
session = MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit, null);
ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i];

View file

@ -17,7 +17,6 @@ import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
@ -110,7 +109,7 @@ public class MIPlugin extends Plugin {
* @return ICDISession
* @throws MIException
*/
public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
public Session createCSession(String gdb, File program, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
IMITTY pty = null;
boolean failed = false;
@ -155,7 +154,7 @@ public class MIPlugin extends Plugin {
* @return ICDISession
* @throws IOException
*/
public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit, IMITTY pty, IProgressMonitor monitor) throws IOException, MIException {
public Session createCSession(String gdb, File program, File cwd, String gdbinit, IMITTY pty, IProgressMonitor monitor) throws IOException, MIException {
if (gdb == null || gdb.length() == 0) {
gdb = GDB;
}
@ -219,7 +218,7 @@ public class MIPlugin extends Plugin {
* @return ICDISession
* @throws IOException
*/
public ICDISession createCSession(String gdb, File program, File core, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
public Session createCSession(String gdb, File program, File core, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
if (gdb == null || gdb.length() == 0) {
gdb = GDB;
}
@ -258,7 +257,7 @@ public class MIPlugin extends Plugin {
* @return ICDISession
* @throws IOException
*/
public ICDISession createCSession(String gdb, File program, int pid, String[] targetParams, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
public Session createCSession(String gdb, File program, int pid, String[] targetParams, File cwd, String gdbinit, IProgressMonitor monitor) throws IOException, MIException {
if (gdb == null || gdb.length() == 0) {
gdb = GDB;
}