Updates to Bochs debugger:

AVX command split into two: YMM command and ZMM command for AVX-256 and AVX-512.
Later new command AVX will be added whch will print complete AVX state according to what is defined currently, including OPMASK registers

info device <name>
and
info device <name> <string>

could be also used now without having to include device name in quotes as "name".
old style "qouted" option also still working

added missing info cpu command to the help
This commit is contained in:
Stanislav Shwartsman 2013-11-19 21:53:55 +00:00
parent bfc9748600
commit ab87549b6b
7 changed files with 2553 additions and 2523 deletions

@ -1170,11 +1170,19 @@ void bx_dbg_info_registers_command(int which_regs_mask)
bx_dbg_print_mmx_state();
}
if (which_regs_mask & BX_INFO_AVX_REGS) {
bx_dbg_print_avx_state(BX_VLMAX-1);
#if BX_SUPPORT_EVEX
if (which_regs_mask & BX_INFO_ZMM_REGS) {
bx_dbg_print_avx_state(BX_VL512);
}
else if (which_regs_mask & BX_INFO_SSE_REGS) {
bx_dbg_print_sse_state();
else
#endif
{
if (which_regs_mask & BX_INFO_YMM_REGS) {
bx_dbg_print_avx_state(BX_VL256);
}
else if (which_regs_mask & BX_INFO_SSE_REGS) {
bx_dbg_print_sse_state();
}
}
}

@ -268,7 +268,8 @@ void bx_dbg_quit_command(void);
#define BX_INFO_FPU_REGS 0x02
#define BX_INFO_MMX_REGS 0x04
#define BX_INFO_SSE_REGS 0x08
#define BX_INFO_AVX_REGS 0x10
#define BX_INFO_YMM_REGS 0x10
#define BX_INFO_ZMM_REGS 0x20
void bx_dbg_info_registers_command(int);
void bx_dbg_info_ivt_command(unsigned from, unsigned to);
void bx_dbg_info_idt_command(unsigned from, unsigned to);

File diff suppressed because it is too large Load Diff

@ -78,8 +78,10 @@ r { bxlval.sval = strdup(bxtext); return(BX_TOKEN_R); }
reg|regs |
registers { bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGS); }
fp|fpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FPU); }
sse|xmm { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SSE); }
ymm { bxlval.sval = strdup(bxtext); return(BX_TOKEN_AVX); }
sse|xmm { bxlval.sval = strdup(bxtext); return(BX_TOKEN_XMM); }
ymm { bxlval.sval = strdup(bxtext); return(BX_TOKEN_YMM); }
zmm { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ZMM); }
avx { bxlval.sval = strdup(bxtext); return(BX_TOKEN_AVX); }
mmx { bxlval.sval = strdup(bxtext); return(BX_TOKEN_MMX); }
cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CPU); }
idt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); }

File diff suppressed because it is too large Load Diff

@ -79,77 +79,79 @@ extern int bxdebug;
BX_TOKEN_CPU = 288,
BX_TOKEN_FPU = 289,
BX_TOKEN_MMX = 290,
BX_TOKEN_SSE = 291,
BX_TOKEN_AVX = 292,
BX_TOKEN_IDT = 293,
BX_TOKEN_IVT = 294,
BX_TOKEN_GDT = 295,
BX_TOKEN_LDT = 296,
BX_TOKEN_TSS = 297,
BX_TOKEN_TAB = 298,
BX_TOKEN_ALL = 299,
BX_TOKEN_LINUX = 300,
BX_TOKEN_DEBUG_REGS = 301,
BX_TOKEN_CONTROL_REGS = 302,
BX_TOKEN_SEGMENT_REGS = 303,
BX_TOKEN_EXAMINE = 304,
BX_TOKEN_XFORMAT = 305,
BX_TOKEN_DISFORMAT = 306,
BX_TOKEN_RESTORE = 307,
BX_TOKEN_WRITEMEM = 308,
BX_TOKEN_SETPMEM = 309,
BX_TOKEN_SYMBOLNAME = 310,
BX_TOKEN_QUERY = 311,
BX_TOKEN_PENDING = 312,
BX_TOKEN_TAKE = 313,
BX_TOKEN_DMA = 314,
BX_TOKEN_IRQ = 315,
BX_TOKEN_TLB = 316,
BX_TOKEN_HEX = 317,
BX_TOKEN_DISASM = 318,
BX_TOKEN_INSTRUMENT = 319,
BX_TOKEN_STRING = 320,
BX_TOKEN_STOP = 321,
BX_TOKEN_DOIT = 322,
BX_TOKEN_CRC = 323,
BX_TOKEN_TRACE = 324,
BX_TOKEN_TRACEREG = 325,
BX_TOKEN_TRACEMEM = 326,
BX_TOKEN_SWITCH_MODE = 327,
BX_TOKEN_SIZE = 328,
BX_TOKEN_PTIME = 329,
BX_TOKEN_TIMEBP_ABSOLUTE = 330,
BX_TOKEN_TIMEBP = 331,
BX_TOKEN_MODEBP = 332,
BX_TOKEN_VMEXITBP = 333,
BX_TOKEN_PRINT_STACK = 334,
BX_TOKEN_WATCH = 335,
BX_TOKEN_UNWATCH = 336,
BX_TOKEN_READ = 337,
BX_TOKEN_WRITE = 338,
BX_TOKEN_SHOW = 339,
BX_TOKEN_LOAD_SYMBOLS = 340,
BX_TOKEN_SYMBOLS = 341,
BX_TOKEN_LIST_SYMBOLS = 342,
BX_TOKEN_GLOBAL = 343,
BX_TOKEN_WHERE = 344,
BX_TOKEN_PRINT_STRING = 345,
BX_TOKEN_NUMERIC = 346,
BX_TOKEN_PAGE = 347,
BX_TOKEN_HELP = 348,
BX_TOKEN_CALC = 349,
BX_TOKEN_VGA = 350,
BX_TOKEN_DEVICE = 351,
BX_TOKEN_COMMAND = 352,
BX_TOKEN_GENERIC = 353,
BX_TOKEN_RSHIFT = 354,
BX_TOKEN_LSHIFT = 355,
BX_TOKEN_REG_IP = 356,
BX_TOKEN_REG_EIP = 357,
BX_TOKEN_REG_RIP = 358,
INDIRECT = 359,
NEG = 360,
NOT = 361
BX_TOKEN_XMM = 291,
BX_TOKEN_YMM = 292,
BX_TOKEN_ZMM = 293,
BX_TOKEN_AVX = 294,
BX_TOKEN_IDT = 295,
BX_TOKEN_IVT = 296,
BX_TOKEN_GDT = 297,
BX_TOKEN_LDT = 298,
BX_TOKEN_TSS = 299,
BX_TOKEN_TAB = 300,
BX_TOKEN_ALL = 301,
BX_TOKEN_LINUX = 302,
BX_TOKEN_DEBUG_REGS = 303,
BX_TOKEN_CONTROL_REGS = 304,
BX_TOKEN_SEGMENT_REGS = 305,
BX_TOKEN_EXAMINE = 306,
BX_TOKEN_XFORMAT = 307,
BX_TOKEN_DISFORMAT = 308,
BX_TOKEN_RESTORE = 309,
BX_TOKEN_WRITEMEM = 310,
BX_TOKEN_SETPMEM = 311,
BX_TOKEN_SYMBOLNAME = 312,
BX_TOKEN_QUERY = 313,
BX_TOKEN_PENDING = 314,
BX_TOKEN_TAKE = 315,
BX_TOKEN_DMA = 316,
BX_TOKEN_IRQ = 317,
BX_TOKEN_TLB = 318,
BX_TOKEN_HEX = 319,
BX_TOKEN_DISASM = 320,
BX_TOKEN_INSTRUMENT = 321,
BX_TOKEN_STRING = 322,
BX_TOKEN_STOP = 323,
BX_TOKEN_DOIT = 324,
BX_TOKEN_CRC = 325,
BX_TOKEN_TRACE = 326,
BX_TOKEN_TRACEREG = 327,
BX_TOKEN_TRACEMEM = 328,
BX_TOKEN_SWITCH_MODE = 329,
BX_TOKEN_SIZE = 330,
BX_TOKEN_PTIME = 331,
BX_TOKEN_TIMEBP_ABSOLUTE = 332,
BX_TOKEN_TIMEBP = 333,
BX_TOKEN_MODEBP = 334,
BX_TOKEN_VMEXITBP = 335,
BX_TOKEN_PRINT_STACK = 336,
BX_TOKEN_WATCH = 337,
BX_TOKEN_UNWATCH = 338,
BX_TOKEN_READ = 339,
BX_TOKEN_WRITE = 340,
BX_TOKEN_SHOW = 341,
BX_TOKEN_LOAD_SYMBOLS = 342,
BX_TOKEN_SYMBOLS = 343,
BX_TOKEN_LIST_SYMBOLS = 344,
BX_TOKEN_GLOBAL = 345,
BX_TOKEN_WHERE = 346,
BX_TOKEN_PRINT_STRING = 347,
BX_TOKEN_NUMERIC = 348,
BX_TOKEN_PAGE = 349,
BX_TOKEN_HELP = 350,
BX_TOKEN_CALC = 351,
BX_TOKEN_VGA = 352,
BX_TOKEN_DEVICE = 353,
BX_TOKEN_COMMAND = 354,
BX_TOKEN_GENERIC = 355,
BX_TOKEN_RSHIFT = 356,
BX_TOKEN_LSHIFT = 357,
BX_TOKEN_REG_IP = 358,
BX_TOKEN_REG_EIP = 359,
BX_TOKEN_REG_RIP = 360,
INDIRECT = 361,
NEG = 362,
NOT = 363
};
#endif
/* Tokens. */
@ -186,77 +188,79 @@ extern int bxdebug;
#define BX_TOKEN_CPU 288
#define BX_TOKEN_FPU 289
#define BX_TOKEN_MMX 290
#define BX_TOKEN_SSE 291
#define BX_TOKEN_AVX 292
#define BX_TOKEN_IDT 293
#define BX_TOKEN_IVT 294
#define BX_TOKEN_GDT 295
#define BX_TOKEN_LDT 296
#define BX_TOKEN_TSS 297
#define BX_TOKEN_TAB 298
#define BX_TOKEN_ALL 299
#define BX_TOKEN_LINUX 300
#define BX_TOKEN_DEBUG_REGS 301
#define BX_TOKEN_CONTROL_REGS 302
#define BX_TOKEN_SEGMENT_REGS 303
#define BX_TOKEN_EXAMINE 304
#define BX_TOKEN_XFORMAT 305
#define BX_TOKEN_DISFORMAT 306
#define BX_TOKEN_RESTORE 307
#define BX_TOKEN_WRITEMEM 308
#define BX_TOKEN_SETPMEM 309
#define BX_TOKEN_SYMBOLNAME 310
#define BX_TOKEN_QUERY 311
#define BX_TOKEN_PENDING 312
#define BX_TOKEN_TAKE 313
#define BX_TOKEN_DMA 314
#define BX_TOKEN_IRQ 315
#define BX_TOKEN_TLB 316
#define BX_TOKEN_HEX 317
#define BX_TOKEN_DISASM 318
#define BX_TOKEN_INSTRUMENT 319
#define BX_TOKEN_STRING 320
#define BX_TOKEN_STOP 321
#define BX_TOKEN_DOIT 322
#define BX_TOKEN_CRC 323
#define BX_TOKEN_TRACE 324
#define BX_TOKEN_TRACEREG 325
#define BX_TOKEN_TRACEMEM 326
#define BX_TOKEN_SWITCH_MODE 327
#define BX_TOKEN_SIZE 328
#define BX_TOKEN_PTIME 329
#define BX_TOKEN_TIMEBP_ABSOLUTE 330
#define BX_TOKEN_TIMEBP 331
#define BX_TOKEN_MODEBP 332
#define BX_TOKEN_VMEXITBP 333
#define BX_TOKEN_PRINT_STACK 334
#define BX_TOKEN_WATCH 335
#define BX_TOKEN_UNWATCH 336
#define BX_TOKEN_READ 337
#define BX_TOKEN_WRITE 338
#define BX_TOKEN_SHOW 339
#define BX_TOKEN_LOAD_SYMBOLS 340
#define BX_TOKEN_SYMBOLS 341
#define BX_TOKEN_LIST_SYMBOLS 342
#define BX_TOKEN_GLOBAL 343
#define BX_TOKEN_WHERE 344
#define BX_TOKEN_PRINT_STRING 345
#define BX_TOKEN_NUMERIC 346
#define BX_TOKEN_PAGE 347
#define BX_TOKEN_HELP 348
#define BX_TOKEN_CALC 349
#define BX_TOKEN_VGA 350
#define BX_TOKEN_DEVICE 351
#define BX_TOKEN_COMMAND 352
#define BX_TOKEN_GENERIC 353
#define BX_TOKEN_RSHIFT 354
#define BX_TOKEN_LSHIFT 355
#define BX_TOKEN_REG_IP 356
#define BX_TOKEN_REG_EIP 357
#define BX_TOKEN_REG_RIP 358
#define INDIRECT 359
#define NEG 360
#define NOT 361
#define BX_TOKEN_XMM 291
#define BX_TOKEN_YMM 292
#define BX_TOKEN_ZMM 293
#define BX_TOKEN_AVX 294
#define BX_TOKEN_IDT 295
#define BX_TOKEN_IVT 296
#define BX_TOKEN_GDT 297
#define BX_TOKEN_LDT 298
#define BX_TOKEN_TSS 299
#define BX_TOKEN_TAB 300
#define BX_TOKEN_ALL 301
#define BX_TOKEN_LINUX 302
#define BX_TOKEN_DEBUG_REGS 303
#define BX_TOKEN_CONTROL_REGS 304
#define BX_TOKEN_SEGMENT_REGS 305
#define BX_TOKEN_EXAMINE 306
#define BX_TOKEN_XFORMAT 307
#define BX_TOKEN_DISFORMAT 308
#define BX_TOKEN_RESTORE 309
#define BX_TOKEN_WRITEMEM 310
#define BX_TOKEN_SETPMEM 311
#define BX_TOKEN_SYMBOLNAME 312
#define BX_TOKEN_QUERY 313
#define BX_TOKEN_PENDING 314
#define BX_TOKEN_TAKE 315
#define BX_TOKEN_DMA 316
#define BX_TOKEN_IRQ 317
#define BX_TOKEN_TLB 318
#define BX_TOKEN_HEX 319
#define BX_TOKEN_DISASM 320
#define BX_TOKEN_INSTRUMENT 321
#define BX_TOKEN_STRING 322
#define BX_TOKEN_STOP 323
#define BX_TOKEN_DOIT 324
#define BX_TOKEN_CRC 325
#define BX_TOKEN_TRACE 326
#define BX_TOKEN_TRACEREG 327
#define BX_TOKEN_TRACEMEM 328
#define BX_TOKEN_SWITCH_MODE 329
#define BX_TOKEN_SIZE 330
#define BX_TOKEN_PTIME 331
#define BX_TOKEN_TIMEBP_ABSOLUTE 332
#define BX_TOKEN_TIMEBP 333
#define BX_TOKEN_MODEBP 334
#define BX_TOKEN_VMEXITBP 335
#define BX_TOKEN_PRINT_STACK 336
#define BX_TOKEN_WATCH 337
#define BX_TOKEN_UNWATCH 338
#define BX_TOKEN_READ 339
#define BX_TOKEN_WRITE 340
#define BX_TOKEN_SHOW 341
#define BX_TOKEN_LOAD_SYMBOLS 342
#define BX_TOKEN_SYMBOLS 343
#define BX_TOKEN_LIST_SYMBOLS 344
#define BX_TOKEN_GLOBAL 345
#define BX_TOKEN_WHERE 346
#define BX_TOKEN_PRINT_STRING 347
#define BX_TOKEN_NUMERIC 348
#define BX_TOKEN_PAGE 349
#define BX_TOKEN_HELP 350
#define BX_TOKEN_CALC 351
#define BX_TOKEN_VGA 352
#define BX_TOKEN_DEVICE 353
#define BX_TOKEN_COMMAND 354
#define BX_TOKEN_GENERIC 355
#define BX_TOKEN_RSHIFT 356
#define BX_TOKEN_LSHIFT 357
#define BX_TOKEN_REG_IP 358
#define BX_TOKEN_REG_EIP 359
#define BX_TOKEN_REG_RIP 360
#define INDIRECT 361
#define NEG 362
#define NOT 363
@ -272,7 +276,7 @@ typedef union YYSTYPE
/* Line 2053 of yacc.c */
#line 276 "y.tab.h"
#line 280 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */

@ -55,7 +55,9 @@
%token <sval> BX_TOKEN_CPU
%token <sval> BX_TOKEN_FPU
%token <sval> BX_TOKEN_MMX
%token <sval> BX_TOKEN_SSE
%token <sval> BX_TOKEN_XMM
%token <sval> BX_TOKEN_YMM
%token <sval> BX_TOKEN_ZMM
%token <sval> BX_TOKEN_AVX
%token <sval> BX_TOKEN_IDT
%token <sval> BX_TOKEN_IVT
@ -149,8 +151,9 @@ command:
| regs_command
| fpu_regs_command
| mmx_regs_command
| sse_regs_command
| avx_regs_command
| xmm_regs_command
| ymm_regs_command
| zmm_regs_command
| segment_regs_command
| debug_regs_command
| control_regs_command
@ -639,6 +642,16 @@ info_command:
bx_dbg_info_device("", "");
free($1); free($2);
}
| BX_TOKEN_INFO BX_TOKEN_DEVICE BX_TOKEN_COMMAND '\n'
{
bx_dbg_info_device($3, "");
free($1); free($2);
}
| BX_TOKEN_INFO BX_TOKEN_DEVICE BX_TOKEN_COMMAND BX_TOKEN_STRING '\n'
{
bx_dbg_info_device($3, $4);
free($1); free($2);
}
| BX_TOKEN_INFO BX_TOKEN_DEVICE BX_TOKEN_STRING '\n'
{
bx_dbg_info_device($3, "");
@ -679,18 +692,26 @@ mmx_regs_command:
}
;
sse_regs_command:
BX_TOKEN_SSE '\n'
xmm_regs_command:
BX_TOKEN_XMM '\n'
{
bx_dbg_info_registers_command(BX_INFO_SSE_REGS);
free($1);
}
;
avx_regs_command:
BX_TOKEN_AVX '\n'
ymm_regs_command:
BX_TOKEN_YMM '\n'
{
bx_dbg_info_registers_command(BX_INFO_AVX_REGS);
bx_dbg_info_registers_command(BX_INFO_YMM_REGS);
free($1);
}
;
zmm_regs_command:
BX_TOKEN_ZMM '\n'
{
bx_dbg_info_registers_command(BX_INFO_ZMM_REGS);
free($1);
}
;
@ -1044,16 +1065,21 @@ help_command:
dbg_printf("mmx - print MMX state\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_SSE '\n'
| BX_TOKEN_HELP BX_TOKEN_XMM '\n'
{
dbg_printf("xmm|sse - print SSE state\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_AVX '\n'
| BX_TOKEN_HELP BX_TOKEN_YMM '\n'
{
dbg_printf("ymm - print AVX state\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_ZMM '\n'
{
dbg_printf("zmm - print AVX-512 state\n");
free($1);free($2);
}
| BX_TOKEN_HELP BX_TOKEN_SEGMENT_REGS '\n'
{
dbg_printf("sreg - show segment registers\n");
@ -1143,6 +1169,7 @@ help_command:
| BX_TOKEN_HELP BX_TOKEN_INFO '\n'
{
dbg_printf("info break - show information about current breakpoint status\n");
dbg_printf("info cpu - show dump of all cpu registers\n");
dbg_printf("info idt - show interrupt descriptor table\n");
dbg_printf("info ivt - show interrupt vector table\n");
dbg_printf("info gdt - show global descriptor table\n");