mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
2004-11-19 Alain Magloire
Fix for 78816 * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
This commit is contained in:
parent
3051c780f3
commit
9a38e1a718
2 changed files with 13 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-11-19 Alain Magloire
|
||||||
|
Fix for 78816
|
||||||
|
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
|
||||||
|
|
||||||
2004-11-19 Alain Magloire
|
2004-11-19 Alain Magloire
|
||||||
|
|
||||||
Clear the confusion about sublist of stackframes.
|
Clear the confusion about sublist of stackframes.
|
||||||
|
|
|
@ -18,8 +18,8 @@ import java.text.MessageFormat;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
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;
|
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.command.MIStackListFrames;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MITargetAttach;
|
import org.eclipse.cdt.debug.mi.core.command.MITargetAttach;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
|
import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||||
|
@ -191,22 +191,23 @@ public class MIPlugin extends Plugin {
|
||||||
pgdb.destroy();
|
pgdb.destroy();
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
// Try to detect if we have been attach via "target remote localhost:port"
|
// Try to detect if we have been attach/connected via "target remote localhost:port"
|
||||||
// and set the state to be suspended.
|
// or "attach" and set the state to be suspended.
|
||||||
try {
|
try {
|
||||||
CLICommand cmd = new CLICommand("info remote-process"); //$NON-NLS-1$
|
CommandFactory factory = session.getCommandFactory();
|
||||||
session.postCommand(cmd);
|
MIStackListFrames frames = factory.createMIStackListFrames();
|
||||||
MIInfo info = cmd.getMIInfo();
|
session.postCommand(frames);
|
||||||
|
MIInfo info = frames.getMIInfo();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
pgdb.destroy();
|
pgdb.destroy();
|
||||||
throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
|
throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
//@@@ We have to manually set the suspended state when we attach
|
//@@@ We have to manually set the suspended state since we have some stackframes
|
||||||
session.getMIInferior().setSuspended();
|
session.getMIInferior().setSuspended();
|
||||||
session.getMIInferior().update();
|
session.getMIInferior().update();
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
// If an exception is thrown that means ok
|
// If an exception is thrown that means ok
|
||||||
// we did not attach to any target.
|
// we did not attach/connect to any target.
|
||||||
}
|
}
|
||||||
return new Session(session, false);
|
return new Session(session, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue