- removed 'text_snapshot_check' feature and related BX_PASS loglevel

- documentation updates
This commit is contained in:
Volker Ruppert 2011-07-31 14:38:03 +00:00
parent 5e291e0860
commit c35e385139
12 changed files with 16 additions and 139 deletions

View File

@ -556,7 +556,6 @@ panic: action=ask
error: action=report error: action=report
info: action=report info: action=report
debug: action=ignore debug: action=ignore
#pass: action=fatal
#======================================================================= #=======================================================================
# DEBUGGER_LOG: # DEBUGGER_LOG:
@ -988,7 +987,6 @@ pci: enabled=1, chipset=i440fx
#======================================================================= #=======================================================================
#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log #load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log
#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img #load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img
#text_snapshot_check: enabled=1
#print_timestamps: enabled=1 #print_timestamps: enabled=1
#------------------------- #-------------------------

View File

@ -241,7 +241,7 @@ sound
dmatimer dmatimer
misc misc
text_snapshot_check port_e9_hack
gdbstub gdbstub
port port
text_base text_base
@ -273,4 +273,4 @@ wxdebug
user user
(subtree for user-defined options) (subtree for user-defined options)
(updated Jan 16, 2011 by vruppert) (updated July 31, 2011 by vruppert)

View File

@ -267,7 +267,6 @@ public:
void info(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); void info(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
void error(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); void error(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
void panic(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); void panic(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
void pass(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
void ldebug(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); void ldebug(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
void fatal (const char *prefix, const char *fmt, va_list ap, int exit_status); void fatal (const char *prefix, const char *fmt, va_list ap, int exit_status);
void ask (int level, const char *prefix, const char *fmt, va_list ap); void ask (int level, const char *prefix, const char *fmt, va_list ap);
@ -346,7 +345,6 @@ typedef class BOCHSAPI iofunctions iofunc_t;
#define BX_DEBUG(x) #define BX_DEBUG(x)
#define BX_ERROR(x) #define BX_ERROR(x)
#define BX_PANIC(x) (LOG_THIS panic) x #define BX_PANIC(x) (LOG_THIS panic) x
#define BX_PASS(x) (LOG_THIS pass) x
#define BX_ASSERT(x) #define BX_ASSERT(x)
@ -356,7 +354,6 @@ typedef class BOCHSAPI iofunctions iofunc_t;
#define BX_DEBUG(x) (LOG_THIS ldebug) x #define BX_DEBUG(x) (LOG_THIS ldebug) x
#define BX_ERROR(x) (LOG_THIS error) x #define BX_ERROR(x) (LOG_THIS error) x
#define BX_PANIC(x) (LOG_THIS panic) x #define BX_PANIC(x) (LOG_THIS panic) x
#define BX_PASS(x) (LOG_THIS pass) x
#if BX_ASSERT_ENABLE #if BX_ASSERT_ENABLE
#define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0) #define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0)

View File

@ -1658,13 +1658,6 @@ void bx_init_options()
"Debug messages written to i/o port 0xE9 will be displayed on console", "Debug messages written to i/o port 0xE9 will be displayed on console",
0); 0);
// text snapshot check panic
new bx_param_bool_c(misc,
"text_snapshot_check",
"Enable text snapshot check panic",
"Enable panic when text on screen matches snapchk.txt.\nUseful for regression testing.\nIn win32, turns off CR/LF in snapshots and cuts.",
0);
// GDB stub // GDB stub
menu = new bx_list_c(misc, "gdbstub", "GDB Stub Options"); menu = new bx_list_c(misc, "gdbstub", "GDB Stub Options");
menu->set_options(menu->SHOW_PARENT | menu->USE_BOX_TITLE); menu->set_options(menu->SHOW_PARENT | menu->USE_BOX_TITLE);
@ -2151,8 +2144,6 @@ static Bit32s parse_log_options(const char *context, char *loglev, char *param1)
if (!strcmp(loglev, "panic")) { if (!strcmp(loglev, "panic")) {
level = LOGLEV_PANIC; level = LOGLEV_PANIC;
} else if (!strcmp(loglev, "pass")) {
level = LOGLEV_PASS;
} else if (!strcmp(loglev, "error")) { } else if (!strcmp(loglev, "error")) {
level = LOGLEV_ERROR; level = LOGLEV_ERROR;
} else if (!strcmp(loglev, "info")) { } else if (!strcmp(loglev, "info")) {
@ -2582,13 +2573,6 @@ static int parse_line_formatted(const char *context, int num_params, char *param
if (parse_log_options(context, params[0], params[1]) < 0) { if (parse_log_options(context, params[0], params[1]) < 0) {
return -1; return -1;
} }
} else if (!strcmp(params[0], "pass")) {
if (num_params != 2) {
PARSE_ERR(("%s: pass directive malformed.", context));
}
if (parse_log_options(context, params[0], params[1]) < 0) {
return -1;
}
} else if (!strcmp(params[0], "error")) { } else if (!strcmp(params[0], "error")) {
if (num_params != 2) { if (num_params != 2) {
PARSE_ERR(("%s: error directive malformed.", context)); PARSE_ERR(("%s: error directive malformed.", context));
@ -2890,16 +2874,7 @@ static int parse_line_formatted(const char *context, int num_params, char *param
PARSE_ERR (("%s: keyboard_paste_delay not big enough!", context)); PARSE_ERR (("%s: keyboard_paste_delay not big enough!", context));
} }
} else if (!strcmp(params[0], "text_snapshot_check")) { } else if (!strcmp(params[0], "text_snapshot_check")) {
if (num_params != 2) { PARSE_ERR(("%s: the 'text_snapshot_check' feature has been removed.", context));
PARSE_ERR(("%s: text_snapshot_check directive: wrong # args.", context));
}
if (!strncmp(params[1], "enabled=", 8)) {
if (parse_param_bool(params[1], 8, BXPN_TEXT_SNAPSHOT_CHECK) < 0) {
PARSE_ERR(("%s: text_snapshot_check directive malformed.", context));
}
} else {
PARSE_ERR(("%s: text_snapshot_check directive malformed.", context));
}
} else if (!strcmp(params[0], "mouse")) { } else if (!strcmp(params[0], "mouse")) {
if (num_params < 2) { if (num_params < 2) {
PARSE_ERR(("%s: mouse directive malformed.", context)); PARSE_ERR(("%s: mouse directive malformed.", context));
@ -3798,8 +3773,6 @@ int bx_write_log_options(FILE *fp, bx_list_c *base)
io->getaction(logfunctions::get_default_action(LOGLEV_INFO))); io->getaction(logfunctions::get_default_action(LOGLEV_INFO)));
fprintf(fp, "debug: action=%s\n", fprintf(fp, "debug: action=%s\n",
io->getaction(logfunctions::get_default_action(LOGLEV_DEBUG))); io->getaction(logfunctions::get_default_action(LOGLEV_DEBUG)));
fprintf(fp, "pass: action=%s\n",
io->getaction(logfunctions::get_default_action(LOGLEV_PASS)));
return 0; return 0;
} }
@ -4048,7 +4021,6 @@ int bx_write_configuration(const char *rc, int overwrite)
fprintf(fp, "print_timestamps: enabled=%d\n", bx_dbg.print_timestamps); fprintf(fp, "print_timestamps: enabled=%d\n", bx_dbg.print_timestamps);
bx_write_debugger_options(fp); bx_write_debugger_options(fp);
fprintf(fp, "port_e9_hack: enabled=%d\n", SIM->get_param_bool(BXPN_PORT_E9_HACK)->get()); fprintf(fp, "port_e9_hack: enabled=%d\n", SIM->get_param_bool(BXPN_PORT_E9_HACK)->get());
fprintf(fp, "text_snapshot_check: enabled=%d\n", SIM->get_param_bool(BXPN_TEXT_SNAPSHOT_CHECK)->get());
fprintf(fp, "private_colormap: enabled=%d\n", SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get()); fprintf(fp, "private_colormap: enabled=%d\n", SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get());
#if BX_WITH_AMIGAOS #if BX_WITH_AMIGAOS
fprintf(fp, "fullscreen: enabled=%d\n", SIM->get_param_bool(BXPN_FULLSCREEN)->get()); fprintf(fp, "fullscreen: enabled=%d\n", SIM->get_param_bool(BXPN_FULLSCREEN)->get());

View File

@ -3963,12 +3963,12 @@ turns on this feature and 0 turns it off.
</para> </para>
</section> </section>
<section><title>i440fxsupport</title> <section><title>pci</title>
<para> <para>
Examples: Examples:
<screen> <screen>
i440fxsupport: enabled=1 # default if compiled with PCI support pci: enabled=1, chipset=i440fx # default if compiled with PCI support
i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
</screen> </screen>
This option controls the presence of the i440FX PCI chipset. You can also This option controls the presence of the i440FX PCI chipset. You can also
specify the devices connected to PCI slots. Up to 5 slots are available. specify the devices connected to PCI slots. Up to 5 slots are available.
@ -7264,7 +7264,7 @@ Bochs VBE Display Drivers for Windows NT/2000
# Enable CL-GD5446 PCI # Enable CL-GD5446 PCI
vga: extension=cirrus vga: extension=cirrus
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus
i440fxsupport: enabled=1, slot1=cirrus pci: enabled=1, chipset=i440fx, slot1=cirrus
</screen> </screen>
<note><para> <note><para>
@ -8637,15 +8637,14 @@ com1: enabled=0
# no sb16 # no sb16
boot: cdrom boot: cdrom
floppy_bootsig_check: disabled=0 floppy_bootsig_check: disabled=0
vga_update_interval: 300000 vga: update_freq=5
keyboard_serial_delay: 250 keyboard_serial_delay: 250
keyboard_paste_delay: 100000 keyboard_paste_delay: 100000
cpu: ips=3000000 cpu: ips=3000000
clock: sync=realtime, time0=0 clock: sync=realtime, time0=0
text_snapshot_check: 0
mouse: enabled=0 mouse: enabled=0
private_colormap: enabled=0 private_colormap: enabled=0
i440fxsupport: enabled=0 pci: enabled=0
# no ne2k # no ne2k
# no loader # no loader
log: osr5.log log: osr5.log
@ -8655,7 +8654,6 @@ panic: action=ask
error: action=report error: action=report
info: action=report info: action=report
debug: action=ignore debug: action=ignore
pass: action=fatal
keyboard_mapping: enabled=0, map= keyboard_mapping: enabled=0, map=
keyboard_type: mf keyboard_type: mf
user_shortcut: keys=none user_shortcut: keys=none

View File

@ -1,5 +1,5 @@
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com" .\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
.TH bochsrc 5 "11 Jul 2011" "bochsrc" "The Bochs Project" .TH bochsrc 5 "31 Jul 2011" "bochsrc" "The Bochs Project"
.\"SKIP_SECTION" .\"SKIP_SECTION"
.SH NAME .SH NAME
bochsrc \- Configuration file for Bochs. bochsrc \- Configuration file for Bochs.
@ -823,14 +823,14 @@ Example:
private_colormap: enabled=1 private_colormap: enabled=1
.TP .TP
.I "i440fxsupport:" .I "pci:"
This option controls the presence of the i440FX PCI chipset. You can This option controls the presence of the i440FX PCI chipset. You can
also specify the devices connected to PCI slots. Up to 5 slots are also specify the devices connected to PCI slots. Up to 5 slots are
available now. These devices are currently supported: cirrus, es1370, ne2k, available now. These devices are currently supported: cirrus, es1370, ne2k,
pcivga, pcidev, pcipnic and usb_ohci. pcivga, pcidev, pcipnic and usb_ohci.
Example: Example:
i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
.TP .TP
.I "pcidev:" .I "pcidev:"

View File

@ -238,10 +238,6 @@ void bx_gui_c::init(int argc, char **argv, unsigned tilewidth, unsigned tileheig
BX_GRAVITY_RIGHT, userbutton_handler); BX_GRAVITY_RIGHT, userbutton_handler);
BX_GUI_THIS set_tooltip(BX_GUI_THIS user_hbar_id, "Send keyboard shortcut"); BX_GUI_THIS set_tooltip(BX_GUI_THIS user_hbar_id, "Send keyboard shortcut");
if (SIM->get_param_bool(BXPN_TEXT_SNAPSHOT_CHECK)->get()) {
bx_pc_system.register_timer(this, bx_gui_c::snapshot_checker, (unsigned) 1000000, 1, 1, "snap_chk");
}
BX_GUI_THIS charmap_updated = 0; BX_GUI_THIS charmap_updated = 0;
if (!BX_GUI_THIS new_gfx_api && (BX_GUI_THIS framebuffer == NULL)) { if (!BX_GUI_THIS new_gfx_api && (BX_GUI_THIS framebuffer == NULL)) {
@ -388,9 +384,7 @@ Bit32s bx_gui_c::make_text_snapshot(char **snapshot, Bit32u *length)
} }
while ((txt_addr > 0) && (clean_snap[txt_addr-1] == ' ')) txt_addr--; while ((txt_addr > 0) && (clean_snap[txt_addr-1] == ' ')) txt_addr--;
#ifdef WIN32 #ifdef WIN32
if(! SIM->get_param_bool(BXPN_TEXT_SNAPSHOT_CHECK)->get()) { clean_snap[txt_addr++] = 13;
clean_snap[txt_addr++] = 13;
}
#endif #endif
clean_snap[txt_addr++] = 10; clean_snap[txt_addr++] = 10;
} }
@ -419,53 +413,6 @@ void bx_gui_c::copy_handler(void)
free(text_snapshot); free(text_snapshot);
} }
// Check the current text snapshot against file snapchk.txt.
void bx_gui_c::snapshot_checker(void *this_ptr)
{
char filename[BX_PATHNAME_LEN];
strcpy(filename,"snapchk.txt");
FILE *fp = fopen(filename, "rb");
if(fp) {
char *text_snapshot;
Bit32u len;
if (make_text_snapshot (&text_snapshot, &len) < 0) {
return;
}
char *compare_snapshot = (char *) malloc((len+1) * sizeof(char));
fread(compare_snapshot, 1, len, fp);
fclose(fp);
strcpy(filename,"snapmask.txt");
fp=fopen(filename, "rb");
if(fp) {
char *mask_snapshot = (char *) malloc((len+1) * sizeof(char));
unsigned i;
bx_bool flag = 1;
fread(mask_snapshot, 1, len, fp);
fclose(fp);
for(i=0;i<len;i++) {
if((text_snapshot[i] != compare_snapshot[i]) &&
(compare_snapshot[i] == mask_snapshot[i])) {
flag = 0;
break;
}
}
if(flag) {
if(!memcmp(text_snapshot,compare_snapshot,len)) {
BX_PASS(("Test Passed."));
} else {
BX_PASS(("Test Passed with Mask."));
}
}
} else {
if(!memcmp(text_snapshot,compare_snapshot,len)) {
BX_PASS(("Test Passed."));
}
}
free(compare_snapshot);
free(text_snapshot);
}
}
// create a text snapshot and dump it to a file // create a text snapshot and dump it to a file
void bx_gui_c::snapshot_handler(void) void bx_gui_c::snapshot_handler(void)
{ {

View File

@ -161,7 +161,6 @@ protected:
static void copy_handler(void); static void copy_handler(void);
static void paste_handler(void); static void paste_handler(void);
static void snapshot_handler(void); static void snapshot_handler(void);
static void snapshot_checker(void *);
static void config_handler(void); static void config_handler(void);
static void userbutton_handler(void); static void userbutton_handler(void);
static void save_restore_handler(void); static void save_restore_handler(void);

View File

@ -1062,9 +1062,6 @@ bx_bool bx_real_sim_c::restore_logopts()
type = LOGLEV_ERROR; type = LOGLEV_ERROR;
} else if (!strncmp(string, "PANIC=", 6)) { } else if (!strncmp(string, "PANIC=", 6)) {
type = LOGLEV_PANIC; type = LOGLEV_PANIC;
} else if (!strncmp(string, "PASS=", 5)) {
type = LOGLEV_PASS;
j = 5;
} }
if (!strcmp(string+j, "ignore")) { if (!strcmp(string+j, "ignore")) {
action = ACT_IGNORE; action = ACT_IGNORE;

View File

@ -154,7 +154,6 @@ typedef enum {
LOGLEV_INFO, LOGLEV_INFO,
LOGLEV_ERROR, LOGLEV_ERROR,
LOGLEV_PANIC, LOGLEV_PANIC,
LOGLEV_PASS,
N_LOGLEV N_LOGLEV
} bx_log_levels; } bx_log_levels;

View File

@ -39,8 +39,7 @@ const char* iofunctions::getlevel(int i)
"DEBUG", "DEBUG",
"INFO", "INFO",
"ERROR", "ERROR",
"PANIC", "PANIC"
"PASS"
}; };
if (i>=0 && i<N_LOGLEV) return loglevel[i]; if (i>=0 && i<N_LOGLEV) return loglevel[i];
@ -186,7 +185,6 @@ void iofunctions::out(int level, const char *prefix, const char *fmt, va_list ap
switch (level) { switch (level) {
case LOGLEV_INFO: c='i'; break; case LOGLEV_INFO: c='i'; break;
case LOGLEV_PANIC: c='p'; break; case LOGLEV_PANIC: c='p'; break;
case LOGLEV_PASS: c='s'; break;
case LOGLEV_ERROR: c='e'; break; case LOGLEV_ERROR: c='e'; break;
case LOGLEV_DEBUG: c='d'; break; case LOGLEV_DEBUG: c='d'; break;
default: break; default: break;
@ -230,8 +228,6 @@ void iofunctions::out(int level, const char *prefix, const char *fmt, va_list ap
if(level==LOGLEV_PANIC) if(level==LOGLEV_PANIC)
fprintf(logfd, ">>PANIC<< "); fprintf(logfd, ">>PANIC<< ");
if(level==LOGLEV_PASS)
fprintf(logfd, ">>PASS<< ");
vfprintf(logfd, fmt, ap); vfprintf(logfd, fmt, ap);
fprintf(logfd, "\n"); fprintf(logfd, "\n");
@ -276,11 +272,10 @@ int logfunctions::default_onoff[N_LOGLEV] =
ACT_REPORT, // report info ACT_REPORT, // report info
ACT_REPORT, // report error ACT_REPORT, // report error
#if BX_WITH_WX || BX_WITH_WIN32 || BX_WITH_X11 #if BX_WITH_WX || BX_WITH_WIN32 || BX_WITH_X11
ACT_ASK, // on panic, ask user what to do ACT_ASK // on panic, ask user what to do
#else #else
ACT_FATAL, // on panic, quit ACT_FATAL // on panic, quit
#endif #endif
ACT_FATAL
}; };
logfunctions::logfunctions(void) logfunctions::logfunctions(void)
@ -406,30 +401,6 @@ void logfunctions::panic(const char *fmt, ...)
va_end(ap); va_end(ap);
} }
void logfunctions::pass(const char *fmt, ...)
{
va_list ap;
assert(logio != NULL);
// Special case for panics since they are so important. Always print
// the panic to the log, no matter what the log action says.
//if(!onoff[LOGLEV_PASS]) return;
va_start(ap, fmt);
logio->out(LOGLEV_PASS, prefix, fmt, ap);
// This fixes a funny bug on linuxppc where va_list is no pointer but a struct
va_end(ap);
va_start(ap, fmt);
if (onoff[LOGLEV_PASS] == ACT_ASK)
ask(LOGLEV_PASS, prefix, fmt, ap);
if (onoff[LOGLEV_PASS] == ACT_FATAL)
fatal(prefix, fmt, ap, 101);
va_end(ap);
}
void logfunctions::ldebug(const char *fmt, ...) void logfunctions::ldebug(const char *fmt, ...)
{ {
va_list ap; va_list ap;

View File

@ -162,7 +162,6 @@
#define BXPN_ES1370_ENABLED "sound.es1370.enabled" #define BXPN_ES1370_ENABLED "sound.es1370.enabled"
#define BXPN_ES1370_WAVEDEV "sound.es1370.wavedev" #define BXPN_ES1370_WAVEDEV "sound.es1370.wavedev"
#define BXPN_PORT_E9_HACK "misc.port_e9_hack" #define BXPN_PORT_E9_HACK "misc.port_e9_hack"
#define BXPN_TEXT_SNAPSHOT_CHECK "misc.text_snapshot_check"
#define BXPN_GDBSTUB "misc.gdbstub" #define BXPN_GDBSTUB "misc.gdbstub"
#define BXPN_PLUGIN_CTRL "misc.plugin_ctrl" #define BXPN_PLUGIN_CTRL "misc.plugin_ctrl"
#define BXPN_LOG_FILENAME "log.filename" #define BXPN_LOG_FILENAME "log.filename"