mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 357073: MIDataDisassemble should support modes 2 and 3 added in GDB 7.3
This commit is contained in:
parent
ae0cde8d3a
commit
6d7a8182a0
5 changed files with 94 additions and 32 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.debug.mi.core; singleton:=true
|
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-Activator: org.eclipse.cdt.debug.mi.core.MIPlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* ENEA Software AB - CLI command extension - fix for bug 190277
|
* 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;
|
package org.eclipse.cdt.debug.mi.core.command;
|
||||||
|
@ -88,10 +89,20 @@ public class CommandFactory {
|
||||||
return new MIDataDisassemble(getMIVersion(), start, end, mixed);
|
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) {
|
public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, boolean mixed) {
|
||||||
return new MIDataDisassemble(getMIVersion(), file, linenum, lines, 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) {
|
public MIDataEvaluateExpression createMIDataEvaluateExpression(String expression) {
|
||||||
return new MIDataEvaluateExpression(getMIVersion(), expression);
|
return new MIDataEvaluateExpression(getMIVersion(), expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* 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;
|
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.
|
* END-ADDR, only the lines up to END-ADDR are displayed.
|
||||||
*
|
*
|
||||||
*`MODE'
|
*`MODE'
|
||||||
* is either 0 (meaning only disassembly) or 1 (meaning mixed source
|
* - 0 disassembly
|
||||||
* and 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
|
*Result
|
||||||
*......
|
*......
|
||||||
|
@ -64,32 +68,48 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
||||||
* * Instruction
|
* * Instruction
|
||||||
*
|
*
|
||||||
* Note that whatever included in the instruction field, is not
|
* 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.
|
*format.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MIDataDisassemble extends MICommand
|
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) {
|
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$
|
super(miVersion, "-data-disassemble"); //$NON-NLS-1$
|
||||||
setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$
|
setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
String mixed = "0"; //$NON-NLS-1$
|
|
||||||
if (mode) {
|
if (mode >= MIN_MODE && mode <= MAX_MODE) {
|
||||||
mixed = "1"; //$NON-NLS-1$
|
setParameters(new String[] { Integer.toString(mode) });
|
||||||
}
|
} else {
|
||||||
setParameters(new String[]{mixed});
|
throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIDataDisassemble(String miVersion, String file, int linenum, int lines, boolean 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$
|
super(miVersion, "-data-disassemble"); //$NON-NLS-1$
|
||||||
setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$
|
setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$
|
Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$
|
||||||
String mixed = "0"; //$NON-NLS-1$
|
|
||||||
if (mode) {
|
if (mode >= MIN_MODE && mode <= MAX_MODE) {
|
||||||
mixed = "1"; //$NON-NLS-1$
|
setParameters(new String[] { Integer.toString(mode) });
|
||||||
}
|
} else {
|
||||||
setParameters(new String[]{mixed});
|
throw new IllegalArgumentException(MODE_OUT_OF_RANGE + mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIDataDisassembleInfo getMIDataDisassembleInfo() throws MIException {
|
public MIDataDisassembleInfo getMIDataDisassembleInfo() throws MIException {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
||||||
* Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306)
|
* Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306)
|
||||||
* Abeer Bagul - Support for -exec-arguments (bug 337687)
|
* 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;
|
package org.eclipse.cdt.dsf.mi.service.command;
|
||||||
|
@ -347,10 +348,20 @@ public class CommandFactory {
|
||||||
return new MIDataDisassemble(ctx, start, end, mode);
|
return new MIDataDisassemble(ctx, start, end, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 4.1 */
|
||||||
|
public ICommand<MIDataDisassembleInfo> createMIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, int mode) {
|
||||||
|
return new MIDataDisassemble(ctx, start, end, mode);
|
||||||
|
}
|
||||||
|
|
||||||
public ICommand<MIDataDisassembleInfo> createMIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, boolean mode) {
|
public ICommand<MIDataDisassembleInfo> createMIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, boolean mode) {
|
||||||
return new MIDataDisassemble(ctx, file, linenum, lines, mode);
|
return new MIDataDisassemble(ctx, file, linenum, lines, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 4.1 */
|
||||||
|
public ICommand<MIDataDisassembleInfo> createMIDataDisassemble(IDisassemblyDMContext ctx, String file, int linenum, int lines, int mode) {
|
||||||
|
return new MIDataDisassemble(ctx, file, linenum, lines, mode);
|
||||||
|
}
|
||||||
|
|
||||||
public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) {
|
public ICommand<MIDataEvaluateExpressionInfo> createMIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) {
|
||||||
return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(ctx, expr);
|
return new MIDataEvaluateExpression<MIDataEvaluateExpressionInfo>(ctx, expr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* Ericsson - Modified for DSF Reference 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;
|
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.
|
* END-ADDR, only the lines up to END-ADDR are displayed.
|
||||||
*
|
*
|
||||||
* '-- MODE'
|
* '-- MODE'
|
||||||
* is either 0 (meaning only disassembly) or 1 (meaning mixed source
|
* - 0 disassembly
|
||||||
* and 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<MIDataDisassembleInfo> {
|
public class MIDataDisassemble extends MICommand<MIDataDisassembleInfo> {
|
||||||
|
|
||||||
public MIDataDisassemble(IDisassemblyDMContext ctx, String start, String end, boolean mode) {
|
private static final int MIN_MODE = 0;
|
||||||
super(ctx, "-data-disassemble"); //$NON-NLS-1$
|
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$
|
setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
String mixed = "0"; //$NON-NLS-1$
|
|
||||||
if (mode) {
|
if (mode >= MIN_MODE && mode <= MAX_MODE) {
|
||||||
mixed = "1"; //$NON-NLS-1$
|
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) {
|
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$
|
super(ctx, "-data-disassemble"); //$NON-NLS-1$
|
||||||
setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$
|
setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$
|
Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$
|
||||||
String mixed = "0"; //$NON-NLS-1$
|
|
||||||
if (mode) {
|
if (mode >= MIN_MODE && mode <= MAX_MODE) {
|
||||||
mixed = "1"; //$NON-NLS-1$
|
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
|
* So override the MICommand
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue