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.
@ -834,34 +834,42 @@ void bx_dbg_print_string_command(bx_address start_addr)
dbg_printf("\n");
}
static bx_address last_cr3;
static bx_bool last_cpu_mode = 0;
unsigned dbg_show_mask = 0;
unsigned int dbg_show_mask = 0;
// 0x80 print mode
// 0x40 print interrupts
// 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)
#define BX_DBG_SHOW_CALLRET (Flag_call|Flag_ret)
#define BX_DBG_SHOW_INT (Flag_softint|Flag_iret|Flag_intsig)
#define BX_DBG_SHOW_MODE (Flag_mode)
void bx_dbg_show_command(const char* arg)
{
if(arg) {
if (!strcmp(arg,"mode")){
dbg_show_mask = 0x80;
} else if (!strcmp(arg,"int")){
dbg_show_mask = 0xc0;
} else if(!strcmp(arg,"call")){
dbg_show_mask = 0xe0;
} else if(!strcmp(arg,"ret")){
dbg_show_mask = 0xe0;
if (!strcmp(arg, "mode")) {
if (dbg_show_mask & BX_DBG_SHOW_MODE) {
dbg_show_mask &= ~BX_DBG_SHOW_MODE;
dbg_printf("show mode switch: OFF\n");
} else {
dbg_show_mask |= BX_DBG_SHOW_MODE;
dbg_printf("show mode switch: ON\n");
}
} 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")){
dbg_show_mask = 0x0;
dbg_printf("Disable all show flags\n");
} else if(!strcmp(arg,"dbg-all")){
bx_dbg.floppy = 1;
bx_dbg.keyboard = 1;
@ -888,7 +896,7 @@ void bx_dbg_show_command(const char* arg)
bx_dbg.dma = 1;
bx_dbg.unsupported_io = 1;
/* 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;
} else if(!strcmp(arg,"dbg-none")){
bx_dbg.floppy = 0;
@ -916,34 +924,105 @@ void bx_dbg_show_command(const char* arg)
bx_dbg.dma = 0;
bx_dbg.unsupported_io = 0;
/* 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;
} else if(!strcmp(arg,"vga")){
DEV_vga_refresh();
return;
} 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;
}
} else {
dbg_printf("show mask is 0x%x\n", dbg_show_mask);
return;
}
// enable trace if any print is active
if(dbg_show_mask & 0xe0)
dbg_show_mask |= 0x1f;
if (dbg_show_mask) {
dbg_printf("show mask is:");
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");
}
}
// 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_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_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);
}
}
dbg_printf("show mask is 0x%x, cleared show_flag\n", dbg_show_mask);
BX_CPU(dbg_cpu)->show_flag = 0;
/* 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;
dbg_printf (FMT_TICK ": address %04x:" FMT_ADDRX " " FMT_ADDRX "\n\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);
return 0;
}
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;
}
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)
{
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.
@ -192,6 +192,15 @@ typedef enum
bkStepOver
} 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
extern int bxlex(void);
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_info_ivt_command(bx_num_range);
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);
char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base);
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,
873, 879, 885, 890, 895, 900, 905, 910, 915, 920,
925, 930, 935, 940, 945, 954, 963, 970, 983, 991,
1001, 1022, 1035, 1045, 1050, 1058, 1066, 1067, 1068, 1069,
1074, 1075, 1076, 1077, 1082, 1083, 1084, 1085, 1086, 1087,
1088, 1089, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101,
1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124,
1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134,
1135, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148,
1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158,
1159, 1160, 1161, 1162
1001, 1022, 1034, 1044, 1049, 1057, 1065, 1066, 1067, 1068,
1073, 1074, 1075, 1076, 1081, 1082, 1083, 1084, 1085, 1086,
1087, 1088, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100,
1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123,
1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133,
1134, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147,
1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157,
1158, 1159, 1160, 1161
};
#endif
@ -2948,7 +2948,6 @@ yyreduce:
dbg_printf("show mode - show, when processor switch mode\n");
dbg_printf("show int - show, when interrupt 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 dbg-all - turn on all show flags\n");
dbg_printf("show dbg-none - turn off all show flags\n");
@ -2957,7 +2956,7 @@ yyreduce:
break;
case 182:
#line 1036 "parser.y"
#line 1035 "parser.y"
{
dbg_printf("calc|? <expr> - calculate a expression and display the result.\n");
dbg_printf(" 'expr' can reference any general-purpose and segment\n");
@ -2970,7 +2969,7 @@ yyreduce:
break;
case 183:
#line 1046 "parser.y"
#line 1045 "parser.y"
{
bx_dbg_print_help();
free(yyvsp[-2].sval);free(yyvsp[-1].sval);
@ -2978,7 +2977,7 @@ yyreduce:
break;
case 184:
#line 1051 "parser.y"
#line 1050 "parser.y"
{
bx_dbg_print_help();
free(yyvsp[-1].sval);
@ -2986,7 +2985,7 @@ yyreduce:
break;
case 185:
#line 1059 "parser.y"
#line 1058 "parser.y"
{
bx_dbg_calc_command(yyvsp[-1].ulval);
free(yyvsp[-2].sval);
@ -2994,242 +2993,242 @@ yyreduce:
break;
case 189:
#line 1070 "parser.y"
#line 1069 "parser.y"
{ yyval.uval=yyvsp[0].uval; }
break;
case 193:
#line 1078 "parser.y"
#line 1077 "parser.y"
{ yyval.uval=yyvsp[0].uval; }
break;
case 201:
#line 1090 "parser.y"
#line 1089 "parser.y"
{ yyval.uval=yyvsp[0].uval; }
break;
case 209:
#line 1102 "parser.y"
#line 1101 "parser.y"
{ yyval.uval=yyvsp[0].uval; }
break;
case 210:
#line 1115 "parser.y"
#line 1114 "parser.y"
{ yyval.ulval = yyvsp[0].uval; }
break;
case 211:
#line 1116 "parser.y"
#line 1115 "parser.y"
{ yyval.ulval = yyvsp[0].ulval; }
break;
case 212:
#line 1117 "parser.y"
#line 1116 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); }
break;
case 213:
#line 1118 "parser.y"
#line 1117 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); }
break;
case 214:
#line 1119 "parser.y"
#line 1118 "parser.y"
{ yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); }
break;
case 215:
#line 1120 "parser.y"
#line 1119 "parser.y"
{ yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); }
break;
case 216:
#line 1121 "parser.y"
#line 1120 "parser.y"
{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); }
break;
case 217:
#line 1122 "parser.y"
#line 1121 "parser.y"
{ yyval.ulval = bx_dbg_get_ip (); }
break;
case 218:
#line 1123 "parser.y"
#line 1122 "parser.y"
{ yyval.ulval = bx_dbg_get_eip(); }
break;
case 219:
#line 1124 "parser.y"
#line 1123 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; }
break;
case 220:
#line 1125 "parser.y"
#line 1124 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; }
break;
case 221:
#line 1126 "parser.y"
#line 1125 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; }
break;
case 222:
#line 1127 "parser.y"
#line 1126 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval / yyvsp[0].ulval; }
break;
case 223:
#line 1128 "parser.y"
#line 1127 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; }
break;
case 224:
#line 1129 "parser.y"
#line 1128 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; }
break;
case 225:
#line 1130 "parser.y"
#line 1129 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; }
break;
case 226:
#line 1131 "parser.y"
#line 1130 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; }
break;
case 227:
#line 1132 "parser.y"
#line 1131 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; }
break;
case 228:
#line 1133 "parser.y"
#line 1132 "parser.y"
{ yyval.ulval = !yyvsp[0].ulval; }
break;
case 229:
#line 1134 "parser.y"
#line 1133 "parser.y"
{ yyval.ulval = -yyvsp[0].ulval; }
break;
case 230:
#line 1135 "parser.y"
#line 1134 "parser.y"
{ yyval.ulval = yyvsp[-1].ulval; }
break;
case 231:
#line 1140 "parser.y"
#line 1139 "parser.y"
{ yyval.ulval = yyvsp[0].uval; }
break;
case 232:
#line 1141 "parser.y"
#line 1140 "parser.y"
{ yyval.ulval = yyvsp[0].ulval; }
break;
case 233:
#line 1142 "parser.y"
#line 1141 "parser.y"
{ yyval.ulval = bx_dbg_get_symbol_value(yyvsp[0].sval); free(yyvsp[0].sval);}
break;
case 234:
#line 1143 "parser.y"
#line 1142 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8l_value(yyvsp[0].uval); }
break;
case 235:
#line 1144 "parser.y"
#line 1143 "parser.y"
{ yyval.ulval = bx_dbg_get_reg8h_value(yyvsp[0].uval); }
break;
case 236:
#line 1145 "parser.y"
#line 1144 "parser.y"
{ yyval.ulval = bx_dbg_get_reg16_value(yyvsp[0].uval); }
break;
case 237:
#line 1146 "parser.y"
#line 1145 "parser.y"
{ yyval.ulval = bx_dbg_get_reg32_value(yyvsp[0].uval); }
break;
case 238:
#line 1147 "parser.y"
#line 1146 "parser.y"
{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); }
break;
case 239:
#line 1148 "parser.y"
#line 1147 "parser.y"
{ yyval.ulval = bx_dbg_get_ip (); }
break;
case 240:
#line 1149 "parser.y"
#line 1148 "parser.y"
{ yyval.ulval = bx_dbg_get_eip(); }
break;
case 241:
#line 1150 "parser.y"
#line 1149 "parser.y"
{ yyval.ulval = bx_dbg_get_laddr (yyvsp[-2].ulval, yyvsp[0].ulval); }
break;
case 242:
#line 1151 "parser.y"
#line 1150 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; }
break;
case 243:
#line 1152 "parser.y"
#line 1151 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; }
break;
case 244:
#line 1153 "parser.y"
#line 1152 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; }
break;
case 245:
#line 1154 "parser.y"
#line 1153 "parser.y"
{ yyval.ulval = (yyvsp[0].ulval != 0) ? yyvsp[-2].ulval / yyvsp[0].ulval : 0; }
break;
case 246:
#line 1155 "parser.y"
#line 1154 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; }
break;
case 247:
#line 1156 "parser.y"
#line 1155 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; }
break;
case 248:
#line 1157 "parser.y"
#line 1156 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; }
break;
case 249:
#line 1158 "parser.y"
#line 1157 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; }
break;
case 250:
#line 1159 "parser.y"
#line 1158 "parser.y"
{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; }
break;
case 251:
#line 1160 "parser.y"
#line 1159 "parser.y"
{ yyval.ulval = !yyvsp[0].ulval; }
break;
case 252:
#line 1161 "parser.y"
#line 1160 "parser.y"
{ yyval.ulval = -yyvsp[0].ulval; }
break;
case 253:
#line 1162 "parser.y"
#line 1161 "parser.y"
{ yyval.ulval = yyvsp[-1].ulval; }
break;
@ -3237,7 +3236,7 @@ yyreduce:
}
/* Line 999 of yacc.c. */
#line 3241 "y.tab.c"
#line 3240 "y.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@ -3443,7 +3442,7 @@ yyreturn:
}
#line 1165 "parser.y"
#line 1164 "parser.y"
#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 int - show, when interrupt 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 dbg-all - turn on 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.
@ -874,7 +874,7 @@ void BX_CPU_C::trap_debugger (bx_bool callnow)
#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)
{
@ -902,10 +902,10 @@ bx_bool BX_CPU_C::dbg_is_begin_instr_bpoint(Bit16u cs, bx_address eip, bx_addres
return(1);
}
if( (BX_CPU_THIS_PTR show_flag) & (dbg_show_mask)) {
int rv;
if((rv = bx_dbg_symbolic_output()))
return(rv);
// support for 'show' command in debugger
if(dbg_show_mask) {
int rv = bx_dbg_show_symbolic();
if (rv) return(rv);
}
// 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.
@ -1180,9 +1180,8 @@ public: // for now...
Bit8u stop_reason;
Bit8u trace_reg;
Bit8u mode_break;
bx_bool dbg_cpu_mode; /* contains current mode */
bx_address show_eip; /* record eip at special instr f.ex eip */
Bit8u show_flag; /* shows instr class executed */
bx_bool dbg_cpu_mode; /* contains current mode */
unsigned show_flag;
bx_guard_found_t guard_found;
#endif
Bit8u trace;
@ -3297,16 +3296,6 @@ IMPLEMENT_EFLAG_ACCESSOR (TF, 8)
#define BxGroup16 BxGroupN
// <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.
#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.
@ -399,7 +399,6 @@ void BX_CPU_C::IRET16(bxInstruction_c *i)
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = EIP;
#endif
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.
@ -393,7 +393,6 @@ void BX_CPU_C::IRET32(bxInstruction_c *i)
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = EIP;
#endif
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.
@ -306,7 +306,6 @@ void BX_CPU_C::IRET64(bxInstruction_c *i)
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_iret;
BX_CPU_THIS_PTR show_eip = RIP;
#endif
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.
@ -73,7 +73,7 @@ void BX_CPU_C::INT1(bxInstruction_c *i)
// which is useful for an ICE system.
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int;
BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif
#if BX_EXTERNAL_DEBUGGER
@ -91,7 +91,7 @@ void BX_CPU_C::INT3(bxInstruction_c *i)
// INT 3 is not IOPL sensitive
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int;
BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif
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)
{
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int;
BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif
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)
{
#if BX_DEBUGGER
BX_CPU_THIS_PTR show_flag |= Flag_int;
BX_CPU_THIS_PTR show_flag |= Flag_softint;
#endif
if (get_OF()) {