1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Contine work on gdb/mi

This commit is contained in:
Alain Magloire 2002-07-30 02:46:51 +00:00
parent 799af8b586
commit 937ffc0057
25 changed files with 699 additions and 2 deletions

View file

@ -22,9 +22,9 @@ package org.eclipse.cdt.debug.mi.core.command;
public class MIBreakWatch extends MICommand
{
public MIBreakWatch (String[] opts, String expr) {
super("-break-insert", opts, new String[]{expr});
super("-break-watch", opts, new String[]{expr});
}
public MIBreakWatch (String expr) {
super("-break-insert", new String[]{expr});
super("-break-watch", new String[]{expr});
}
}

View file

@ -0,0 +1,71 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-disassemble
* [ -s START-ADDR -e END-ADDR ]
* | [ -f FILENAME -l LINENUM [ -n LINES ] ]
* -- MODE
*
*Where:
*
*`START-ADDR'
* is the beginning address (or `$pc')
*
*`END-ADDR'
* is the end address
*
*`FILENAME'
* is the name of the file to disassemble
*
*`LINENUM'
* is the line number to disassemble around
*
*`LINES'
* is the the number of disassembly lines to be produced. If it is
* -1, the whole function will be disassembled, in case no END-ADDR is
* specified. If END-ADDR is specified as a non-zero value, and
* LINES is lower than the number of disassembly lines between
* START-ADDR and END-ADDR, only LINES lines are displayed; if LINES
* is higher than the number of lines between START-ADDR and
* 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).
*
*Result
*......
*
* The output for each instruction is composed of four fields:
*
* * Address
*
* * Func-name
*
* * Offset
*
* * 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
*format.
*
*
*/
public class MIDataDisassemble extends MICommand
{
public MIDataDisassemble(String[] params) {
super("-data-disassemble", params);
}
public MIDataDisassemble(String[] opts, String[] params) {
super("-data-disassemble", opts, params);
}
}

View file

@ -0,0 +1,23 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-evaluate-expression EXPR
*
* Evaluate EXPR as an expression. The expression could contain an
*inferior function call. The function call will execute synchronously.
*If the expression contains spaces, it must be enclosed in double quotes.
*
*/
public class MIDataEvaluateExpression extends MICommand
{
public MIDataEvaluateExpression(String expr) {
super("-data-evaluate-expression", new String[]{expr});
}
}

View file

@ -0,0 +1,21 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-list-changed-registers
*
* Display a list of the registers that have changed.
*
*/
public class MIDataListChangedRegisters extends MICommand
{
public MIDataListChangedRegisters() {
super("-data-list-changed-registers" );
}
}

View file

@ -0,0 +1,37 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-list-register-names [ ( REGNO )+ ]
*
* Show a list of register names for the current target. If no
* arguments are given, it shows a list of the names of all the registers.
* If integer numbers are given as arguments, it will print a list of the
* names of the registers corresponding to the arguments. To ensure
* consistency between a register name and its number, the output list may
* include empty register names.
*
*/
public class MIDataListRegisterNames extends MICommand
{
public MIDataListRegisterNames() {
super("-data-list-register-names");
}
public MIDataListRegisterNames(int [] regnos) {
this();
if (regnos != null && regnos.length > 0) {
String[] array = new String[regnos.length];
for (int i = 0; i < regnos.length; i++) {
array[i] = Integer.toString(regnos[i]);
}
setParameters(array);
}
}
}

View file

@ -0,0 +1,71 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-list-register-values FMT [ ( REGNO )*]
*
* Display the registers' contents. FMT is the format according to
* which the registers' contents are to be returned, followed by an
* optional list of numbers specifying the registers to display. A
* missing list of numbers indicates that the contents of all the
* registers must be returned.
*
*/
public class MIDataListRegisterValues extends MICommand
{
public final static int HEXADECIMAL = 0;
public final static int OCTAL = 1;
public final static int BINARY = 2;
public final static int DECIMAL = 3;
public final static int RAW = 4;
public final static int NATURAL = 5;
public MIDataListRegisterValues(int fmt) {
this(fmt, null);
}
public MIDataListRegisterValues(int fmt, int [] regnos) {
super("-data-list-register-values");
String format = "x";
switch (fmt) {
case NATURAL:
format = "N";
break;
case RAW:
format = "r";
break;
case DECIMAL:
format = "d";
break;
case BINARY:
format = "t";
break;
case OCTAL:
format = "o";
break;
/*
case HEXADECIMAL:
default:
format = "x";
break;
*/
}
setOptions(new String[]{format});
if (regnos != null && regnos.length > 0) {
String[] array = new String[regnos.length];
for (int i = 0; i < regnos.length; i++) {
array[i] = Integer.toString(regnos[i]);
}
setParameters(array);
}
}
}

View file

@ -0,0 +1,57 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -data-read-memory [ -o BYTE-OFFSET ]
* ADDRESS WORD-FORMAT WORD-SIZE
* NR-ROWS NR-COLS [ ASCHAR ]
*
* where:
*
* `ADDRESS'
* An expression specifying the address of the first memory word to be
* read. Complex expressions containing embedded white space should
* be quoted using the C convention.
*
* `WORD-FORMAT'
* The format to be used to print the memory words. The notation is
* the same as for GDB's `print' command (*note Output formats:
* Output Formats.).
*
* `WORD-SIZE'
* The size of each memory word in bytes.
*
* `NR-ROWS'
* The number of rows in the output table.
*
* `NR-COLS'
* The number of columns in the output table.
*
* `ASCHAR'
* If present, indicates that each row should include an ASCII dump.
* The value of ASCHAR is used as a padding character when a byte is
* not a member of the printable ASCII character set (printable ASCII
* characters are those whose code is between 32 and 126,
* inclusively).
*
* `BYTE-OFFSET'
*
*
*/
public class MIDataReadMemory extends MICommand
{
public MIDataReadMemory(String[] params) {
super("-data-read-memory", params);
}
public MIDataReadMemory(String[] opts, String[] params) {
super("-data-read-memory", opts, params);
}
}

View file

@ -0,0 +1,23 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
*
* -environment-cd PATHDIR
*
* Set GDB's working directory.
*
*
*/
public class MIEnvironmentCD extends MICommand
{
public MIEnvironmentCD(String path) {
super("-environment-cd", new String[]{path});
}
}

View file

@ -0,0 +1,21 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -environment-directory PATHDIR
*
* Add directory PATHDIR to beginning of search path for source files.
*
*/
public class MIEnvironmentDirectory extends MICommand
{
public MIEnvironmentDirectory(String path) {
super("-environment-directory", new String[]{path});
}
}

View file

@ -0,0 +1,21 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -environment-pwd
*
* Show the current working directory.
*
*/
public class MIEnvironmentPWD extends MICommand
{
public MIEnvironmentPWD() {
super("-environment-pwd");
}
}

View file

@ -0,0 +1,21 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -environment-path ( PATHDIR )+
*
* Add directories PATHDIR to beginning of search path for object files.
*
*/
public class MIEnvironmentPath extends MICommand
{
public MIEnvironmentPath(String[] paths) {
super("-environment-path", paths);
}
}

View file

@ -0,0 +1,22 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-arguments ARGS
*
* Set the inferior program arguments, to be used in the next
* `-exec-run'.
*
*/
public class MIExecArguments extends MICommand
{
public MIExecArguments(String[] args) {
super("-exec-arguments", args);
}
}

View file

@ -0,0 +1,22 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-continue
*
* Asynchronous command. Resumes the execution of the inferior program
* until a breakpoint is encountered, or until the inferior exits.
*
*/
public class MIExecContinue extends MICommand
{
public MIExecContinue() {
super("-exec-continue");
}
}

View file

@ -0,0 +1,23 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-finish
*
* Asynchronous command. Resumes the execution of the inferior program
* until the current function is exited. Displays the results returned by
* the function.
*
*/
public class MIExecFinish extends MICommand
{
public MIExecFinish() {
super("-exec-finish");
}
}

View file

@ -0,0 +1,26 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-interrupt
*
* Asynchronous command. Interrupts the background execution of the
* target. Note how the token associated with the stop message is the one
* for the execution command that has been interrupted. The token for the
* interrupt itself only appears in the `^done' output. If the user is
* trying to interrupt a non-running program, an error message will be
* printed.
*
*/
public class MIExecInterrupt extends MICommand
{
public MIExecInterrupt() {
super("-exec-interrupt");
}
}

View file

@ -0,0 +1,22 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-next
*
* Asynchronous command. Resumes execution of the inferior program,
* stopping when the beginning of the next source line is reached.
*
*/
public class MIExecNext extends MICommand
{
public MIExecNext() {
super("-exec-next");
}
}

View file

@ -0,0 +1,24 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-next-instruction
*
* Asynchronous command. Executes one machine instruction. If the
* instruction is a function call continues until the function returns. If
* the program stops at an instruction in the middle of a source line, the
* address will be printed as well.
*
*/
public class MIExecNextInstruction extends MICommand
{
public MIExecNextInstruction() {
super("-exec-next-instruction");
}
}

View file

@ -0,0 +1,22 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-return
*
* Makes current function return immediately. Doesn't execute the
* inferior. Displays the new current frame.
*
*/
public class MIExecReturn extends MICommand
{
public MIExecReturn() {
super("-exec-return");
}
}

View file

@ -0,0 +1,23 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-run
*
* Asynchronous command. Starts execution of the inferior from the
* beginning. The inferior executes until either a breakpoint is
* encountered or the program exits.
*
*/
public class MIExecRun extends MICommand
{
public MIExecRun(String[] args) {
super("-exec-run", args);
}
}

View file

@ -0,0 +1,24 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-step
*
* Asynchronous command. Resumes execution of the inferior program,
* stopping when the beginning of the next source line is reached, if the
* next source line is not a function call. If it is, stop at the first
* instruction of the called function.
*
*/
public class MIExecStep extends MICommand
{
public MIExecStep() {
super("-exec-step");
}
}

View file

@ -0,0 +1,25 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-step-instruction
* Asynchronous command. Resumes the inferior which executes one
* machine instruction. The output, once GDB has stopped, will vary
* depending on whether we have stopped in the middle of a source line or
* not. In the former case, the address at which the program stopped will
* be printed as well.
*
*/
public class MIExecStepInstruction extends MICommand
{
public MIExecStepInstruction() {
super("-exec-step-instruction");
}
}

View file

@ -0,0 +1,29 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -exec-until [ LOCATION ]
*
* Asynchronous command. Executes the inferior until the LOCATION
* specified in the argument is reached. If there is no argument, the
* inferior executes until a source line greater than the current one is
* reached. The reason for stopping in this case will be
* `location-reached'.
*
*/
public class MIExecUntil extends MICommand
{
public MIExecUntil() {
super("-exec-until");
}
public MIExecUntil(String loc) {
super("-exec-until", new String[]{loc});
}
}

View file

@ -0,0 +1,25 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -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(String file) {
super("-file-exec-file", new String[]{file});
}
}

View file

@ -0,0 +1,23 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -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(String file) {
super("-file-symbol-file", new String[]{file});
}
}

View file

@ -0,0 +1,21 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.command;
/**
*
* -gdb-exit
*
* Exit GDB immediately.
*
*/
public class MIGDBExit extends MICommand
{
public MIGDBExit() {
super("-gdb-exit");
}
}