From 9a38e1a718f0952c987decc24e79dd0927d16de1 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Thu, 18 Nov 2004 17:59:42 +0000 Subject: [PATCH] 2004-11-19 Alain Magloire Fix for 78816 * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 4 ++++ .../org/eclipse/cdt/debug/mi/core/MIPlugin.java | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 62705be86ab..ffbedea4fb6 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -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 Clear the confusion about sublist of stackframes. diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java index 3d10d6bf994..269100e8238 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java @@ -18,8 +18,8 @@ import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; 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.MIStackListFrames; 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.output.MIInfo; @@ -191,22 +191,23 @@ public class MIPlugin extends Plugin { pgdb.destroy(); throw e; } - // Try to detect if we have been attach via "target remote localhost:port" - // and set the state to be suspended. + // Try to detect if we have been attach/connected via "target remote localhost:port" + // or "attach" and set the state to be suspended. try { - CLICommand cmd = new CLICommand("info remote-process"); //$NON-NLS-1$ - session.postCommand(cmd); - MIInfo info = cmd.getMIInfo(); + CommandFactory factory = session.getCommandFactory(); + MIStackListFrames frames = factory.createMIStackListFrames(); + session.postCommand(frames); + MIInfo info = frames.getMIInfo(); if (info == null) { pgdb.destroy(); 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().update(); } catch (MIException e) { // 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); }