Fix 'show' command in Boch debugger.

Fully supported show-interrupts, show-mode and show-call options
Enable toggling of show options (bug report from SF)
This commit is contained in:
Stanislav Shwartsman 2006-02-12 20:21:36 +00:00
parent 22adda781e
commit 2646484dc1
10 changed files with 208 additions and 218 deletions

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.53 2006-02-11 21:19:22 sshwarts Exp $ // $Id: dbg_main.cc,v 1.54 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -834,34 +834,42 @@ void bx_dbg_print_string_command(bx_address start_addr)
dbg_printf("\n"); dbg_printf("\n");
} }
static bx_address last_cr3; unsigned dbg_show_mask = 0;
static bx_bool last_cpu_mode = 0;
unsigned int dbg_show_mask = 0; #define BX_DBG_SHOW_CALLRET (Flag_call|Flag_ret)
// 0x80 print mode #define BX_DBG_SHOW_INT (Flag_softint|Flag_iret|Flag_intsig)
// 0x40 print interrupts #define BX_DBG_SHOW_MODE (Flag_mode)
// 0x20 print calls
//BW added. toggles show symbolic info (calls to begin with)
// 0x1 call
// 0x2 return
// 0x4 int
// 0x8 iret
// 0x10 interrupts (includes iret)
void bx_dbg_show_command(const char* arg) void bx_dbg_show_command(const char* arg)
{ {
if(arg) { if(arg) {
if (!strcmp(arg,"mode")){ if (!strcmp(arg, "mode")) {
dbg_show_mask = 0x80; if (dbg_show_mask & BX_DBG_SHOW_MODE) {
} else if (!strcmp(arg,"int")){ dbg_show_mask &= ~BX_DBG_SHOW_MODE;
dbg_show_mask = 0xc0; dbg_printf("show mode switch: OFF\n");
} else if(!strcmp(arg,"call")){ } else {
dbg_show_mask = 0xe0; dbg_show_mask |= BX_DBG_SHOW_MODE;
} else if(!strcmp(arg,"ret")){ dbg_printf("show mode switch: ON\n");
dbg_show_mask = 0xe0; }
} else if (!strcmp(arg, "int")){
if (dbg_show_mask & BX_DBG_SHOW_INT) {
dbg_show_mask &= ~BX_DBG_SHOW_INT;
dbg_printf("show interrupts: OFF\n");
} else {
dbg_show_mask |= BX_DBG_SHOW_INT;
dbg_printf("show interrupts: ON\n");
}
} else if(!strcmp(arg,"call")) {
if (dbg_show_mask & BX_DBG_SHOW_CALLRET) {
dbg_show_mask &= ~BX_DBG_SHOW_CALLRET;
dbg_printf("show calls/returns: OFF\n");
} else {
dbg_show_mask |= BX_DBG_SHOW_CALLRET;
dbg_printf("show calls/returns: ON\n");
}
} else if(!strcmp(arg,"off")){ } else if(!strcmp(arg,"off")){
dbg_show_mask = 0x0; dbg_show_mask = 0x0;
dbg_printf("Disable all show flags\n");
} else if(!strcmp(arg,"dbg-all")){ } else if(!strcmp(arg,"dbg-all")){
bx_dbg.floppy = 1; bx_dbg.floppy = 1;
bx_dbg.keyboard = 1; bx_dbg.keyboard = 1;
@ -888,7 +896,7 @@ void bx_dbg_show_command(const char* arg)
bx_dbg.dma = 1; bx_dbg.dma = 1;
bx_dbg.unsupported_io = 1; bx_dbg.unsupported_io = 1;
/* bx_dbg.record_io = 1; this is a pointer .. somewhere */ /* bx_dbg.record_io = 1; this is a pointer .. somewhere */
printf("Turned on all bx_dbg flags\n"); dbg_printf("Turned ON all bx_dbg flags\n");
return; return;
} else if(!strcmp(arg,"dbg-none")){ } else if(!strcmp(arg,"dbg-none")){
bx_dbg.floppy = 0; bx_dbg.floppy = 0;
@ -916,34 +924,105 @@ void bx_dbg_show_command(const char* arg)
bx_dbg.dma = 0; bx_dbg.dma = 0;
bx_dbg.unsupported_io = 0; bx_dbg.unsupported_io = 0;
/* bx_dbg.record_io = 0; this is a pointer .. somewhere */ /* bx_dbg.record_io = 0; this is a pointer .. somewhere */
printf("Turned off all bx_dbg flags\n"); dbg_printf("Turned OFF all bx_dbg flags\n");
return; return;
} else if(!strcmp(arg,"vga")){ } else if(!strcmp(arg,"vga")){
DEV_vga_refresh(); DEV_vga_refresh();
return; return;
} else { } else {
printf("Unrecognized arg: %s (mode, int, call, ret, off, dbg-all and dbg-none are valid)\n",arg); printf("Unrecognized arg: %s (only 'mode', 'int', 'call', 'off', 'dbg-all' and 'dbg-none' are valid)\n", arg);
return; return;
} }
} else {
dbg_printf("show mask is 0x%x\n", dbg_show_mask);
return;
} }
// enable trace if any print is active if (dbg_show_mask) {
if(dbg_show_mask & 0xe0) dbg_printf("show mask is:");
dbg_show_mask |= 0x1f; if (dbg_show_mask & BX_DBG_SHOW_CALLRET)
dbg_printf(" call");
if (dbg_show_mask & BX_DBG_SHOW_INT)
dbg_printf(" int");
if (dbg_show_mask & BX_DBG_SHOW_MODE)
dbg_printf(" mode");
dbg_printf("\n");
}
else {
dbg_printf("show mask is: 0\n");
}
}
dbg_printf("show mask is 0x%x, cleared show_flag\n", dbg_show_mask);
BX_CPU(dbg_cpu)->show_flag = 0;
last_cr3 = BX_CPU(dbg_cpu)->cr3;
last_cpu_mode = BX_CPU(dbg_cpu)->get_cpu_mode();
dbg_printf (FMT_TICK ": address %04x:" FMT_ADDRX " " FMT_ADDRX "\n\n", // return non zero to cause a stop
int bx_dbg_show_symbolic(void)
{
static unsigned last_cpu_mode = 0;
static bx_address last_cr3 = 0;
/* modes & address spaces */
if (dbg_show_mask & BX_DBG_SHOW_MODE) {
if(BX_CPU(dbg_cpu)->get_cpu_mode() != last_cpu_mode) {
dbg_printf (FMT_TICK ": switched from '%s' to '%s'\n",
bx_pc_system.time_ticks(),
cpu_mode_string(last_cpu_mode),
cpu_mode_string(BX_CPU(dbg_cpu)->get_cpu_mode()));
}
if(last_cr3 != BX_CPU(dbg_cpu)->cr3)
dbg_printf(FMT_TICK ": address space switched. CR3: 0x" FMT_ADDRX "\n",
bx_pc_system.time_ticks(), BX_CPU(dbg_cpu)->cr3);
}
/* interrupts */
if (dbg_show_mask & BX_DBG_SHOW_INT) {
if(BX_CPU(dbg_cpu)->show_flag & Flag_softint) {
dbg_printf (FMT_TICK ": softint 0x%04x:" FMT_ADDRX " (0x" FMT_ADDRX ")\n",
bx_pc_system.time_ticks(), bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs, BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip, BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr); BX_CPU(dbg_cpu)->guard_found.laddr);
}
if((BX_CPU(dbg_cpu)->show_flag & Flag_intsig) && !(BX_CPU(dbg_cpu)->show_flag & Flag_softint)) {
dbg_printf (FMT_TICK ": exception (not softint) 0x%04x:" FMT_ADDRX " (0x" FMT_ADDRX ")\n",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr);
}
if(BX_CPU(dbg_cpu)->show_flag & Flag_iret) {
dbg_printf (FMT_TICK ": iret 0x%04x:" FMT_ADDRX " (0x" FMT_ADDRX ")\n",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr);
}
}
/* calls */
if (dbg_show_mask & BX_DBG_SHOW_CALLRET)
{
if(BX_CPU(dbg_cpu)->show_flag & Flag_call) {
Bit32u phy = 0;
bx_bool valid;
BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(BX_CPU(dbg_cpu)->guard_found.laddr, &phy, &valid);
dbg_printf (FMT_TICK ": call 0x%04x:" FMT_ADDRX " 0x" FMT_ADDRX " (%08x) %s",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr,
phy,
bx_dbg_symbolic_address(BX_CPU(dbg_cpu)->cr3,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr - BX_CPU(dbg_cpu)->guard_found.eip));
if(!valid) dbg_printf(" phys not valid");
dbg_printf("\n");
}
}
last_cr3 = BX_CPU(dbg_cpu)->cr3;
last_cpu_mode = BX_CPU(dbg_cpu)->get_cpu_mode();
BX_CPU(dbg_cpu)->show_flag = 0;
return 0;
} }
void bx_dbg_print_stack_command(unsigned nwords) void bx_dbg_print_stack_command(unsigned nwords)
@ -2997,88 +3076,6 @@ void bx_dbg_post_dma_reports(void)
bx_dbg_batch_dma.Qsize = 0; bx_dbg_batch_dma.Qsize = 0;
} }
int bx_dbg_symbolic_output(void)
{
// BW added. return non zero to cause a stop
static int symbol_level = 0;
/* modes & address spaces */
if(BX_CPU(dbg_cpu)->get_cpu_mode() != last_cpu_mode) {
dbg_printf (FMT_TICK ": switched from %s to %s since last trigger\n",
bx_pc_system.time_ticks(),
cpu_mode_string(last_cpu_mode),
cpu_mode_string(BX_CPU(dbg_cpu)->get_cpu_mode()));
}
if(last_cr3 != BX_CPU(dbg_cpu)->cr3)
dbg_printf("\n" FMT_TICK ": Address space switched since last trigger. CR3: 0x%08x\n",
bx_pc_system.time_ticks(), BX_CPU(dbg_cpu)->cr3);
/* interrupts */
if (dbg_show_mask & 0x40) {
if(BX_CPU(dbg_cpu)->show_flag & 0x4) {
dbg_printf (FMT_TICK ": softint %04x:" FMT_ADDRX " " FMT_ADDRX "\n",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr);
}
if((BX_CPU(dbg_cpu)->show_flag & 0x10) && !(BX_CPU(dbg_cpu)->show_flag & 0x4)) {
dbg_printf (FMT_TICK ": exception (not softint) %04x:" FMT_ADDRX " " FMT_ADDRX "\n",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr);
}
if(BX_CPU(dbg_cpu)->show_flag & 0x8) {
dbg_printf (FMT_TICK ": iret %04x:" FMT_ADDRX " " FMT_ADDRX "(from " FMT_ADDRX ")\n",
bx_pc_system.time_ticks(),
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr,
BX_CPU(dbg_cpu)->show_eip);
}
}
/* calls */
if(BX_CPU(dbg_cpu)->show_flag & 0x1) {
Bit32u phy = 0;
bx_bool valid;
if (dbg_show_mask & 0x20) {
BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(BX_CPU(dbg_cpu)->guard_found.laddr,
&phy, &valid);
dbg_printf (FMT_TICK ": %*s call %04x:" FMT_ADDRX " 0x" FMT_ADDRX " (%08x) %s",
bx_pc_system.time_ticks(), symbol_level+1," ",
BX_CPU(dbg_cpu)->guard_found.cs,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr,
phy,
bx_dbg_symbolic_address(BX_CPU(dbg_cpu)->cr3,
BX_CPU(dbg_cpu)->guard_found.eip,
BX_CPU(dbg_cpu)->guard_found.laddr - BX_CPU(dbg_cpu)->guard_found.eip) );
if(!valid)
dbg_printf(" phys not valid");
dbg_printf("\n");
}
symbol_level++;
if(symbol_level > 40)
symbol_level = 10;
}
if (BX_CPU(dbg_cpu)->show_flag & 0x2) {
symbol_level--;
if(symbol_level < 0)
symbol_level = 0;
}
BX_CPU(dbg_cpu)->show_flag = 0;
last_cr3 = BX_CPU(dbg_cpu)->cr3;
return 0;
}
void bx_dbg_dump_table(void) void bx_dbg_dump_table(void)
{ {
Bit32u lin; // show only low 32 bit Bit32u lin; // show only low 32 bit

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: debug.h,v 1.19 2006-02-11 21:19:22 sshwarts Exp $ // $Id: debug.h,v 1.20 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -192,6 +192,15 @@ typedef enum
bkStepOver bkStepOver
} BreakpointKind; } BreakpointKind;
typedef enum _show_flags {
Flag_call = 0x1,
Flag_ret = 0x2,
Flag_softint = 0x4,
Flag_iret = 0x8,
Flag_intsig = 0x10,
Flag_mode = 0x20
} show_flags_t;
// Flex defs // Flex defs
extern int bxlex(void); extern int bxlex(void);
extern char *bxtext; // Using the pointer option rather than array extern char *bxtext; // Using the pointer option rather than array
@ -290,7 +299,7 @@ void bx_dbg_print_help(void);
void bx_dbg_calc_command(Bit64u value); void bx_dbg_calc_command(Bit64u value);
void bx_dbg_info_ivt_command(bx_num_range); void bx_dbg_info_ivt_command(bx_num_range);
void bx_dbg_dump_table(void); void bx_dbg_dump_table(void);
int bx_dbg_symbolic_output(void); /* BW */ int bx_dbg_show_symbolic(void);
void bx_dbg_set_symbol_command(char *symbol, Bit32u val); void bx_dbg_set_symbol_command(char *symbol, Bit32u val);
char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base); char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base);
char* bx_dbg_symbolic_address_16bit(Bit32u eip, Bit32u cs); char* bx_dbg_symbolic_address_16bit(Bit32u eip, Bit32u cs);

View File

@ -655,14 +655,14 @@ static const unsigned short yyrline[] =
823, 828, 833, 838, 843, 848, 853, 858, 863, 868, 823, 828, 833, 838, 843, 848, 853, 858, 863, 868,
873, 879, 885, 890, 895, 900, 905, 910, 915, 920, 873, 879, 885, 890, 895, 900, 905, 910, 915, 920,
925, 930, 935, 940, 945, 954, 963, 970, 983, 991, 925, 930, 935, 940, 945, 954, 963, 970, 983, 991,
1001, 1022, 1035, 1045, 1050, 1058, 1066, 1067, 1068, 1069, 1001, 1022, 1034, 1044, 1049, 1057, 1065, 1066, 1067, 1068,
1074, 1075, 1076, 1077, 1082, 1083, 1084, 1085, 1086, 1087, 1073, 1074, 1075, 1076, 1081, 1082, 1083, 1084, 1085, 1086,
1088, 1089, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1087, 1088, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100,
1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123,
1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133,
1135, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1134, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147,
1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157,
1159, 1160, 1161, 1162 1158, 1159, 1160, 1161
}; };
#endif #endif
@ -2948,7 +2948,6 @@ yyreduce:
dbg_printf("show mode - show, when processor switch mode\n"); dbg_printf("show mode - show, when processor switch mode\n");
dbg_printf("show int - show, when interrupt is happens\n"); dbg_printf("show int - show, when interrupt is happens\n");
dbg_printf("show call - show, when call is happens\n"); dbg_printf("show call - show, when call is happens\n");
dbg_printf("show ret - show, when iret is happens\n");
dbg_printf("show off - toggles off symbolic info\n"); dbg_printf("show off - toggles off symbolic info\n");
dbg_printf("show dbg-all - turn on all show flags\n"); dbg_printf("show dbg-all - turn on all show flags\n");
dbg_printf("show dbg-none - turn off all show flags\n"); dbg_printf("show dbg-none - turn off all show flags\n");
@ -2957,7 +2956,7 @@ yyreduce:
break; break;
case 182: case 182:
#line 1036 "parser.y" #line 1035 "parser.y"
{ {
dbg_printf("calc|? <expr> - calculate a expression and display the result.\n"); dbg_printf("calc|? <expr> - calculate a expression and display the result.\n");
dbg_printf(" 'expr' can reference any general-purpose and segment\n"); dbg_printf(" 'expr' can reference any general-purpose and segment\n");
@ -2970,7 +2969,7 @@ yyreduce:
break; break;
case 183: case 183:
#line 1046 "parser.y" #line 1045 "parser.y"
{ {
bx_dbg_print_help(); bx_dbg_print_help();
free(yyvsp[-2].sval);free(yyvsp[-1].sval); free(yyvsp[-2].sval);free(yyvsp[-1].sval);
@ -2978,7 +2977,7 @@ yyreduce:
break; break;
case 184: case 184:
#line 1051 "parser.y" #line 1050 "parser.y"
{ {
bx_dbg_print_help(); bx_dbg_print_help();
free(yyvsp[-1].sval); free(yyvsp[-1].sval);
@ -2986,7 +2985,7 @@ yyreduce:
break; break;
case 185: case 185:
#line 1059 "parser.y" #line 1058 "parser.y"
{ {
bx_dbg_calc_command(yyvsp[-1].ulval); bx_dbg_calc_command(yyvsp[-1].ulval);
free(yyvsp[-2].sval); free(yyvsp[-2].sval);
@ -2994,242 +2993,242 @@ yyreduce:
break; break;
case 189: case 189:
#line 1070 "parser.y" #line 1069 "parser.y"
{ yyval.uval=yyvsp[0].uval; } { yyval.uval=yyvsp[0].uval; }
break; break;
case 193: case 193:
#line 1078 "parser.y" #line 1077 "parser.y"
{ yyval.uval=yyvsp[0].uval; } { yyval.uval=yyvsp[0].uval; }
break; break;
case 201: case 201:
#line 1090 "parser.y" #line 1089 "parser.y"
{ yyval.uval=yyvsp[0].uval; } { yyval.uval=yyvsp[0].uval; }
break; break;
case 209: case 209:
#line 1102 "parser.y" #line 1101 "parser.y"
{ yyval.uval=yyvsp[0].uval; } { yyval.uval=yyvsp[0].uval; }
break; break;
case 210: case 210:
#line 1115 "parser.y" #line 1114 "parser.y"
{ yyval.ulval = yyvsp[0].uval; } { yyval.ulval = yyvsp[0].uval; }
break; break;
case 211: case 211:
#line 1116 "parser.y" #line 1115 "parser.y"
{ yyval.ulval = yyvsp[0].ulval; } { yyval.ulval = yyvsp[0].ulval; }
break; break;
case 212: case 212:
#line 1117 "parser.y" #line 1116 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); }
break; break;
case 213: case 213:
#line 1118 "parser.y" #line 1117 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); }
break; break;
case 214: case 214:
#line 1119 "parser.y" #line 1118 "parser.y"
{ yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); }
break; break;
case 215: case 215:
#line 1120 "parser.y" #line 1119 "parser.y"
{ yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); }
break; break;
case 216: case 216:
#line 1121 "parser.y" #line 1120 "parser.y"
{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); }
break; break;
case 217: case 217:
#line 1122 "parser.y" #line 1121 "parser.y"
{ yyval.ulval = bx_dbg_get_ip (); } { yyval.ulval = bx_dbg_get_ip (); }
break; break;
case 218: case 218:
#line 1123 "parser.y" #line 1122 "parser.y"
{ yyval.ulval = bx_dbg_get_eip(); } { yyval.ulval = bx_dbg_get_eip(); }
break; break;
case 219: case 219:
#line 1124 "parser.y" #line 1123 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; }
break; break;
case 220: case 220:
#line 1125 "parser.y" #line 1124 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; }
break; break;
case 221: case 221:
#line 1126 "parser.y" #line 1125 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; }
break; break;
case 222: case 222:
#line 1127 "parser.y" #line 1126 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval / yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval / yyvsp[0].ulval; }
break; break;
case 223: case 223:
#line 1128 "parser.y" #line 1127 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; }
break; break;
case 224: case 224:
#line 1129 "parser.y" #line 1128 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; }
break; break;
case 225: case 225:
#line 1130 "parser.y" #line 1129 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; }
break; break;
case 226: case 226:
#line 1131 "parser.y" #line 1130 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; }
break; break;
case 227: case 227:
#line 1132 "parser.y" #line 1131 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; }
break; break;
case 228: case 228:
#line 1133 "parser.y" #line 1132 "parser.y"
{ yyval.ulval = !yyvsp[0].ulval; } { yyval.ulval = !yyvsp[0].ulval; }
break; break;
case 229: case 229:
#line 1134 "parser.y" #line 1133 "parser.y"
{ yyval.ulval = -yyvsp[0].ulval; } { yyval.ulval = -yyvsp[0].ulval; }
break; break;
case 230: case 230:
#line 1135 "parser.y" #line 1134 "parser.y"
{ yyval.ulval = yyvsp[-1].ulval; } { yyval.ulval = yyvsp[-1].ulval; }
break; break;
case 231: case 231:
#line 1140 "parser.y" #line 1139 "parser.y"
{ yyval.ulval = yyvsp[0].uval; } { yyval.ulval = yyvsp[0].uval; }
break; break;
case 232: case 232:
#line 1141 "parser.y" #line 1140 "parser.y"
{ yyval.ulval = yyvsp[0].ulval; } { yyval.ulval = yyvsp[0].ulval; }
break; break;
case 233: case 233:
#line 1142 "parser.y" #line 1141 "parser.y"
{ yyval.ulval = bx_dbg_get_symbol_value(yyvsp[0].sval); free(yyvsp[0].sval);} { yyval.ulval = bx_dbg_get_symbol_value(yyvsp[0].sval); free(yyvsp[0].sval);}
break; break;
case 234: case 234:
#line 1143 "parser.y" #line 1142 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); }
break; break;
case 235: case 235:
#line 1144 "parser.y" #line 1143 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); }
break; break;
case 236: case 236:
#line 1145 "parser.y" #line 1144 "parser.y"
{ yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); }
break; break;
case 237: case 237:
#line 1146 "parser.y" #line 1145 "parser.y"
{ yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); }
break; break;
case 238: case 238:
#line 1147 "parser.y" #line 1146 "parser.y"
{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); } { yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); }
break; break;
case 239: case 239:
#line 1148 "parser.y" #line 1147 "parser.y"
{ yyval.ulval = bx_dbg_get_ip (); } { yyval.ulval = bx_dbg_get_ip (); }
break; break;
case 240: case 240:
#line 1149 "parser.y" #line 1148 "parser.y"
{ yyval.ulval = bx_dbg_get_eip(); } { yyval.ulval = bx_dbg_get_eip(); }
break; break;
case 241: case 241:
#line 1150 "parser.y" #line 1149 "parser.y"
{ yyval.ulval = bx_dbg_get_laddr (yyvsp[-2].ulval, yyvsp[0].ulval); } { yyval.ulval = bx_dbg_get_laddr (yyvsp[-2].ulval, yyvsp[0].ulval); }
break; break;
case 242: case 242:
#line 1151 "parser.y" #line 1150 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; }
break; break;
case 243: case 243:
#line 1152 "parser.y" #line 1151 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; }
break; break;
case 244: case 244:
#line 1153 "parser.y" #line 1152 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; }
break; break;
case 245: case 245:
#line 1154 "parser.y" #line 1153 "parser.y"
{ yyval.ulval = (yyvsp[0].ulval != 0) ? yyvsp[-2].ulval / yyvsp[0].ulval : 0; } { yyval.ulval = (yyvsp[0].ulval != 0) ? yyvsp[-2].ulval / yyvsp[0].ulval : 0; }
break; break;
case 246: case 246:
#line 1155 "parser.y" #line 1154 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; }
break; break;
case 247: case 247:
#line 1156 "parser.y" #line 1155 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; }
break; break;
case 248: case 248:
#line 1157 "parser.y" #line 1156 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; }
break; break;
case 249: case 249:
#line 1158 "parser.y" #line 1157 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; }
break; break;
case 250: case 250:
#line 1159 "parser.y" #line 1158 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; } { yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; }
break; break;
case 251: case 251:
#line 1160 "parser.y" #line 1159 "parser.y"
{ yyval.ulval = !yyvsp[0].ulval; } { yyval.ulval = !yyvsp[0].ulval; }
break; break;
case 252: case 252:
#line 1161 "parser.y" #line 1160 "parser.y"
{ yyval.ulval = -yyvsp[0].ulval; } { yyval.ulval = -yyvsp[0].ulval; }
break; break;
case 253: case 253:
#line 1162 "parser.y" #line 1161 "parser.y"
{ yyval.ulval = yyvsp[-1].ulval; } { yyval.ulval = yyvsp[-1].ulval; }
break; break;
@ -3237,7 +3236,7 @@ yyreduce:
} }
/* Line 999 of yacc.c. */ /* Line 999 of yacc.c. */
#line 3241 "y.tab.c" #line 3240 "y.tab.c"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
@ -3443,7 +3442,7 @@ yyreturn:
} }
#line 1165 "parser.y" #line 1164 "parser.y"
#endif /* if BX_DEBUGGER */ #endif /* if BX_DEBUGGER */

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: parser.y,v 1.12 2006-02-11 21:19:22 sshwarts Exp $ // $Id: parser.y,v 1.13 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
%{ %{
@ -1026,7 +1026,6 @@ help_command:
dbg_printf("show mode - show, when processor switch mode\n"); dbg_printf("show mode - show, when processor switch mode\n");
dbg_printf("show int - show, when interrupt is happens\n"); dbg_printf("show int - show, when interrupt is happens\n");
dbg_printf("show call - show, when call is happens\n"); dbg_printf("show call - show, when call is happens\n");
dbg_printf("show ret - show, when iret is happens\n");
dbg_printf("show off - toggles off symbolic info\n"); dbg_printf("show off - toggles off symbolic info\n");
dbg_printf("show dbg-all - turn on all show flags\n"); dbg_printf("show dbg-all - turn on all show flags\n");
dbg_printf("show dbg-none - turn off all show flags\n"); dbg_printf("show dbg-none - turn off all show flags\n");

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.128 2006-02-05 19:48:28 sshwarts Exp $ // $Id: cpu.cc,v 1.129 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -874,7 +874,7 @@ void BX_CPU_C::trap_debugger (bx_bool callnow)
#if BX_DEBUGGER #if BX_DEBUGGER
extern unsigned int dbg_show_mask; extern unsigned dbg_show_mask;
bx_bool BX_CPU_C::dbg_is_begin_instr_bpoint(Bit16u cs, bx_address eip, bx_address laddr, bx_bool is_32, bx_bool is_64) bx_bool BX_CPU_C::dbg_is_begin_instr_bpoint(Bit16u cs, bx_address eip, bx_address laddr, bx_bool is_32, bx_bool is_64)
{ {
@ -902,10 +902,10 @@ bx_bool BX_CPU_C::dbg_is_begin_instr_bpoint(Bit16u cs, bx_address eip, bx_addres
return(1); return(1);
} }
if( (BX_CPU_THIS_PTR show_flag) & (dbg_show_mask)) { // support for 'show' command in debugger
int rv; if(dbg_show_mask) {
if((rv = bx_dbg_symbolic_output())) int rv = bx_dbg_show_symbolic();
return(rv); if (rv) return(rv);
} }
// see if debugger is looking for iaddr breakpoint of any type // see if debugger is looking for iaddr breakpoint of any type

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.257 2006-01-31 19:45:33 sshwarts Exp $ // $Id: cpu.h,v 1.258 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -1181,8 +1181,7 @@ public: // for now...
Bit8u trace_reg; Bit8u trace_reg;
Bit8u mode_break; Bit8u mode_break;
bx_bool dbg_cpu_mode; /* contains current mode */ bx_bool dbg_cpu_mode; /* contains current mode */
bx_address show_eip; /* record eip at special instr f.ex eip */ unsigned show_flag;
Bit8u show_flag; /* shows instr class executed */
bx_guard_found_t guard_found; bx_guard_found_t guard_found;
#endif #endif
Bit8u trace; Bit8u trace;
@ -3297,16 +3296,6 @@ IMPLEMENT_EFLAG_ACCESSOR (TF, 8)
#define BxGroup16 BxGroupN #define BxGroup16 BxGroupN
// <TAG-DEFINES-DECODE-END> // <TAG-DEFINES-DECODE-END>
#if BX_DEBUGGER
typedef enum _show_flags {
Flag_call = 0x1,
Flag_ret = 0x2,
Flag_int = 0x4,
Flag_iret = 0x8,
Flag_intsig = 0x10
} show_flags_t;
#endif
// Can be used as LHS or RHS. // Can be used as LHS or RHS.
#define RMAddr(i) (BX_CPU_THIS_PTR address_xlation.rm_addr) #define RMAddr(i) (BX_CPU_THIS_PTR address_xlation.rm_addr)

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer16.cc,v 1.31 2005-10-17 13:06:09 sshwarts Exp $ // $Id: ctrl_xfer16.cc,v 1.32 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -399,7 +399,6 @@ void BX_CPU_C::IRET16(bxInstruction_c *i)
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret; BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = EIP;
#endif #endif
if (v8086_mode()) { if (v8086_mode()) {

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer32.cc,v 1.44 2005-10-17 13:06:09 sshwarts Exp $ // $Id: ctrl_xfer32.cc,v 1.45 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -393,7 +393,6 @@ void BX_CPU_C::IRET32(bxInstruction_c *i)
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret; BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = EIP;
#endif #endif
if (v8086_mode()) { if (v8086_mode()) {

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer64.cc,v 1.40 2005-11-11 22:02:42 sshwarts Exp $ // $Id: ctrl_xfer64.cc,v 1.41 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -306,7 +306,6 @@ void BX_CPU_C::IRET64(bxInstruction_c *i)
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret; BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = RIP;
#endif #endif
BX_ASSERT(protected_mode()); BX_ASSERT(protected_mode());

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: soft_int.cc,v 1.26 2005-10-13 16:22:21 sshwarts Exp $ // $Id: soft_int.cc,v 1.27 2006-02-12 20:21:36 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -73,7 +73,7 @@ void BX_CPU_C::INT1(bxInstruction_c *i)
// which is useful for an ICE system. // which is useful for an ICE system.
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int; BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif #endif
#if BX_EXTERNAL_DEBUGGER #if BX_EXTERNAL_DEBUGGER
@ -91,7 +91,7 @@ void BX_CPU_C::INT3(bxInstruction_c *i)
// INT 3 is not IOPL sensitive // INT 3 is not IOPL sensitive
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int; BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif #endif
interrupt(3, 1, 0, 0); interrupt(3, 1, 0, 0);
@ -104,7 +104,7 @@ void BX_CPU_C::INT3(bxInstruction_c *i)
void BX_CPU_C::INT_Ib(bxInstruction_c *i) void BX_CPU_C::INT_Ib(bxInstruction_c *i)
{ {
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int; BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif #endif
Bit8u vector = i->Ib(); Bit8u vector = i->Ib();
@ -151,7 +151,7 @@ void BX_CPU_C::INT_Ib(bxInstruction_c *i)
void BX_CPU_C::INTO(bxInstruction_c *i) void BX_CPU_C::INTO(bxInstruction_c *i)
{ {
#if BX_DEBUGGER #if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int; BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif #endif
if (get_OF()) { if (get_OF()) {