1. implemented 'set register <name>=<expr>' command, old style 'registers <name>=<exp> command' removed, now 'r|reg|regs|registers' command shows CPU registers contents (same as 'info cpu')

2. new command 'u|disasm|disassemble mode-switch' - switch between Intel and AT&T disasm syntax

3. new command 'u|disasm|disassemble size=n' should be used instead of old 'set $disassembler_size=n'

4. 'h' is a new alias for 'help' command
This commit is contained in:
Stanislav Shwartsman 2006-01-24 21:37:37 +00:00
parent 557c15699f
commit d257f548b9
8 changed files with 1813 additions and 1756 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.38 2006-01-24 19:23:42 sshwarts Exp $
// $Id: dbg_main.cc,v 1.39 2006-01-24 21:37:36 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1838,10 +1838,23 @@ void bx_dbg_info_bpoints_command(void)
#endif
}
void bx_dbg_set_command(char *p1, char *p2, char *p3)
void bx_dbg_set_auto_disassemble(bx_bool enable)
{
dbg_printf("Error: %s %s %s: command 'set' not implemented yet.\n",
p1, p2, p3);
bx_debugger.auto_disassemble = enable;
}
void bx_dbg_set_disassemble_size(unsigned size)
{
if ( (size!=16) && (size!=32) && (size!=64) && (size!=0) ) {
dbg_printf("Error: disassemble size must be 16/32 or 64.\n");
return;
}
bx_debugger.disassemble_size = size;
}
void bx_dbg_disassemble_switch_mode()
{
bx_disassemble.toggle_syntax_mode();
}
void bx_dbg_take_command(char *what, unsigned n)
@ -2425,15 +2438,7 @@ void bx_dbg_set_symbol_command(char *symbol, Bit32u val)
return;
}
else if ( !strcmp(symbol, "auto_disassemble") ) {
bx_debugger.auto_disassemble = (val > 0);
return;
}
else if ( !strcmp(symbol, "disassemble_size") ) {
if ( (val!=16) && (val!=32) && (val!=0) ) {
dbg_printf("Error: disassemble_size must be 16 or 32.\n");
return;
}
bx_debugger.disassemble_size = val;
bx_dbg_set_auto_disassemble(val != 0);
return;
}
else {
@ -2756,16 +2761,16 @@ void bx_dbg_instrument_command(const char *comm)
{
#if BX_INSTRUMENTATION
if ( !strcmp(comm, "start") ) {
BX_INSTR_START ();
BX_INSTR_START();
}
else if ( !strcmp(comm, "stop") ) {
BX_INSTR_STOP ();
BX_INSTR_STOP();
}
else if ( !strcmp(comm, "reset") ) {
BX_INSTR_RESET (dbg_cpu);
BX_INSTR_RESET(dbg_cpu);
}
else if ( !strcmp(comm, "print") ) {
BX_INSTR_PRINT ();
BX_INSTR_PRINT();
}
else {
dbg_printf("Error: command instrument %s not implemented.\n", comm);
@ -3663,8 +3668,8 @@ void bx_dbg_info_ivt_command(bx_num_range r)
void bx_dbg_print_help(void)
{
dbg_printf("help - show list of debugger commands\n");
dbg_printf("help command - show short command description\n");
dbg_printf("h|help - show list of debugger commands\n");
dbg_printf("h|help command - show short command description\n");
dbg_printf("-*- Debugger control -*-\n");
dbg_printf(" help, q|quit|exit, set, instrument, show, trace-on, trace-off,\n");
dbg_printf(" trace-reg-on, trace-reg-off, record, playback,\n");
@ -3676,7 +3681,7 @@ void bx_dbg_print_help(void)
dbg_printf(" bpe, bpd, d|del|delete\n");
dbg_printf("-*- CPU and memory contents -*-\n");
dbg_printf(" x, xp, u|disasm|disassemble, r|reg|regs|registers, setpmem, crc, info,\n");
dbg_printf(" dump_cpu, set_cpu, ptime, print-stack, watch, unwatch, ?|calc\n");
dbg_printf(" set, dump_cpu, set_cpu, ptime, print-stack, watch, unwatch, ?|calc\n");
}
void bx_dbg_calc_command(Bit64u value)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: debug.h,v 1.9 2006-01-24 19:03:53 sshwarts Exp $
// $Id: debug.h,v 1.10 2006-01-24 21:37:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -130,7 +130,9 @@ void bx_dbg_watch(int read, Bit32u address);
void bx_dbg_unwatch(int read, Bit32u address);
void bx_dbg_continue_command(void);
void bx_dbg_stepN_command(bx_dbg_icount_t count);
void bx_dbg_set_command(char *p1, char *p2, char *p3);
void bx_dbg_set_auto_disassemble(bx_bool enable);
void bx_dbg_disassemble_switch_mode(void);
void bx_dbg_set_disassemble_size(unsigned size);
void bx_dbg_del_breakpoint_command(unsigned handle);
void bx_dbg_en_dis_breakpoint_command(unsigned handle, bx_bool enable);
bx_bool bx_dbg_en_dis_pbreak (unsigned handle, bx_bool enable);

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
%{
/////////////////////////////////////////////////////////////////////////
// $Id: lexer.l,v 1.7 2006-01-24 19:03:54 sshwarts Exp $
// $Id: lexer.l,v 1.8 2006-01-24 21:37:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
@ -25,7 +25,6 @@ static unsigned lex_input_size = 0;
%%
<*>[ \t]+ ; // eat up whitespace
set { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET); }
dis { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIS); }
on { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ON); }
off { bxlval.sval = strdup(bxtext); return(BX_TOKEN_OFF); }
crc { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CRC); }
@ -99,6 +98,8 @@ trace-on { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEON); }
trace-off { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEOFF); }
trace-reg-on { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGON); }
trace-reg-off { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGOFF); }
switch-mode { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SWITCH_MODE); }
size { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SIZE); }
ptime { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PTIME); }
sb { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP); }
sba { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP_ABSOLUTE); }
@ -162,7 +163,7 @@ fs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); }
gs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GS); }
flags|eflags { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FLAGS); }
force-check { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALWAYS_CHECK); }
help { bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); }
h|help { bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); }
\? |
calc { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CALC); }
<EXAMINE>\/[0-9]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); }

File diff suppressed because it is too large Load Diff

View File

@ -94,68 +94,69 @@
BX_TOKEN_IRQ = 320,
BX_TOKEN_DUMP_CPU = 321,
BX_TOKEN_SET_CPU = 322,
BX_TOKEN_DIS = 323,
BX_TOKEN_ON = 324,
BX_TOKEN_OFF = 325,
BX_TOKEN_DISASSEMBLE = 326,
BX_TOKEN_INSTRUMENT = 327,
BX_TOKEN_START = 328,
BX_TOKEN_STOP = 329,
BX_TOKEN_RESET = 330,
BX_TOKEN_PRINT = 331,
BX_TOKEN_LOADER = 332,
BX_TOKEN_STRING = 333,
BX_TOKEN_DOIT = 334,
BX_TOKEN_CRC = 335,
BX_TOKEN_TRACEON = 336,
BX_TOKEN_TRACEOFF = 337,
BX_TOKEN_PTIME = 338,
BX_TOKEN_TIMEBP_ABSOLUTE = 339,
BX_TOKEN_TIMEBP = 340,
BX_TOKEN_RECORD = 341,
BX_TOKEN_PLAYBACK = 342,
BX_TOKEN_MODEBP = 343,
BX_TOKEN_PRINT_STACK = 344,
BX_TOKEN_WATCH = 345,
BX_TOKEN_UNWATCH = 346,
BX_TOKEN_READ = 347,
BX_TOKEN_WRITE = 348,
BX_TOKEN_SHOW = 349,
BX_TOKEN_LOAD_SYMBOLS = 350,
BX_TOKEN_SYMBOLS = 351,
BX_TOKEN_LIST_SYMBOLS = 352,
BX_TOKEN_GLOBAL = 353,
BX_TOKEN_WHERE = 354,
BX_TOKEN_PRINT_STRING = 355,
BX_TOKEN_DIFF_MEMORY = 356,
BX_TOKEN_SYNC_MEMORY = 357,
BX_TOKEN_SYNC_CPU = 358,
BX_TOKEN_FAST_FORWARD = 359,
BX_TOKEN_PHY_2_LOG = 360,
BX_TOKEN_NUMERIC = 361,
BX_TOKEN_LONG_NUMERIC = 362,
BX_TOKEN_INFO_ADDRESS = 363,
BX_TOKEN_NE2000 = 364,
BX_TOKEN_PIC = 365,
BX_TOKEN_PAGE = 366,
BX_TOKEN_CS = 367,
BX_TOKEN_ES = 368,
BX_TOKEN_SS = 369,
BX_TOKEN_DS = 370,
BX_TOKEN_FS = 371,
BX_TOKEN_GS = 372,
BX_TOKEN_FLAGS = 373,
BX_TOKEN_ALWAYS_CHECK = 374,
BX_TOKEN_TRACEREGON = 375,
BX_TOKEN_TRACEREGOFF = 376,
BX_TOKEN_HELP = 377,
BX_TOKEN_CALC = 378,
BX_TOKEN_VGA = 379,
BX_TOKEN_RSHIFT = 380,
BX_TOKEN_LSHIFT = 381,
BX_TOKEN_IVT = 382,
NEG = 383,
NOT = 384
BX_TOKEN_ON = 323,
BX_TOKEN_OFF = 324,
BX_TOKEN_DISASSEMBLE = 325,
BX_TOKEN_INSTRUMENT = 326,
BX_TOKEN_START = 327,
BX_TOKEN_STOP = 328,
BX_TOKEN_RESET = 329,
BX_TOKEN_PRINT = 330,
BX_TOKEN_LOADER = 331,
BX_TOKEN_STRING = 332,
BX_TOKEN_DOIT = 333,
BX_TOKEN_CRC = 334,
BX_TOKEN_TRACEON = 335,
BX_TOKEN_TRACEOFF = 336,
BX_TOKEN_SWITCH_MODE = 337,
BX_TOKEN_SIZE = 338,
BX_TOKEN_PTIME = 339,
BX_TOKEN_TIMEBP_ABSOLUTE = 340,
BX_TOKEN_TIMEBP = 341,
BX_TOKEN_RECORD = 342,
BX_TOKEN_PLAYBACK = 343,
BX_TOKEN_MODEBP = 344,
BX_TOKEN_PRINT_STACK = 345,
BX_TOKEN_WATCH = 346,
BX_TOKEN_UNWATCH = 347,
BX_TOKEN_READ = 348,
BX_TOKEN_WRITE = 349,
BX_TOKEN_SHOW = 350,
BX_TOKEN_LOAD_SYMBOLS = 351,
BX_TOKEN_SYMBOLS = 352,
BX_TOKEN_LIST_SYMBOLS = 353,
BX_TOKEN_GLOBAL = 354,
BX_TOKEN_WHERE = 355,
BX_TOKEN_PRINT_STRING = 356,
BX_TOKEN_DIFF_MEMORY = 357,
BX_TOKEN_SYNC_MEMORY = 358,
BX_TOKEN_SYNC_CPU = 359,
BX_TOKEN_FAST_FORWARD = 360,
BX_TOKEN_PHY_2_LOG = 361,
BX_TOKEN_NUMERIC = 362,
BX_TOKEN_LONG_NUMERIC = 363,
BX_TOKEN_INFO_ADDRESS = 364,
BX_TOKEN_NE2000 = 365,
BX_TOKEN_PIC = 366,
BX_TOKEN_PAGE = 367,
BX_TOKEN_CS = 368,
BX_TOKEN_ES = 369,
BX_TOKEN_SS = 370,
BX_TOKEN_DS = 371,
BX_TOKEN_FS = 372,
BX_TOKEN_GS = 373,
BX_TOKEN_FLAGS = 374,
BX_TOKEN_ALWAYS_CHECK = 375,
BX_TOKEN_TRACEREGON = 376,
BX_TOKEN_TRACEREGOFF = 377,
BX_TOKEN_HELP = 378,
BX_TOKEN_CALC = 379,
BX_TOKEN_VGA = 380,
BX_TOKEN_RSHIFT = 381,
BX_TOKEN_LSHIFT = 382,
BX_TOKEN_IVT = 383,
NEG = 384,
NOT = 385
};
#endif
#define BX_TOKEN_REG_AL 258
@ -223,68 +224,69 @@
#define BX_TOKEN_IRQ 320
#define BX_TOKEN_DUMP_CPU 321
#define BX_TOKEN_SET_CPU 322
#define BX_TOKEN_DIS 323
#define BX_TOKEN_ON 324
#define BX_TOKEN_OFF 325
#define BX_TOKEN_DISASSEMBLE 326
#define BX_TOKEN_INSTRUMENT 327
#define BX_TOKEN_START 328
#define BX_TOKEN_STOP 329
#define BX_TOKEN_RESET 330
#define BX_TOKEN_PRINT 331
#define BX_TOKEN_LOADER 332
#define BX_TOKEN_STRING 333
#define BX_TOKEN_DOIT 334
#define BX_TOKEN_CRC 335
#define BX_TOKEN_TRACEON 336
#define BX_TOKEN_TRACEOFF 337
#define BX_TOKEN_PTIME 338
#define BX_TOKEN_TIMEBP_ABSOLUTE 339
#define BX_TOKEN_TIMEBP 340
#define BX_TOKEN_RECORD 341
#define BX_TOKEN_PLAYBACK 342
#define BX_TOKEN_MODEBP 343
#define BX_TOKEN_PRINT_STACK 344
#define BX_TOKEN_WATCH 345
#define BX_TOKEN_UNWATCH 346
#define BX_TOKEN_READ 347
#define BX_TOKEN_WRITE 348
#define BX_TOKEN_SHOW 349
#define BX_TOKEN_LOAD_SYMBOLS 350
#define BX_TOKEN_SYMBOLS 351
#define BX_TOKEN_LIST_SYMBOLS 352
#define BX_TOKEN_GLOBAL 353
#define BX_TOKEN_WHERE 354
#define BX_TOKEN_PRINT_STRING 355
#define BX_TOKEN_DIFF_MEMORY 356
#define BX_TOKEN_SYNC_MEMORY 357
#define BX_TOKEN_SYNC_CPU 358
#define BX_TOKEN_FAST_FORWARD 359
#define BX_TOKEN_PHY_2_LOG 360
#define BX_TOKEN_NUMERIC 361
#define BX_TOKEN_LONG_NUMERIC 362
#define BX_TOKEN_INFO_ADDRESS 363
#define BX_TOKEN_NE2000 364
#define BX_TOKEN_PIC 365
#define BX_TOKEN_PAGE 366
#define BX_TOKEN_CS 367
#define BX_TOKEN_ES 368
#define BX_TOKEN_SS 369
#define BX_TOKEN_DS 370
#define BX_TOKEN_FS 371
#define BX_TOKEN_GS 372
#define BX_TOKEN_FLAGS 373
#define BX_TOKEN_ALWAYS_CHECK 374
#define BX_TOKEN_TRACEREGON 375
#define BX_TOKEN_TRACEREGOFF 376
#define BX_TOKEN_HELP 377
#define BX_TOKEN_CALC 378
#define BX_TOKEN_VGA 379
#define BX_TOKEN_RSHIFT 380
#define BX_TOKEN_LSHIFT 381
#define BX_TOKEN_IVT 382
#define NEG 383
#define NOT 384
#define BX_TOKEN_ON 323
#define BX_TOKEN_OFF 324
#define BX_TOKEN_DISASSEMBLE 325
#define BX_TOKEN_INSTRUMENT 326
#define BX_TOKEN_START 327
#define BX_TOKEN_STOP 328
#define BX_TOKEN_RESET 329
#define BX_TOKEN_PRINT 330
#define BX_TOKEN_LOADER 331
#define BX_TOKEN_STRING 332
#define BX_TOKEN_DOIT 333
#define BX_TOKEN_CRC 334
#define BX_TOKEN_TRACEON 335
#define BX_TOKEN_TRACEOFF 336
#define BX_TOKEN_SWITCH_MODE 337
#define BX_TOKEN_SIZE 338
#define BX_TOKEN_PTIME 339
#define BX_TOKEN_TIMEBP_ABSOLUTE 340
#define BX_TOKEN_TIMEBP 341
#define BX_TOKEN_RECORD 342
#define BX_TOKEN_PLAYBACK 343
#define BX_TOKEN_MODEBP 344
#define BX_TOKEN_PRINT_STACK 345
#define BX_TOKEN_WATCH 346
#define BX_TOKEN_UNWATCH 347
#define BX_TOKEN_READ 348
#define BX_TOKEN_WRITE 349
#define BX_TOKEN_SHOW 350
#define BX_TOKEN_LOAD_SYMBOLS 351
#define BX_TOKEN_SYMBOLS 352
#define BX_TOKEN_LIST_SYMBOLS 353
#define BX_TOKEN_GLOBAL 354
#define BX_TOKEN_WHERE 355
#define BX_TOKEN_PRINT_STRING 356
#define BX_TOKEN_DIFF_MEMORY 357
#define BX_TOKEN_SYNC_MEMORY 358
#define BX_TOKEN_SYNC_CPU 359
#define BX_TOKEN_FAST_FORWARD 360
#define BX_TOKEN_PHY_2_LOG 361
#define BX_TOKEN_NUMERIC 362
#define BX_TOKEN_LONG_NUMERIC 363
#define BX_TOKEN_INFO_ADDRESS 364
#define BX_TOKEN_NE2000 365
#define BX_TOKEN_PIC 366
#define BX_TOKEN_PAGE 367
#define BX_TOKEN_CS 368
#define BX_TOKEN_ES 369
#define BX_TOKEN_SS 370
#define BX_TOKEN_DS 371
#define BX_TOKEN_FS 372
#define BX_TOKEN_GS 373
#define BX_TOKEN_FLAGS 374
#define BX_TOKEN_ALWAYS_CHECK 375
#define BX_TOKEN_TRACEREGON 376
#define BX_TOKEN_TRACEREGOFF 377
#define BX_TOKEN_HELP 378
#define BX_TOKEN_CALC 379
#define BX_TOKEN_VGA 380
#define BX_TOKEN_RSHIFT 381
#define BX_TOKEN_LSHIFT 382
#define BX_TOKEN_IVT 383
#define NEG 384
#define NOT 385
@ -299,7 +301,7 @@ typedef union YYSTYPE {
Regs reg;
} YYSTYPE;
/* Line 1252 of yacc.c. */
#line 303 "y.tab.h"
#line 305 "y.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: parser.y,v 1.5 2006-01-24 19:03:54 sshwarts Exp $
// $Id: parser.y,v 1.6 2006-01-24 21:37:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
%{
@ -95,7 +95,6 @@
%token <sval> BX_TOKEN_IRQ
%token <sval> BX_TOKEN_DUMP_CPU
%token <sval> BX_TOKEN_SET_CPU
%token <sval> BX_TOKEN_DIS
%token <sval> BX_TOKEN_ON
%token <sval> BX_TOKEN_OFF
%token <sval> BX_TOKEN_DISASSEMBLE
@ -110,6 +109,8 @@
%token <sval> BX_TOKEN_CRC
%token <sval> BX_TOKEN_TRACEON
%token <sval> BX_TOKEN_TRACEOFF
%token <sval> BX_TOKEN_SWITCH_MODE
%token <sval> BX_TOKEN_SIZE
%token <sval> BX_TOKEN_PTIME
%token <sval> BX_TOKEN_TIMEBP_ABSOLUTE
%token <sval> BX_TOKEN_TIMEBP
@ -178,9 +179,9 @@ command:
| stepN_command
| step_over_command
| set_command
| set_reg_command
| breakpoint_command
| info_command
| regs_command
| blist_command
| slist_command
| dump_cpu_command
@ -474,14 +475,14 @@ step_over_command:
;
set_command:
BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_ON '\n'
BX_TOKEN_SET BX_TOKEN_DISASSEMBLE BX_TOKEN_ON '\n'
{
bx_dbg_set_command($1, $2, $3);
bx_dbg_set_auto_disassemble(1);
free($1); free($2); free($3);
}
| BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_OFF '\n'
| BX_TOKEN_SET BX_TOKEN_DISASSEMBLE BX_TOKEN_OFF '\n'
{
bx_dbg_set_command($1, $2, $3);
bx_dbg_set_auto_disassemble(0);
free($1); free($2); free($3);
}
| BX_TOKEN_SET BX_TOKEN_SYMBOLNAME '=' BX_TOKEN_NUMERIC '\n'
@ -489,6 +490,10 @@ set_command:
bx_dbg_set_symbol_command($2, $4);
free($1); free($2);
}
| BX_TOKEN_SET BX_TOKEN_NONSEG_REG '=' expression '\n'
{
bx_dbg_set_reg_value($2, $4);
}
;
breakpoint_command:
@ -687,6 +692,13 @@ numeric_range :
$$ = make_num_range ($1, $2);
};
regs_command:
BX_TOKEN_REGISTERS '\n'
{
bx_dbg_info_registers_command(BX_INFO_CPU_REGS);
free($1);
}
;
dump_cpu_command:
BX_TOKEN_DUMP_CPU '\n'
@ -826,24 +838,22 @@ disassemble_command:
bx_dbg_disassemble_command($2, $3);
free($1); free($2);
}
| BX_TOKEN_DISASSEMBLE BX_TOKEN_SWITCH_MODE '\n'
{
bx_dbg_disassemble_switch_mode();
free($1); free($2);
}
| BX_TOKEN_DISASSEMBLE BX_TOKEN_SIZE '=' BX_TOKEN_NUMERIC '\n'
{
bx_dbg_set_disassemble_size($4);
free($1); free($2);
}
;
instrument_command:
BX_TOKEN_INSTRUMENT BX_TOKEN_START '\n'
{
bx_dbg_instrument_command($2);
free($1); free($2);
}
| BX_TOKEN_INSTRUMENT BX_TOKEN_STOP '\n'
{
bx_dbg_instrument_command($2);
free($1); free($2);
}
| BX_TOKEN_INSTRUMENT BX_TOKEN_STOP '\n'
| BX_TOKEN_INSTRUMENT BX_TOKEN_RESET '\n'
{
bx_dbg_instrument_command($2);
free($1); free($2);
}
| BX_TOKEN_INSTRUMENT BX_TOKEN_PRINT '\n'
{
bx_dbg_instrument_command($2);
@ -904,7 +914,7 @@ help_command:
}
| BX_TOKEN_HELP BX_TOKEN_STEPN '\n'
{
dbg_printf("s|step|stepi [count] - execute #count instructions (default is 1 instruction)\n");
dbg_printf("s|step|stepi [count] - execute #count instructions (default is one instruction)\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_STEP_OVER '\n'
@ -1024,7 +1034,7 @@ help_command:
}
| BX_TOKEN_HELP BX_TOKEN_REGISTERS '\n'
{
dbg_printf("r|reg|regs|registers $reg = <expr> - set register value to expression\n");
dbg_printf("r|reg|regs|registers - list of CPU registers and their contents (same as 'info cpu')\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_SETPMEM '\n'
@ -1036,6 +1046,9 @@ help_command:
{
dbg_printf("u|disasm|disassemble [/count] <start> <end> - disassemble instructions for given linear address\n");
dbg_printf(" Optional 'count' is the number of disassembled instructions\n");
dbg_printf("u|disasm|disassemble switch-mode - switch between Intel and AT&T disassembler syntax\n");
dbg_printf("u|disasm|disassemble size = n - tell debugger what segment size [16|32|64] to use\n");
dbg_printf(" when \"disassemble\" command is used.\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_WATCH '\n'
@ -1077,11 +1090,12 @@ help_command:
}
| BX_TOKEN_HELP BX_TOKEN_SET '\n'
{
dbg_printf("set $reg = val - change CPU register to value val\n");
dbg_printf("set $disassemble_size = n - tell debugger what segment size [16|32|64] to use\n");
dbg_printf(" when \"disassemble\" command is used. Default is 32\n");
dbg_printf("set $auto_disassemble = n - cause debugger to disassemble current instruction\n");
dbg_printf(" every time execution stops if n = 1. Default is 0\n");
dbg_printf("set <regname> = <expr> - set register value to expression\n");
dbg_printf("set $reg = val - set CPU register to value val\n");
dbg_printf("set $auto_disassemble = 1 - cause debugger to disassemble current instruction\n");
dbg_printf(" every time execution stops\n");
dbg_printf("set u|disasm|disassemble on - same as 'set $auto_disassemble = 1'\n");
dbg_printf("set u|disasm|disassemble off - same as 'set $auto_disassemble = 0'\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_INFO '\n'
@ -1241,8 +1255,4 @@ expression:
| '(' expression ')' { $$ = $2; }
;
set_reg_command:
BX_TOKEN_REGISTERS BX_TOKEN_NONSEG_REG '=' expression '\n'
{ bx_dbg_set_reg_value($2, $4); }
;
%%

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: debugstuff.cc,v 1.51 2006-01-23 21:44:44 sshwarts Exp $
// $Id: debugstuff.cc,v 1.52 2006-01-24 21:37:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -297,8 +297,8 @@ bx_bool BX_CPU_C::dbg_set_reg(unsigned reg, Bit32u val)
BX_CPU_THIS_PTR set_AF(val & 0x01); val >>= 2;
BX_CPU_THIS_PTR set_ZF(val & 0x01); val >>= 1;
BX_CPU_THIS_PTR set_SF(val & 0x01); val >>= 2;
BX_CPU_THIS_PTR set_IF (val & 0x01); val >>= 1;
BX_CPU_THIS_PTR set_DF (val & 0x01); val >>= 1;
BX_CPU_THIS_PTR set_IF(val & 0x01); val >>= 1;
BX_CPU_THIS_PTR set_DF(val & 0x01); val >>= 1;
BX_CPU_THIS_PTR set_OF(val & 0x01);
if (BX_CPU_THIS_PTR get_IF ())
BX_CPU_THIS_PTR async_event = 1;