diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java index aed438f0031..609311e9e34 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java @@ -32,6 +32,8 @@ import org.eclipse.dd.mi.service.command.commands.MIBreakInsert; import org.eclipse.dd.mi.service.command.commands.MICommand; import org.eclipse.dd.mi.service.command.commands.MIExecContinue; import org.eclipse.dd.mi.service.command.commands.MIExecRun; +import org.eclipse.dd.mi.service.command.commands.MIFileExecFile; +import org.eclipse.dd.mi.service.command.commands.MIFileSymbolFile; import org.eclipse.dd.mi.service.command.commands.MITargetSelect; import org.eclipse.dd.mi.service.command.output.MIBreakInsertInfo; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -51,6 +53,26 @@ public class FinalLaunchSequence extends Sequence { requestMonitor.done(); }}, + /* + * Specify the executable file to be debugged. + */ + new Step() { @Override + public void execute(RequestMonitor requestMonitor) { + fCommandControl.queueCommand( + new MIFileExecFile(fCommandControl.getControlDMContext(), + fCommandControl.getExecutablePath().toOSString()), + new DataRequestMonitor(getExecutor(), requestMonitor)); + }}, + /* + * Read symbol table. + */ + new Step() { @Override + public void execute(RequestMonitor requestMonitor) { + fCommandControl.queueCommand( + new MIFileSymbolFile(fCommandControl.getControlDMContext(), + fCommandControl.getExecutablePath().toOSString()), + new DataRequestMonitor(getExecutor(), requestMonitor)); + }}, /* * Setup the source paths */ diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java index f5003ef691c..8dc218b1a26 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java @@ -147,9 +147,10 @@ public class ServicesLaunchSequence extends Sequence { } private IPath getGDBPath() { - IPath retVal = new Path("gdb.exe"); //$NON-NLS-1$ + IPath retVal = new Path(IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT); try { - retVal = new Path( fLaunch.getLaunchConfiguration().getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT ) ); + retVal = new Path(fLaunch.getLaunchConfiguration().getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, + IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT)); } catch (CoreException e) { } return retVal; diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java index ff2fd1e067e..09eee80da61 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java @@ -375,11 +375,8 @@ public class GDBControl extends AbstractMIControl { List commandList = new ArrayList(); commandList.add(fGdbPath.toOSString()); - if (fExecPath != null) { - commandList.add("--interpreter"); //$NON-NLS-1$ - commandList.add("mi"); //$NON-NLS-1$ - commandList.add(fExecPath.toOSString()); - } + commandList.add("--interpreter"); //$NON-NLS-1$ + commandList.add("mi"); //$NON-NLS-1$ String[] commandLine = commandList.toArray(new String[commandList.size()]); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java new file mode 100644 index 00000000000..97728cb4b6d --- /dev/null +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + * Ericsson - Modified for handling of contexts + *******************************************************************************/ + +package org.eclipse.dd.mi.service.command.commands; + +import org.eclipse.dd.mi.service.command.MIControlDMContext; +import org.eclipse.dd.mi.service.command.output.MIInfo; + + +/** + * -file-exec-file [FILE] + * + * Specify the executable file to be debugged. Unlike `-file-exec-and-symbols', + * the symbol table is not read from this file. If used without argument, GDB + * clears the information about the executable file. No output is produced, + * except a completion notification. + */ +public class MIFileExecFile extends MICommand +{ + public MIFileExecFile(MIControlDMContext dmc, String file) { + super(dmc, "-file-exec-file", new String[] {file}); //$NON-NLS-1$ + } + + public MIFileExecFile(MIControlDMContext dmc) { + super(dmc, "-file-exec-file"); //$NON-NLS-1$ + } +} diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java new file mode 100644 index 00000000000..83ab8883f70 --- /dev/null +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + * Ericsson - Modified for handling of contexts + *******************************************************************************/ + +package org.eclipse.dd.mi.service.command.commands; + +import org.eclipse.dd.mi.service.command.MIControlDMContext; +import org.eclipse.dd.mi.service.command.output.MIInfo; + + +/** + * -file-symbol-file [FILE] + * + * Read symbol table info from the specified file argument. When used without + * arguments, clears GDB's symbol table info. No output is produced, except + * for a completion notification. + */ +public class MIFileSymbolFile extends MICommand +{ + public MIFileSymbolFile(MIControlDMContext dmc, String file) { + super(dmc, "-file-symbol-file", new String[] {file}); //$NON-NLS-1$ + } + + public MIFileSymbolFile(MIControlDMContext dmc) { + super(dmc, "-file-symbol-file"); //$NON-NLS-1$ + } +}