diff --git a/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF index d3e6a6a24bc..6607628edb9 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.debug.mi.core; singleton:=true -Bundle-Version: 7.1.100.qualifier +Bundle-Version: 7.2.0.qualifier Bundle-Activator: org.eclipse.cdt.debug.mi.core.MIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java index 113bb1d6f92..61ed6871aff 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 QNX Software Systems and others. + * Copyright (c) 2000, 2011 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 @@ -8,6 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation * ENEA Software AB - CLI command extension - fix for bug 190277 + * Marc Khouzam (Ericsson) - New methods for new MIDataDisassemble (Bug 357073) *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.command; @@ -88,10 +89,20 @@ public class CommandFactory { return new MIDataDisassemble(getMIVersion(), start, end, mixed); } + /** @since 7.2 */ + public MIDataDisassemble createMIDataDisassemble(String start, String end, int mode) { + return new MIDataDisassemble(getMIVersion(), start, end, mode); + } + public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, boolean mixed) { return new MIDataDisassemble(getMIVersion(), file, linenum, lines, mixed); } - + + /** @since 7.2 */ + public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, int mode) { + return new MIDataDisassemble(getMIVersion(), file, linenum, lines, mode); + } + public MIDataEvaluateExpression createMIDataEvaluateExpression(String expression) { return new MIDataEvaluateExpression(getMIVersion(), expression); } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java index e112576e753..6ec648ee2eb 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2011 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 @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Daniel Thomas (Broadcom corp.) - Added support for mode 2 and 3 (Bug 357073) *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.command; @@ -47,8 +48,11 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput; * END-ADDR, only the lines up to END-ADDR are displayed. * *`MODE' - * is either 0 (meaning only disassembly) or 1 (meaning mixed source - * and disassembly). + * - 0 disassembly + * - 1 mixed source and disassembly + * - 2 disassembly with raw opcodes + * - 3 mixed source and disassembly with raw opcodes + * Note: Modes 2 and 3 are only available starting with GDB 7.3 * *Result *...... @@ -64,32 +68,48 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput; * * Instruction * * Note that whatever included in the instruction field, is not - *manipulated directely by GDB/MI, i.e. it is not possible to adjust its + *manipulated directly by GDB/MI, i.e. it is not possible to adjust its *format. * * */ public class MIDataDisassemble extends MICommand { + private static final int MIN_MODE = 0; + private static final int MAX_MODE = 3; + private static final String MODE_OUT_OF_RANGE = "Mode out of range: "; //$NON-NLS-1$ + public MIDataDisassemble(String miVersion, String start, String end, boolean mode) { + this(miVersion, start, end, mode ? 1 : 0); + } + + /** @since 7.2 */ + public MIDataDisassemble(String miVersion, String start, String end, int mode) { super(miVersion, "-data-disassemble"); //$NON-NLS-1$ setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$ - String mixed = "0"; //$NON-NLS-1$ - if (mode) { - mixed = "1"; //$NON-NLS-1$ - } - setParameters(new String[]{mixed}); + + if (mode >= MIN_MODE && mode <= MAX_MODE) { + setParameters(new String[] { Integer.toString(mode) }); + } else { + throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode); + } } public MIDataDisassemble(String miVersion, String file, int linenum, int lines, boolean mode) { + this(miVersion, file, linenum, lines, mode ? 1 : 0); + } + + /** @since 7.2 */ + public MIDataDisassemble(String miVersion, String file, int linenum, int lines, int mode) { super(miVersion, "-data-disassemble"); //$NON-NLS-1$ setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$ Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$ - String mixed = "0"; //$NON-NLS-1$ - if (mode) { - mixed = "1"; //$NON-NLS-1$ - } - setParameters(new String[]{mixed}); + + if (mode >= MIN_MODE && mode <= MAX_MODE) { + setParameters(new String[] { Integer.toString(mode) }); + } else { + throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode); + } } public MIDataDisassembleInfo getMIDataDisassembleInfo() throws MIException { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java index cc7d731c265..64d5612ff6b 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java @@ -14,6 +14,7 @@ * Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121) * Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306) * Abeer Bagul - Support for -exec-arguments (bug 337687) + * Marc Khouzam (Ericsson) - New methods for new MIDataDisassemble (Bug 357073) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service.command; @@ -347,10 +348,20 @@ public class CommandFactory { return new MIDataDisassemble(ctx, start, end, mode); } + /** @since 4.1 */ + public ICommand createMIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, int mode) { + return new MIDataDisassemble(ctx, start, end, mode); + } + public ICommand createMIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, boolean mode) { return new MIDataDisassemble(ctx, file, linenum, lines, mode); } + /** @since 4.1 */ + public ICommand createMIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, int mode) { + return new MIDataDisassemble(ctx, file, linenum, lines, mode); + } + public ICommand createMIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) { return new MIDataEvaluateExpression(ctx, expr); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java index 7dd40aa7307..e8ad471a1b7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDataDisassemble.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 QNX Software Systems and others. + * Copyright (c) 2000, 2011 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 @@ -8,6 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation * Ericsson - Modified for DSF Reference Implementation + * Daniel Thomas (Broadcom corp.) - Added support for mode 2 and 3 (Bug 357073) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service.command.commands; @@ -46,35 +47,54 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput; * END-ADDR, only the lines up to END-ADDR are displayed. * * '-- MODE' - * is either 0 (meaning only disassembly) or 1 (meaning mixed source - * and disassembly). + * - 0 disassembly + * - 1 mixed source and disassembly + * - 2 disassembly with raw opcodes + * - 3 mixed source and disassembly with raw opcodes + * Note: Modes 2 and 3 are only available starting with GDB 7.3 */ public class MIDataDisassemble extends MICommand { - public MIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, boolean mode) { - super(ctx, "-data-disassemble"); //$NON-NLS-1$ + private static final int MIN_MODE = 0; + private static final int MAX_MODE = 3; + private static final String MODE_OUT_OF_RANGE = "Mode out of range: "; //$NON-NLS-1$ + + public MIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, boolean mode) { + this(ctx, start, end, mode ? 1 : 0); + } + + /** @since 4.1 */ + public MIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, int mode) { + super(ctx, "-data-disassemble"); //$NON-NLS-1$ setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$ - String mixed = "0"; //$NON-NLS-1$ - if (mode) { - mixed = "1"; //$NON-NLS-1$ + + if (mode >= MIN_MODE && mode <= MAX_MODE) { + setParameters(new String[] { Integer.toString(mode) }); + } else { + throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode); } - setParameters(new String[]{mixed}); - } + } public MIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, boolean mode) { + this(ctx, file, linenum, lines, mode ? 1 : 0); + } + + /** @since 4.1 */ + public MIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, int mode) { super(ctx, "-data-disassemble"); //$NON-NLS-1$ setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$ Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$ - String mixed = "0"; //$NON-NLS-1$ - if (mode) { - mixed = "1"; //$NON-NLS-1$ + + if (mode >= MIN_MODE && mode <= MAX_MODE) { + setParameters(new String[] { Integer.toString(mode) }); + } else { + throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode); } - setParameters(new String[]{mixed}); } /* - * GDB the -data-disassemble uses "--" as a separator wit only the MODE + * -data-disassemble uses "--" as a separator with only the MODE * So override the MICommand */ @Override