step command now takes a count argument.

This commit is contained in:
Daniel Beer 2010-03-20 15:22:58 +13:00
parent 0d71fcef38
commit 8c20233297
2 changed files with 17 additions and 5 deletions

15
main.c
View File

@ -455,8 +455,17 @@ static int cmd_set(char **arg)
static int cmd_step(char **arg)
{
if (msp430_dev->control(DEVICE_CTL_STEP) < 0)
return -1;
char *count_text = get_arg(arg);
int count = 1;
if (count_text)
count = atoi(count_text);
while (count > 0) {
if (msp430_dev->control(DEVICE_CTL_STEP) < 0)
return -1;
count--;
}
return cmd_regs(NULL);
}
@ -661,7 +670,7 @@ static const struct command all_commands[] = {
"set <register> <value>\n"
" Change the value of a CPU register.\n"},
{"step", cmd_step,
"step\n"
"step [count]\n"
" Single-step the CPU, and display the register state.\n"},
{"syms", cmd_syms,
"syms <filename>\n"

View File

@ -143,10 +143,13 @@ Alter the value of a register. Registers are specified as numbers from
0 through 15. Any leading non-numeric characters are ignored (so a
register may be specified as, for example, "R12"). The value argument
is an address expression.
.IP "step"
Step the CPU through a single instruction. After stepping, the new
.IP "step [\fIcount\fR]"
Step the CPU through one or more instructions. After stepping, the new
register values are displayed, as well as a disassembly of the
instructions at the address selected by the program counter.
An optional count can be specified to step multiple times. If no
argument is given, the CPU steps once.
.IP "syms \fIfilename\fR"
Load symbols from the specified file and add them to the symbol table.
The file format will be auto-detected and may be either ELF32 or a