Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorDaniel Thomas2011-09-12 09:37:11 -0400
committerMarc Khouzam2011-09-12 09:37:11 -0400
commit6d7a8182a01e264b6726f48e9bf29e9bd774d753 (patch)
tree7cf83dd70550939050dd63b64f5bbe616346e21f /debug
parentae0cde8d3af6c4b723a86f62fba2d24ef4c179c0 (diff)
downloadorg.eclipse.cdt-6d7a8182a01e264b6726f48e9bf29e9bd774d753.tar.gz
org.eclipse.cdt-6d7a8182a01e264b6726f48e9bf29e9bd774d753.tar.xz
org.eclipse.cdt-6d7a8182a01e264b6726f48e9bf29e9bd774d753.zip
Bug 357073: MIDataDisassemble should support modes 2 and 3 added in GDB 7.3
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF2
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java15
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java48
3 files changed, 48 insertions, 17 deletions
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 d3e6a6a24b..6607628edb 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 113bb1d6f9..61ed6871af 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 e112576e75..6ec648ee2e 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 {

Back to the top