From 45df735c307d4824e995e7204f571dce64620ba8 Mon Sep 17 00:00:00 2001 From: Alexander Krisak Date: Mon, 4 Aug 2003 16:03:09 +0000 Subject: [PATCH] Apply Vitaly's Vorobyov debugger patch --- bochs/bochs.h | 3 +- bochs/config.h.in | 14 +- bochs/configure | 168 +- bochs/configure.in | 22 +- bochs/cpu/cpu.cc | 22 +- bochs/cpu/debugstuff.cc | 12 +- bochs/debug/dbg_main.cc | 1388 ++++++++++++---- bochs/debug/debug.h | 57 +- bochs/debug/lexer.c | 1232 ++++++++------ bochs/debug/lexer.l | 101 +- bochs/debug/parser.c | 2035 ++++++++++++++++------- bochs/debug/parser.h | 218 ++- bochs/debug/parser.y | 323 +++- bochs/disasm/dis_decode.cc | 170 +- bochs/disasm/dis_groups.cc | 58 +- bochs/disasm/disasm.h | 8 +- bochs/instrument/example0/instrument.cc | 4 +- bochs/instrument/example1/instrument.cc | 4 +- bochs/iodev/iodev.h | 5 +- bochs/iodev/pic.cc | 18 +- bochs/iodev/pic.h | 4 +- bochs/main.cc | 12 +- bochs/plugin.h | 3 +- 23 files changed, 4188 insertions(+), 1693 deletions(-) diff --git a/bochs/bochs.h b/bochs/bochs.h index 7bdd54c0e..17300aa0d 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bochs.h,v 1.122 2003-07-28 13:55:20 vruppert Exp $ +// $Id: bochs.h,v 1.123 2003-08-04 16:03:01 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -77,6 +77,7 @@ extern "C" { #include #include #include +#include #ifdef macintosh # define SuperDrive "[fd:]" #endif diff --git a/bochs/config.h.in b/bochs/config.h.in index f9f402d79..799f7a7d5 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -83,6 +83,9 @@ // adds support for the GNU readline library in the debugger command // prompt. +#define HAVE_LOCALE_H 0 +// Define to 1 if you have + // I rebuilt the code which provides timers to IO devices. // Setting this to 1 will introduce a little code which // will panic out if cases which shouldn't happen occur. @@ -821,9 +824,18 @@ typedef // set if your compiler does not allow label at the end of a {} block #define BX_NO_BLANK_LABELS 0 -// set if you don't have , used in debug/dbg_main.c +// set if you don't have , used in debug/dbg_main.c #define BX_HAVE_HASH_MAP 0 +// set if you don't have , used in debug/dbg_main.c +#define BX_HAVE_HASH_MAP_H 0 + +// set if you don't have , used in debug/dbg_main.c +#define BX_HAVE_SET 0 + +// set if you don't have , used in debug/dbg_main.c +#define BX_HAVE_SET_H 0 + // Support x86 hardware debugger registers and facilites. // These are the debug facilites offered by the x86 architecture, // not the optional built-in debugger. diff --git a/bochs/configure b/bochs/configure index 93126e62e..1c52e47cc 100755 --- a/bochs/configure +++ b/bochs/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in,v 1.218 2003/07/06 11:46:31 vruppert Exp . +# From configure.in Id: configure.in,v 1.219 2003/07/13 23:30:55 vruppert Exp . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # @@ -1124,7 +1124,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -1502,8 +1502,6 @@ build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -test -z "$build_alias" && - build_alias=$ac_cv_build echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 @@ -1526,8 +1524,6 @@ host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -test -z "$host_alias" && - host_alias=$ac_cv_host echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 @@ -1557,9 +1553,6 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- -test -z "$target_alias" && - target_alias=$ac_cv_target - if test "$with_win32_vcpp"; then echo "WARNING: The --with-win32-vcpp option will be treated as:" @@ -4219,7 +4212,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4222 "configure"' > conftest.$ac_ext + echo '#line 4215 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4769,7 +4762,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:4765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -6600,7 +6593,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking for hash_map... $ECHO_C" >&6 + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + cat >>confdefs.h <<\_ACEOF +#define BX_HAVE_HASH_MAP 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: checking for hash_map.h" >&5 echo $ECHO_N "checking for hash_map.h... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -15420,7 +15460,101 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF -#define BX_HAVE_HASH_MAP 1 +#define BX_HAVE_HASH_MAP_H 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: checking for set" >&5 +echo $ECHO_N "checking for set... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + cat >>confdefs.h <<\_ACEOF +#define BX_HAVE_SET 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: checking for set.h" >&5 +echo $ECHO_N "checking for set.h... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + cat >>confdefs.h <<\_ACEOF +#define BX_HAVE_SET_H 1 _ACEOF @@ -24381,7 +24515,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` diff --git a/bochs/configure.in b/bochs/configure.in index fc78def69..74f5620d1 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(bochs.h) -AC_REVISION([[$Id: configure.in,v 1.219 2003-07-13 23:30:55 vruppert Exp $]]) +AC_REVISION([[$Id: configure.in,v 1.220 2003-08-04 16:03:08 akrisak Exp $]]) AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(ltdlconf.h) @@ -248,11 +248,29 @@ AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;], AC_LANG_SAVE AC_LANG_CPLUSPLUS +AC_MSG_CHECKING(for hash_map) +AC_TRY_COMPILE([#include ], [], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(BX_HAVE_HASH_MAP) + ], AC_MSG_RESULT(no)) AC_MSG_CHECKING(for hash_map.h) AC_TRY_COMPILE([#include ], [], [ AC_MSG_RESULT(yes) - AC_DEFINE(BX_HAVE_HASH_MAP) + AC_DEFINE(BX_HAVE_HASH_MAP_H) + ], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(for set) +AC_TRY_COMPILE([#include ], [], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(BX_HAVE_SET) + ], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(for set.h) +AC_TRY_COMPILE([#include ], [], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(BX_HAVE_SET_H) ], AC_MSG_RESULT(no)) AC_LANG_RESTORE diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index d074d36fa..ed8792558 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.cc,v 1.79 2003-06-07 19:16:52 vruppert Exp $ +// $Id: cpu.cc,v 1.80 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -672,8 +672,8 @@ BX_CPU_C::handleAsyncEvent(void) if ( (dr6_bits = hwdebug_compare(iaddr, 1, BX_HWDebugInstruction, BX_HWDebugInstruction)) ) { // Add to the list of debug events thus far. - BX_CPU_THIS_PTR debug_trap |= dr6_bits; BX_CPU_THIS_PTR async_event = 1; + BX_CPU_THIS_PTR debug_trap |= dr6_bits; // If debug events are not inhibited on this boundary, // fire off a debug fault. Otherwise handle it on the next // boundary. (becomes a trap) @@ -695,7 +695,11 @@ BX_CPU_C::handleAsyncEvent(void) if ( !(BX_CPU_INTR || BX_CPU_THIS_PTR debug_trap || BX_HRQ || - BX_CPU_THIS_PTR get_TF ()) ) + BX_CPU_THIS_PTR get_TF () +#if BX_X86_DEBUGGER + || (BX_CPU_THIS_PTR dr7 & 0xff) +#endif + )) BX_CPU_THIS_PTR async_event = 0; return 0; // Continue executing cpu_loop. @@ -762,8 +766,7 @@ BX_CPU_C::prefetch(void) BX_CPU_THIS_PTR eipPageBias = - eipPageOffset0; BX_CPU_THIS_PTR eipPageWindowSize = 4096; // FIXME: BX_CPU_THIS_PTR pAddrA20Page = pAddr & 0xfffff000; - BX_CPU_THIS_PTR eipFetchPtr = - BX_CPU_THIS_PTR mem->getHostMemAddr(this, BX_CPU_THIS_PTR pAddrA20Page, + BX_CPU_THIS_PTR eipFetchPtr=BX_CPU_THIS_PTR mem->getHostMemAddr(this, BX_CPU_THIS_PTR pAddrA20Page, BX_READ); // Sanity checks @@ -921,7 +924,8 @@ BX_CPU_C::dbg_is_begin_instr_bpoint(Bit32u cs, Bit32u eip, Bit32u laddr, if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_VIR) { if (BX_CPU_THIS_PTR guard_found.icount!=0) { for (unsigned i=0; iprotectedMode) { // 16bit & 32bit protected mode + Base=BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.base; + } + else { + Base=BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value<<4; + } + dbg_xlate_linear2phy(BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.base + offset, &phy_addr, &valid); if (valid && BX_CPU_THIS_PTR mem!=NULL) { BX_CPU_THIS_PTR mem->dbg_fetch_mem(phy_addr, 16, instr_buf); isize = bx_disassemble.disasm( BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b, + Base, EIP, instr_buf, char_buf); for (unsigned j=0; j> %02x", (unsigned) instr_buf[j])); diff --git a/bochs/debug/dbg_main.cc b/bochs/debug/dbg_main.cc index 6cd9fe4a9..b2642d42d 100644 --- a/bochs/debug/dbg_main.cc +++ b/bochs/debug/dbg_main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: dbg_main.cc,v 1.103 2003-08-04 13:36:15 sshwarts Exp $ +// $Id: dbg_main.cc,v 1.104 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -60,6 +60,7 @@ bx_param_bool_c *sim_running; static void bx_dbg_usage(void); static char bx_debug_rc_fname[BX_MAX_PATH]; static char tmp_buf[512]; +static char tmp_buf_prev[512]; static char *tmp_buf_ptr; static char *argv0 = NULL; @@ -242,6 +243,9 @@ bx_dbg_main(int argc, char *argv[]) char **sim2_argv = NULL; argc = 1; + setbuf (stdout, NULL); + setbuf (stderr, NULL); + bx_dbg_batch_dma.this_many = 1; bx_dbg_batch_dma.Qsize = 0; @@ -476,9 +480,13 @@ bx_dbg_user_input_loop(void) SIM->refresh_ci (); SIM->set_display_mode (DISP_MODE_CONFIG); bx_get_command(); - if ( (*tmp_buf_ptr == '\n') || (*tmp_buf_ptr == 0) ) { - if (bx_infile_stack_index == 0) - dbg_printf ( "\n"); +reparse: + if ((*tmp_buf_ptr == '\n') || (*tmp_buf_ptr == 0)) + { + if ((*tmp_buf_prev != '\n') && (*tmp_buf_prev != 0)) { + strncpy(tmp_buf, tmp_buf_prev, sizeof(tmp_buf_prev)); + goto reparse; + } } else if ( (strncmp(tmp_buf_ptr, BX_INCLUDE_CMD, include_cmd_len) == 0) && (tmp_buf_ptr[include_cmd_len] == ' ' || @@ -558,14 +566,15 @@ bx_get_command(void) charptr_ret = &tmp_buf[0]; } } else { - charptr_ret = fgets(tmp_buf, 512, + charptr_ret = fgets(tmp_buf, sizeof(tmp_buf), bx_infile_stack[bx_infile_stack_index].fp); } #else /* !HAVE_LIBREADLINE */ else { if (bx_infile_stack_index == 0) dbg_printf ( "%s", prompt); - charptr_ret = fgets(tmp_buf, 512, + strncpy(tmp_buf_prev, tmp_buf, sizeof(tmp_buf)); + charptr_ret = fgets(tmp_buf, sizeof(tmp_buf), bx_infile_stack[bx_infile_stack_index].fp); } #endif @@ -705,8 +714,6 @@ bx_debug_break () bx_guard.interrupt_requested = 1; } - - void bx_dbg_exit(int code) { @@ -791,7 +798,7 @@ bx_dbg_timebp_command(bx_bool absolute, Bit64u time) Bit64u diff = (absolute) ? time - bx_pc_system.time_ticks() : time; Bit64u abs_time = (absolute) ? time : time + bx_pc_system.time_ticks(); - if (diff < 0) { + if (time < bx_pc_system.time_ticks()) { dbg_printf ( "Request for time break point in the past. I can't let you do that.\n"); return; } @@ -1291,7 +1298,7 @@ enter_playback_entry() Bit64u diff = time - last_playback_time; last_playback_time = time; - if (diff < 0) { + if (time < last_playback_time) { BX_PANIC(("Negative diff in playback")); } else if (diff == 0) { playback_entry.trigger(); @@ -1319,30 +1326,30 @@ void bx_dbg_print_stack_command(int nwords) { // Get linear address for stack top - Bit32u sp = (BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.d_b)? - BX_CPU(dbg_cpu)->get_ESP () - : BX_CPU(dbg_cpu)->get_SP (); - Bit32u linear_sp = sp + BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.base; + bool UseESP=BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.d_b; + Bit32u linear_sp = BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.base+ + (UseESP?BX_CPU(dbg_cpu)->get_ESP():BX_CPU(dbg_cpu)->get_SP()); Bit8u buf[8]; for (int i = 0; i < nwords; i++) { Bit32u paddr; bx_bool paddr_valid; - BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(sp, &paddr, &paddr_valid); + BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(linear_sp, &paddr, &paddr_valid); if (paddr_valid) { - if (BX_MEM(0)->dbg_fetch_mem(paddr, 2, buf)) - dbg_printf ( " %08x [%08x] %04x\n", linear_sp, paddr, (int)buf[0] | ((int)buf[1] << 8)); + if (BX_MEM(0)->dbg_fetch_mem(paddr, (UseESP?4:2), buf)) + dbg_printf ( " %08x [%08x] %04x\n", linear_sp, paddr, + (Bit32u)buf[0] | ((Bit32u)buf[1] << 8) | + (UseESP?(((Bit32u)buf[2] << 16) | ((Bit32u)buf[3] << 24)):0)); else - dbg_printf ( " %08x [%08x] \n", paddr, linear_sp); + dbg_printf ( " %08x [%08x] \n", linear_sp, paddr); } else { dbg_printf ( " %08x \n", linear_sp); } - sp += 2; - linear_sp += 2; + linear_sp += (UseESP?4:2); } } -#if !BX_HAVE_HASH_MAP +#if !((BX_HAVE_HASH_MAP || BX_HAVE_HASH_MAP_H) && (BX_HAVE_SET || BX_HAVE_SET_H)) static char *BX_HAVE_HASH_MAP_ERR = "context not implemented because BX_HAVE_HASH_MAP=0\n"; char* @@ -1370,15 +1377,50 @@ bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset) dbg_printf ( BX_HAVE_HASH_MAP_ERR); } +void +bx_dbg_info_symbols_command(char *Symbol) +{ + dbg_printf ( BX_HAVE_HASH_MAP_ERR); +} + +int +bx_dbg_lbreakpoint_symbol_command(char *Symbol) +{ + dbg_printf ( BX_HAVE_HASH_MAP_ERR); + return -1; +} + +Bit32u +bx_dbg_get_symbol_value(const char *Symbol) +{ + return 0; +} + +char* +bx_dbg_disasm_symbolic_address(Bit32u eip, Bit32u base) +{ + return 0; +} + #else /* if BX_HAVE_HASH_MAP == 1 */ /* Haven't figured out how to port this code to OSF1 cxx compiler. Until a more portable solution is found, at least make it easy to disable the template code: just set BX_HAVE_HASH_MAP=0 in config.h */ - +#if BX_HAVE_HASH_MAP +#include +#elif BX_HAVE_HASH_MAP_H #include +#endif + +#if BX_HAVE_SET +#include +#elif BX_HAVE_SET_H #include +#endif + +using namespace std; struct symbol_entry_t { @@ -1400,16 +1442,30 @@ struct lt_symbol_entry_t } }; +struct lt_rsymbol_entry_t +{ + bool operator()(const symbol_entry_t* s1, const symbol_entry_t* s2) const + { + return strcoll(s1->name, s2->name) < 0; + } +}; + struct context_t { context_t (Bit32u); + ~context_t(); static context_t* get_context(Bit32u); symbol_entry_t* get_symbol_entry(Bit32u); + symbol_entry_t* get_symbol_entry(const char *Symbol) const; void add_symbol(symbol_entry_t*); - + const set* get_all_symbols() const {return syms;} + const set* get_all_rsymbols() const {return rsyms;} private: static hash_map* map; + // Forvard references (find name by address) set* syms; + // Reverse references (find address by name) + set* rsyms; Bit32u id; }; @@ -1419,9 +1475,26 @@ context_t::context_t (Bit32u _id) { id = _id; syms = new set; + rsyms = new set; (*map)[id] = this; } +context_t::~context_t() +{ + set::iterator iter; + if(syms) { + for(iter=syms->begin();iter!=syms->end();++iter) + if(*iter) + delete *iter; + } + + if(rsyms) { + for(iter=rsyms->begin();iter!=rsyms->end();++iter) + if(*iter) + delete *iter; + } +} + context_t* context_t::get_context(Bit32u i) { @@ -1436,24 +1509,53 @@ context_t::get_symbol_entry(Bit32u ip) // find the first symbol whose address is greater than ip. if (syms->empty ()) return 0; set::iterator iter = syms->upper_bound(&probe); - if (iter == syms->end()) { - // return the last symbol - return *iter; - } else if (iter == syms->begin()) { - // ip is before the first symbol. Return no symbol. + + if (iter == syms->end()) { // No symbol found return 0; - } else { - // return previous symbol, so that the reported address is - // prev_symbol+offset. - iter--; - return *iter; } + + return *(--iter); +} + +symbol_entry_t* +context_t::get_symbol_entry(const char *Symbol) const +{ + symbol_entry_t probe; + probe.name=(char *)Symbol; + + if (rsyms->empty ()) + return 0; + + set::const_iterator iter; + iter=rsyms->find(&probe); + if(iter==rsyms->end()) // No symbol found + return 0; + return *iter; } void context_t::add_symbol(symbol_entry_t* sym) { syms->insert(sym); + rsyms->insert(sym); +} + +Bit32u +bx_dbg_get_symbol_value(char *Symbol) +{ + context_t* cntx = context_t::get_context(0); + if(!cntx) // Context not found + return 0; + + if (Symbol[0]=='\"') Symbol++; + int len = strlen(Symbol); + if (Symbol[len - 1] == '\"') Symbol[len - 1] = '\0'; + + symbol_entry_t* sym=cntx->get_symbol_entry(Symbol); + if(!sym) // Symbol not found + return 0; + + return sym->start; } char* @@ -1479,13 +1581,33 @@ bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base) return buf; } } - - symbol_entry_t* entr = cntx->get_symbol_entry(eip); + // full linear address not only eip (for nonzero based segments) + symbol_entry_t* entr = cntx->get_symbol_entry(base+eip); if (!entr) { snprintf (buf, 80, "no symbol"); return buf; } - snprintf (buf, 80, "%s+%x", entr->name, eip - entr->start); + snprintf (buf, 80, "%s+%x", entr->name, (base+eip) - entr->start); + return buf; +} + +char* +bx_dbg_disasm_symbolic_address(Bit32u eip, Bit32u base) +{ + static char buf[80]; + + // Try global context + context_t* cntx = context_t::get_context(0); + if (!cntx) { + return 0; + } + + // full linear address not only eip (for nonzero based segments) + symbol_entry_t* entr = cntx->get_symbol_entry(base+eip); + if (!entr) { + return 0; + } + snprintf (buf, 80, "%s+%x", entr->name, (base+eip) - entr->start); return buf; } @@ -1520,7 +1642,7 @@ bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset) : new context_t((BX_CPU(dbg_cpu)->cr3) >> 12); } - FILE* fp = fopen(filename, "r"); + FILE* fp = fopen(filename, "rt"); // 't' is need for win32, unixes simply ignore it if (!fp) { dbg_printf ( "Could not open symbol file '%s'\n", filename); return; @@ -1529,6 +1651,7 @@ bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset) while (fgets(buf, 200, fp)) { // Parse char* sym_name = buf; + for (int i = 0; i < 200 && buf[i]; i++) { if (buf[i] == ' ') { buf[i] = '\0'; @@ -1547,6 +1670,90 @@ bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset) cntx->add_symbol(sym); } } + +// chack if s1 is prefix of s2 +static bool +bx_dbg_strprefix(const char *s1, const char *s2) +{ + if(!s1 || !s2) + return false; + + int len=strlen(s1); + + if(len>strlen(s2)) + return false; + return strncmp(s1, s2, len)==0; +} + +void +bx_dbg_info_symbols_command(char *Symbol) +{ + context_t* cntx = context_t::get_context(0); + + if(!cntx) { + dbg_printf ( "Global context not available\n"); + return; + } + + if(Symbol) { + const set* rsyms; + + rsyms=cntx->get_all_rsymbols(); + if (rsyms->empty ()) { + dbg_printf ( "Symbols not loaded\n"); + return; + } + // remove leading and trailing quotas + if (Symbol[0]=='\"') Symbol++; + int len = strlen(Symbol); + if (Symbol[len - 1] == '\"') Symbol[len - 1] = '\0'; + + symbol_entry_t probe; + probe.name=Symbol; + set::const_iterator iter; + iter=rsyms->lower_bound(&probe); + + if(iter==rsyms->end() || !bx_dbg_strprefix(Symbol, (*iter)->name)) + dbg_printf ( "No symbols found\n"); + else + for(;iter!=rsyms->end() && bx_dbg_strprefix(Symbol, (*iter)->name);++iter) { + dbg_printf ( "%08x: %s\n", (*iter)->start, (*iter)->name); + } + } + else { + const set* syms; + + syms=cntx->get_all_symbols(); + if (syms->empty ()) { + dbg_printf ( "Symbols not loaded\n"); + return; + } + + set::const_iterator iter; + for(iter = syms->begin();iter!=syms->end();++iter) { + dbg_printf ( "%08x: %s\n", (*iter)->start, (*iter)->name); + } + } +} + +int +bx_dbg_lbreakpoint_symbol_command(char *Symbol) +{ + context_t* cntx = context_t::get_context(0); + if(!cntx) { + dbg_printf ( "Global context not available\n"); + return -1; + } + if (Symbol[0]=='\"') Symbol++; + int len = strlen(Symbol); + if (Symbol[len - 1] == '\"') Symbol[len - 1] = '\0'; + + const symbol_entry_t* sym=cntx->get_symbol_entry(Symbol); + if(sym) + return bx_dbg_lbreakpoint_command(bkRegular, sym->start); + dbg_printf ( "Symbol not found\n"); + return -1; +} #endif int num_write_watchpoints = 0; @@ -2190,10 +2397,19 @@ void bx_dbg_disassemble_current (int which_cpu, int print_time) if (valid) { unsigned ilen; + Bit32u Base; BX_CPU(which_cpu)->mem->dbg_fetch_mem(phy, 16, bx_disasm_ibuf); + + if (BX_CPU(which_cpu)->protectedMode) { // 16bit & 32bit protected mode + Base=BX_CPU(which_cpu)->sregs[BX_SEG_REG_CS].cache.u.segment.base; + } + else { + Base=BX_CPU(which_cpu)->sregs[BX_SEG_REG_CS].selector.value<<4; + } + ilen = bx_disassemble.disasm(BX_CPU(which_cpu)->guard_found.is_32bit_code, - BX_CPU(which_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf); + Base, BX_CPU(which_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf); // Note: it would be nice to display only the modified registers here, the easy // way out I have thought of would be to keep a prev_eax, prev_ebx, etc copies @@ -2228,14 +2444,14 @@ void bx_dbg_disassemble_current (int which_cpu, int print_time) dbg_printf ( "(%u).[" FMT_LL "d] ", which_cpu, bx_pc_system.time_ticks()); else dbg_printf ( "(%u) ", which_cpu); - if (BX_CPU(which_cpu)->guard_found.is_32bit_code) { + if (BX_CPU(which_cpu)->protectedMode) { // 16bit & 32bit protected mode dbg_printf ( "[0x%08x] %04x:%08x (%s): ", phy, (unsigned) BX_CPU(which_cpu)->guard_found.cs, (unsigned) BX_CPU(which_cpu)->guard_found.eip, bx_dbg_symbolic_address((BX_CPU(which_cpu)->cr3) >> 12, BX_CPU(which_cpu)->guard_found.eip, BX_CPU(which_cpu)->sregs[BX_SEG_REG_CS].cache.u.segment.base)); } - else { + else { // Real & V86 mode dbg_printf ( "[0x%08x] %04x:%04x (%s): ", phy, (unsigned) BX_CPU(which_cpu)->guard_found.cs, @@ -2280,6 +2496,7 @@ for (sim=0; simguard_found.iaddr_index; + if (bx_guard.iaddr.lin[i].bpoint_id != 0) dbg_printf ( "(%u) Breakpoint %u, 0x%x in ?? ()\n", sim, bx_guard.iaddr.lin[i].bpoint_id, @@ -2360,50 +2577,21 @@ bx_dbg_breakpoint_changed(void) } void -bx_dbg_del_breakpoint_command(unsigned handle) +bx_dbg_en_dis_breakpoint_command(unsigned handle, bx_bool enable) { - unsigned i; - #if BX_DBG_SUPPORT_VIR_BPOINT - // see if breakpoint is a virtual breakpoint - for (i=0; i= BX_DBG_MAX_VIR_BPOINTS) { dbg_printf ( "Error: no more virtual breakpoint slots left.\n"); dbg_printf ( "Error: see BX_DBG_MAX_VIR_BPOINTS.\n"); - return; + return -1; } bx_guard.iaddr.vir[bx_guard.iaddr.num_virtual].cs = cs; bx_guard.iaddr.vir[bx_guard.iaddr.num_virtual].eip = eip; bx_guard.iaddr.vir[bx_guard.iaddr.num_virtual].bpoint_id = bx_debugger.next_bpoint_id++; + int BpId = (int)bx_guard.iaddr.vir[bx_guard.iaddr.num_virtual].bpoint_id; + bx_guard.iaddr.vir[bx_guard.iaddr.num_virtual].enabled=1; bx_guard.iaddr.num_virtual++; bx_guard.guard_for |= BX_DBG_GUARD_IADDR_VIR; + return BpId; #else dbg_printf ( "Error: virtual breakpoint support not compiled in.\n"); dbg_printf ( "Error: see BX_DBG_SUPPORT_VIR_BPOINT.\n"); + return -1; #endif } - void -bx_dbg_lbreakpoint_command(bx_bool specific, Bit32u laddress) + int +bx_dbg_lbreakpoint_command(BreakpointKind bk, Bit32u laddress) { #if BX_DBG_SUPPORT_LIN_BPOINT - if (specific == 0) { - dbg_printf ( "Error: lbreak without address not implemented yet.\n"); - return; + if (bk == bkAtIP) { + dbg_printf ( "Error: lbreak of this kind not implemented yet.\n"); + return -1; } if (bx_guard.iaddr.num_linear >= BX_DBG_MAX_LIN_BPOINTS) { dbg_printf ( "Error: no more linear breakpoint slots left.\n"); dbg_printf ( "Error: see BX_DBG_MAX_LIN_BPOINTS.\n"); - return; + return -1; } bx_guard.iaddr.lin[bx_guard.iaddr.num_linear].addr = laddress; - bx_guard.iaddr.lin[bx_guard.iaddr.num_linear].bpoint_id = bx_debugger.next_bpoint_id++; + int BpId = (bk == bkStepOver) ? 0 : bx_debugger.next_bpoint_id++; + bx_guard.iaddr.lin[bx_guard.iaddr.num_linear].bpoint_id = BpId; + bx_guard.iaddr.lin[bx_guard.iaddr.num_linear].enabled=1; bx_guard.iaddr.num_linear++; bx_guard.guard_for |= BX_DBG_GUARD_IADDR_LIN; + return BpId; #else dbg_printf ( "Error: linear breakpoint support not compiled in.\n"); dbg_printf ( "Error: see BX_DBG_SUPPORT_LIN_BPOINT.\n"); + return -1; #endif } - void -bx_dbg_pbreakpoint_command(bx_bool specific, Bit32u paddress) + int +bx_dbg_pbreakpoint_command(BreakpointKind bk, Bit32u paddress) { #if BX_DBG_SUPPORT_PHY_BPOINT - if (specific == 0) { - dbg_printf ( "Error: pbreak without address not implemented yet.\n"); - return; + if (bk != bkRegular) { + dbg_printf ( "Error: pbreak of this kind not implemented yet.\n"); + return -1; } if (bx_guard.iaddr.num_physical >= BX_DBG_MAX_PHY_BPOINTS) { dbg_printf ( "Error: no more physical breakpoint slots left.\n"); dbg_printf ( "Error: see BX_DBG_MAX_PHY_BPOINTS.\n"); - return; + return -1; } bx_guard.iaddr.phy[bx_guard.iaddr.num_physical].addr = paddress; bx_guard.iaddr.phy[bx_guard.iaddr.num_physical].bpoint_id = bx_debugger.next_bpoint_id++; + int BpId = (int)bx_guard.iaddr.phy[bx_guard.iaddr.num_physical].bpoint_id; + bx_guard.iaddr.phy[bx_guard.iaddr.num_physical].enabled=1; bx_guard.iaddr.num_physical++; bx_guard.guard_for |= BX_DBG_GUARD_IADDR_PHY; - + return BpId; #else dbg_printf ( "Error: physical breakpoint support not compiled in.\n"); dbg_printf ( "Error: see BX_DBG_SUPPORT_PHY_BPOINT.\n"); + return -1; #endif } @@ -2505,7 +2831,7 @@ bx_dbg_info_bpoints_command(void) dbg_printf ( "%3u ", bx_guard.iaddr.vir[i].bpoint_id); dbg_printf ( "vbreakpoint "); dbg_printf ( "keep "); - dbg_printf ( "y "); + dbg_printf ( bx_guard.iaddr.vir[i].enabled?"y ":"n "); dbg_printf ( "0x%04x:0x%08x\n", bx_guard.iaddr.vir[i].cs, bx_guard.iaddr.vir[i].eip); @@ -2517,7 +2843,7 @@ bx_dbg_info_bpoints_command(void) dbg_printf ( "%3u ", bx_guard.iaddr.lin[i].bpoint_id); dbg_printf ( "lbreakpoint "); dbg_printf ( "keep "); - dbg_printf ( "y "); + dbg_printf ( bx_guard.iaddr.lin[i].enabled?"y ":"n "); dbg_printf ( "0x%08x\n", bx_guard.iaddr.lin[i].addr); } @@ -2528,7 +2854,7 @@ bx_dbg_info_bpoints_command(void) dbg_printf ( "%3u ", bx_guard.iaddr.phy[i].bpoint_id); dbg_printf ( "pbreakpoint "); dbg_printf ( "keep "); - dbg_printf ( "y "); + dbg_printf ( bx_guard.iaddr.phy[i].enabled?"y ":"n "); dbg_printf ( "0x%08x\n", bx_guard.iaddr.phy[i].addr); } @@ -2750,13 +3076,25 @@ bx_print_char (Bit8u ch) dbg_printf (" \\x%02X", ch); } + void +dbg_printf_binary (char *format, Bit32u data, int bits) +{ + int b,len = 0; + char num[33]; + + for (b = 1 << (bits - 1); b; b >>= 1) + num [len++] = (data & b) ? '1' : '0'; + num [len] = 0; + dbg_printf (format, num); +} + void bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, Bit32u addr, bx_bool addr_passed, int simulator) { unsigned repeat_count, i; char ch, display_format, unit_size; - bx_bool iteration; + bx_bool iteration, memory_dump = false; unsigned data_size; bx_bool paddr_valid; Bit32u paddr; @@ -2764,8 +3102,6 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, Bit16u data16; Bit32u data32; unsigned columns, per_line, offset; - unsigned char digit; - unsigned biti; bx_bool is_linear; unsigned char databuf[8]; @@ -2834,9 +3170,8 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, display_format = bx_debugger.default_display_format; unit_size = bx_debugger.default_unit_size; - for (i=0; i<=1; i++) { - if (ch==0) break; // bail on null character - switch (ch) { + for (i = 0; format [i]; i++) { + switch (ch = format [i]) { case 'x': // hex case 'd': // signed decimal case 'u': // unsigned decimal @@ -2854,13 +3189,16 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, case 'g': // giant words (8 bytes) unit_size = ch; break; + + case 'm': // memory dump + memory_dump = true; + break; + default: - dbg_printf ( "dbg_examine: invalid format passed.\n"); + dbg_printf ( "dbg_examine: invalid format passed. \'%c\'\n", ch); bx_dbg_exit(1); break; } - format++; - ch = *format; } // store current options as default @@ -2886,6 +3224,25 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, per_line = 0; offset = 0; + if (memory_dump) { + if (display_format == 'c') { + // Display character dump in lines of 64 characters + unit_size = 'b'; + data_size = 1; + per_line = 64; + } + else + switch (unit_size) { + case 'b': data_size = 1; per_line = 16; break; + case 'h': data_size = 2; per_line = 8; break; + case 'w': data_size = 4; per_line = 4; break; + //case 'g': data_size = 8; per_line = 2; break; + } + // binary format is quite large + if (display_format == 't') + per_line /= 4; + } + else switch (unit_size) { case 'b': data_size = 1; per_line = 8; break; case 'h': data_size = 2; per_line = 8; break; @@ -2901,10 +3258,19 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, // if not 1st run, need a newline from last line if (i!=1) dbg_printf ( "\n"); - dbg_printf ( "0x%x :", addr, offset); + if (memory_dump) + dbg_printf ( "%08X ", addr ); + else + dbg_printf ( "0x%08x :", addr, offset); columns = 1; } + /* Put a space in the middle of dump, for readability */ + if ((columns - 1) == per_line / 2 + && memory_dump + && display_format != 'c') + dbg_printf (" "); + if (is_linear) { BX_CPU(simulator)->dbg_xlate_linear2phy(addr, &paddr, &paddr_valid); if (!paddr_valid) { @@ -2924,22 +3290,23 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, switch (data_size) { case 1: data8 = databuf[0]; + if (memory_dump) + switch (display_format) { + case 'd': dbg_printf ("%03d ", data8); break; + case 'u': dbg_printf ("%03u ", data8); break; + case 'o': dbg_printf ("%03o ", data8); break; + case 't': dbg_printf_binary ("%s ", data8, 8); break; + case 'c': dbg_printf ("%c", isprint(data8) ? data8 : '.'); break; + default : dbg_printf ("%02X ", data8); break; + } + else switch (display_format) { case 'x': dbg_printf ( "\t0x%02x", (unsigned) data8); break; case 'd': dbg_printf ( "\t%d", (int) (Bit8s) data8); break; case 'u': dbg_printf ( "\t%u", (unsigned) data8); break; case 'o': dbg_printf ( "\t%o", (unsigned) data8); break; - case 't': - fputc('\t', stderr); - for (biti=7; ; biti--) { - digit = (data8 >> biti) & 0x01; - fputc(digit + '0', stderr); - if (biti==0) break; - } - break; - case 'c': - bx_print_char (data8); - break; + case 't': dbg_printf_binary ("\t%s", data8, 8); break; + case 'c': bx_print_char (data8); break; } break; @@ -2949,19 +3316,21 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, #else data16 = (databuf[1]<<8) | databuf[0]; #endif + if (memory_dump) + switch (display_format) { + case 'd': dbg_printf ("%05d ", data16); break; + case 'u': dbg_printf ("%05u ", data16); break; + case 'o': dbg_printf ("%06o ", data16); break; + case 't': dbg_printf_binary ("%s ", data16, 16); break; + default : dbg_printf ("%04X ", data16); break; + } + else switch (display_format) { case 'x': dbg_printf ( "\t0x%04x", (unsigned) data16); break; case 'd': dbg_printf ( "\t%d", (int) (Bit16s) data16); break; case 'u': dbg_printf ( "\t%u", (unsigned) data16); break; case 'o': dbg_printf ( "\t%o", (unsigned) data16); break; - case 't': - fputc('\t', stderr); - for (biti=15; ; biti--) { - digit = (data16 >> biti) & 0x01; - fputc(digit + '0', stderr); - if (biti==0) break; - } - break; + case 't': dbg_printf_binary ("\t%s", data16, 16); break; case 'c': bx_print_char (data16>>8); bx_print_char (data16 & 0xff); @@ -2976,19 +3345,21 @@ bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, data32 = (databuf[3]<<24) | (databuf[2]<<16) | (databuf[1]<<8) | databuf[0]; #endif + if (memory_dump) + switch (display_format) { + case 'd': dbg_printf ("%10d ", data32); break; + case 'u': dbg_printf ("%10u ", data32); break; + case 'o': dbg_printf ("%12o ", data32); break; + case 't': dbg_printf_binary ("%s ", data32, 32); break; + default : dbg_printf ("%08X ", data32); break; + } + else switch (display_format) { case 'x': dbg_printf ( "\t0x%08x", (unsigned) data32); break; case 'd': dbg_printf ( "\t%d", (int) (Bit32s) data32); break; case 'u': dbg_printf ( "\t%u", (unsigned) data32); break; case 'o': dbg_printf ( "\t%o", (unsigned) data32); break; - case 't': - fputc('\t', stderr); - for (biti=31; ; biti--) { - digit = (data32 >> biti) & 0x01; - fputc(digit + '0', stderr); - if (biti==0) break; - } - break; + case 't': dbg_printf_binary ("\t%s", data32, 32); break; case 'c': bx_print_char (0xff & (data32>>24)); bx_print_char (0xff & (data32>>16)); @@ -3041,7 +3412,7 @@ bx_dbg_setpmem_command(Bit32u addr, unsigned len, Bit32u val) void bx_dbg_set_symbol_command(char *symbol, Bit32u val) { - bx_bool is_OK; + bx_bool is_OK = false; symbol++; // get past '$' if ( !strcmp(symbol, "eax") ) { @@ -3393,21 +3764,38 @@ scanf_error: } void -bx_dbg_disassemble_command(bx_num_range range) +bx_dbg_disassemble_command(const char *format, bx_num_range range) { #if BX_DISASM bx_bool paddr_valid; - Bit32u paddr; + Bit32u paddr, Base; unsigned ilen; + int numlines = INT_MAX; - if (range.to == EMPTY_ARG) { - // should set to cs:eip. FIXME - BX_INFO(("Error: type 'disassemble ADDR' or 'disassemble ADDR:ADDR'")); - return; + if (range.from == EMPTY_ARG) { + range.from = bx_dbg_get_laddr(bx_dbg_get_selector_value(1), BX_CPU(dbg_cpu)->get_EIP()); + range.to = range.from; } + if (format) { + // format always begins with '/' (checked in lexer) + // so we won't bother checking it here second time. + numlines = atoi(format + 1); + if (range.to == range.from) + range.to = BX_MAX_BIT64S; // Disassemble just X lines + } +/* + if (BX_CPU(dbg_cpu)->protectedMode) { // 16bit & 32bit protected mode + Base=BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_CS].cache.u.segment.base; + } + else { + Base=BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_CS].selector.value<<4; + } +*/ do { - BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(range.from, &paddr, &paddr_valid); + numlines--; + + BX_CPU(dbg_cpu)->dbg_xlate_linear2phy((Bit32u)range.from, &paddr, &paddr_valid); if (paddr_valid) { unsigned dis_size = bx_debugger.disassemble_size; @@ -3418,9 +3806,12 @@ bx_dbg_disassemble_command(bx_num_range range) } BX_MEM(0)->dbg_fetch_mem(paddr, 16, bx_disasm_ibuf); ilen = bx_disassemble.disasm(dis_size==32, - range.from, bx_disasm_ibuf, bx_disasm_tbuf); + 0, (Bit32u)range.from, bx_disasm_ibuf, bx_disasm_tbuf); + + char *Sym=bx_dbg_disasm_symbolic_address(range.from, 0); dbg_printf ( "%08x: ", (unsigned) range.from); + dbg_printf ( "(%20s): ", Sym?Sym:""); dbg_printf ( "%-25s ; ", bx_disasm_tbuf); for (unsigned j=0; j 0); #else + UNUSED(format); UNUSED(range); #endif // #if BX_DISASM -} - -//NOTE simple minded maths logic - void -bx_dbg_maths_command(char *command, int data1, int data2) -{ - if(strcmp(command,"add") == 0) - { - dbg_printf (" %x + %x = %x ", data1, data2, data1+data2); - } - else if(strcmp(command,"sub") == 0) - { - dbg_printf (" %x - %x = %x ", data1, data2, data1-data2); - } - else if(strcmp(command,"mul") == 0) - { - dbg_printf (" %x * %x = %x ", data1, data2, data1*data2); - } - else if(strcmp(command,"div") == 0) - { - dbg_printf (" %x / %x = %x ", data1, data2, data1/data2); - } - dbg_printf ("\n"); -} - -//FIXME HanishKVC requires better error checking in POST FIX expression -//NOTE Uses POST FIX EXPRESSION handling for better maths - void -bx_dbg_maths_expression_command(char *expr) -{ - int data1, data2, res; - int biti,digit; - char *next_token; - - dbg_printf ("%s\n",expr); - - expr++; // skip " in the string token passed - while(expr[0] == ' ')expr++; // skip any spaces following the " - - next_token = strtok(expr," "); - if(next_token == NULL) return; - data1 = res = strtol(next_token,NULL,0); - do - { - switch(next_token[0]) - { - case '+': - res = data1+data2; - dbg_printf (" %x + %x = %x ",data1,data2,res); - data1 = res; - break; - case '-': - res = data1-data2; - dbg_printf (" %x - %x = %x ",data1,data2,res); - data1 = res; - break; - case '*': - res = data1*data2; - dbg_printf (" %x * %x = %x ",data1,data2,res); - data1 = res; - break; - case '/': - res = data1/data2; - dbg_printf (" %x / %x = %x ",data1,data2,res); - data1 = res; - break; - case '&': - res = data1 & data2; - dbg_printf (" %x & %x = %x ",data1,data2,res); - data1 = res; - break; - case '|': - res = data1 | data2; - dbg_printf (" %x | %x = %x ",data1,data2,res); - data1 = res; - break; - case '~': - res = ~data1; - dbg_printf (" ~ %x = %x ",data1,res); - data1 = res; - break; - default: - data2 = strtol(next_token,NULL,0); - break; - } - next_token = strtok(NULL," "); - if(next_token == NULL) break; - }while(1); - dbg_printf ("\n"); - //FIXME HanishKVC If sizeof changes from a Byte addressed to - // Word addressed machine & so on then the logic - // below requires to be updated - dbg_printf (" Binary of %x : ",res); - for(biti=(sizeof(int)*8)-1; ; biti--) - { - digit = (res >> biti) & 0x01; - fputc(digit + '0', stderr); - if(biti==0) break; - if((biti%4) == 0) fputc(' ',stderr); - } - dbg_printf ("\n"); -} - - void -bx_dbg_v2l_command(unsigned seg_no, Bit32u offset) -{ -#if BX_NUM_SIMULATORS > 1 - dbg_printf ( "Error: v2l not supported for nsim > 1\n" -#else - bx_dbg_sreg_t sreg; - Bit32u laddr; - - if (seg_no > 5) { - dbg_printf ( "Error: seg_no out of bounds\n"); - return; - } - BX_CPU(dbg_cpu)->dbg_get_sreg(&sreg, seg_no); - if (!sreg.valid) { - dbg_printf ( "Error: segment valid bit cleared\n"); - return; - } - laddr = (sreg.des_l>>16) | - ((sreg.des_h<<16)&0x00ff0000) | - (sreg.des_h & 0xff000000); - laddr += offset; - - dbg_printf ( "laddr: 0x%x (%u)\n", - (unsigned) laddr, (unsigned) laddr); -#endif } void @@ -3791,7 +4054,7 @@ void bx_dbg_print_descriptor (unsigned char desc[8], int verbose) break; default: // task, int, trap, or call gate. - dbg_printf ( "target=%04x:%08x, DPL=%d", segment, offset, dpl); + dbg_printf ( "target=0x%04x:0x%08x, DPL=%d", segment, offset, dpl); } } dbg_printf ( "\n"); @@ -3811,12 +4074,12 @@ bx_dbg_info_idt_command(bx_num_range range) { } if (print_table) dbg_printf ( "Interrupt Descriptor Table (0x%08x):\n", cpu.idtr.base); - for (n = range.from; n<=range.to; n++) { + for (n = (int)range.from; n<=(int)range.to; n++) { Bit32u paddr; bx_bool paddr_valid; BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(cpu.idtr.base + 8*n, &paddr, &paddr_valid); if (!paddr_valid) { - dbg_printf ( "error: IDTR+8*%d points to invalid linear address %p\n", + dbg_printf ( "error: IDTR+8*%d points to invalid linear address 0x%-08x\n", n, cpu.idtr.base); return; } @@ -3826,7 +4089,7 @@ bx_dbg_info_idt_command(bx_num_range range) { dbg_printf ( "IDT[0x%02x]=", n); bx_dbg_print_descriptor (entry, 0); } - if (print_table) dbg_printf ( "You can list individual entries with 'info idt NUM' or groups with 'info idt NUM:NUM'\n"); + if (print_table) dbg_printf ( "You can list individual entries with 'info idt NUM' or groups with 'info idt NUMNUM'\n"); } void @@ -3842,12 +4105,12 @@ bx_dbg_info_gdt_command(bx_num_range range) { } if (print_table) dbg_printf ( "Global Descriptor Table (0x%08x):\n", cpu.gdtr.base); - for (n = range.from; n<=range.to; n++) { + for (n = (int)range.from; n<=(int)range.to; n++) { Bit32u paddr; bx_bool paddr_valid; BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(cpu.gdtr.base + 8*n, &paddr, &paddr_valid); if (!paddr_valid) { - dbg_printf ( "error: GDTR+8*%d points to invalid linear address %p\n", + dbg_printf ( "error: GDTR+8*%d points to invalid linear address 0x%-08x\n", n, cpu.gdtr.base); return; } @@ -3867,11 +4130,64 @@ bx_dbg_info_ldt_command(bx_num_range n) { dbg_printf ( "Local Descriptor Table output not implemented\n"); } +static void +bx_dbg_print_tss (unsigned char *tss, int len) +{ + if (len<104) { + dbg_printf ("Invalid tss length (limit must be greater then 103)\n"); + return; + } + + dbg_printf ("ss:esp(0): 0x%04x:0x%08x\n", + *(Bit16u*)(tss+8), *(Bit32u*)(tss+4)); + dbg_printf ("ss:esp(1): 0x%04x:0x%08x\n", + *(Bit16u*)(tss+0x10), *(Bit32u*)(tss+0xc)); + dbg_printf ("ss:esp(2): 0x%04x:0x%08x\n", + *(Bit16u*)(tss+0x18), *(Bit32u*)(tss+0x14)); + dbg_printf ("cr3: 0x%08x\n", *(Bit32u*)(tss+0x1c)); + dbg_printf ("eip: 0x%08x\n", *(Bit32u*)(tss+0x20)); + dbg_printf ("eflags: 0x%08x\n", *(Bit32u*)(tss+0x24)); + + dbg_printf ("cs: 0x%04x ds: 0x%04x ss: 0x%04x\n", + *(Bit16u*)(tss+76), *(Bit16u*)(tss+84), *(Bit16u*)(tss+80)); + dbg_printf ("es: 0x%04x fs: 0x%04x gs: 0x%04x\n", + *(Bit16u*)(tss+72), *(Bit16u*)(tss+88), *(Bit16u*)(tss+92)); + + dbg_printf ("eax: 0x%08x ebx: 0x%08x ecx: 0x%08x edx: 0x%08x\n", + *(Bit32u*)(tss+0x28), *(Bit32u*)(tss+0x34), *(Bit32u*)(tss+0x2c), *(Bit32u*)(tss+0x30)); + dbg_printf ("esi: 0x%08x edi: 0x%08x ebp: 0x%08x esp: 0x%08x\n", + *(Bit32u*)(tss+0x40), *(Bit32u*)(tss+0x44), *(Bit32u*)(tss+0x3c), *(Bit32u*)(tss+0x38)); + + dbg_printf ("ldt: 0x%04x\n", *(Bit16u*)(tss+0x60)); + dbg_printf ("i/o map: 0x%04x\n", *(Bit16u*)(tss+0x66)); +} + void -bx_dbg_info_tss_command(bx_num_range n) { +bx_dbg_info_tss_command(bx_num_range range) { bx_dbg_cpu_t cpu; BX_CPU(0)->dbg_get_cpu(&cpu); - dbg_printf ( "TSS output not implemented\n"); + + int print_table = 0; + if (range.to == EMPTY_ARG) { + // show all entries + Bit32u laddr = (cpu.tr.des_l>>16) | + ((cpu.tr.des_h<<16)&0x00ff0000) | + (cpu.tr.des_h & 0xff000000); + Bit32u len = (cpu.tr.des_l & 0xffff) + 1; + + dbg_printf ( "tr:s=0x%x, base=0x%x, valid=%u\n", + (unsigned) cpu.tr.sel, laddr, (unsigned) cpu.tr.valid); + + Bit32u paddr; + bx_bool paddr_valid; + BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(laddr, &paddr, &paddr_valid); + + bx_dbg_print_tss(BX_MEM(0)->vector+paddr, len); + + range.from = 0; + range.to = (cpu.gdtr.limit) / 8; + print_table = 1; + } } bx_num_range @@ -3945,6 +4261,15 @@ bx_dbg_info_ne2k(int page, int reg) #endif } +/* + * this implements the info pic command in the debugger. + * info pic - shows pic registers + */ +void +bx_dbg_info_pic() +{ + DEV_pic_show_pic_state(); +} // // Reports from various events // @@ -4824,6 +5149,7 @@ bx_dbg_info_ivt_command(bx_num_range r) unsigned char buff[4]; Bit16u seg; Bit16u off; + int tail = 0; BX_CPU(dbg_cpu)->dbg_get_cpu(&cpu); @@ -4831,6 +5157,7 @@ bx_dbg_info_ivt_command(bx_num_range r) { if ((r.from == -1L) && (r.to == -1L)) { r.from = 0; r.to = 255; + tail = 1; } else if (r.to == r.from) { r.to = r.from + 1L; @@ -4846,6 +5173,7 @@ bx_dbg_info_ivt_command(bx_num_range r) #endif dbg_printf("INT# %02x > %04X:%04X (%08X) %s\n", i, seg, off, cpu.idtr.base + ((seg << 4) + off), bx_dbg_ivt_desc(i)); } + if (tail == 1) dbg_printf ( "You can list individual entries with 'info ivt NUM' or groups with 'info ivt NUM NUM'\n"); } else dbg_printf("cpu in protected mode, use info idt\n"); @@ -4860,20 +5188,26 @@ bx_dbg_help_command(char* command) if (command == NULL) { dbg_printf("help - show list of debugger commands\n"); - dbg_printf("help \"command\" - show short command description\n"); - dbg_printf("debugger commands are:\n"); - dbg_printf("help, quit, q, c, stepi, si, step, s, vbreak, v, lbreak, lb, pbreak, pb, break\n"); - dbg_printf("b, delete, del, d, xp, x, setpmem, crc, info, set, dump_cpu, set_cpu, disas\n"); - dbg_printf("disassemble, instrument, trace-on, trace-off, ptime, sb, sba, record, playback\n"); - dbg_printf("print-stack, watch, unwatch, load-symbols, show, modebp\n"); + dbg_printf("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(" record, playback, load-symbols, slist\n"); + dbg_printf("-*- Execution control -*-\n"); + dbg_printf(" c|cont, s|step|stepi, p|n|next, modebp\n"); + dbg_printf("-*- Breakpoint management -*-\n"); + dbg_printf(" v|vbreak, lb|lbreak, pb|pbreak|b|break, sb, sba, blist,\n"); + dbg_printf(" bpe, bpd, d|del|delete\n"); + dbg_printf("-*- CPU and memory contents -*-\n"); + dbg_printf(" x, xp, u|disas|disassemble, r|reg|registers, setpmem, crc, info, dump_cpu,\n"); + dbg_printf(" set_cpu, ptime, print-stack, watch, unwatch, ?|calc\n"); } else { p = command; - for (; *p != 0 && *p != '\"'; p++); p++; - for (; *p != 0 && *p != '\"'; p++); *p = 0; + for (; *p != 0 && *p != '\"' && *p != '\''; p++); p++; + for (; *p != 0 && *p != '\"' && *p != '\''; p++); *p = 0; p = command; - for (; *p != 0 && *p != '\"'; p++); p++; + for (; *p != 0 && *p != '\"' && *p != '\''; p++); p++; dbg_printf("help %s\n", p); @@ -4888,19 +5222,26 @@ bx_dbg_help_command(char* command) dbg_printf("%s - quit debugger and execution\n", p); } else - if (strcmp(p, "c") == 0) + if ((strcmp(p, "c") == 0) || + (strcmp(p, "cont") == 0)) { dbg_printf("%s - continue executing\n", p); } else if ((strcmp(p, "stepi") == 0) || (strcmp(p, "step") == 0) || - (strcmp(p, "si") == 0) || (strcmp(p, "s") == 0)) { dbg_printf("%s [count] - execute count instructions, default is 1\n", p); } else + if ((strcmp(p, "next") == 0) || + (strcmp(p, "n") == 0) || + (strcmp(p, "p") == 0)) + { + dbg_printf("%s - execute instructions, stepping over subroutines\n", p); + } + else if ((strcmp(p, "vbreak") == 0) || (strcmp(p, "vb") == 0)) { @@ -4928,14 +5269,46 @@ bx_dbg_help_command(char* command) dbg_printf("%s n - delete a breakpoint\n", p); } else + if ((strcmp(p, "bpe") == 0)) + { + dbg_printf("%s n - enable a breakpoint\n", p); + } + else + if ((strcmp(p, "bpd") == 0)) + { + dbg_printf("%s n - disable a breakpoint\n", p); + } + else + if ((strcmp(p, "blist") == 0)) + { + dbg_printf("%s - list all breakpoints (same as 'info break')\n", p); + } + else if (strcmp(p, "xp") == 0) { dbg_printf("%s /nuf addr - examine memory at physical address\n", p); + goto nuf_help; } else if (strcmp(p, "x") == 0) { dbg_printf("%s /nuf addr - examine memory at linear address\n", p); +nuf_help: + dbg_printf(" nuf is a sequence of numbers (how much values\n"); + dbg_printf(" to display) and one or more of the [mxduotcsibhwg]\n"); + dbg_printf(" format specificators:\n"); + dbg_printf(" x,d,u,o,t,c,s,i select the format of the output (they stand for\n"); + dbg_printf(" hex, decimal, unsigned, octal, binary, char, asciiz, instr)\n"); + dbg_printf(" b,h,w,g select the size of a data element (for byte, half-word,\n"); + dbg_printf(" word and giant word)\n"); + dbg_printf(" m selects an alternative output format (memory dump)\n"); + } + else + if ((strcmp(p, "r") == 0)|| + (strcmp(p, "reg") == 0)|| + (strcmp(p, "registers") == 0)) + { + dbg_printf("%s = expression - set register value to expression\n", p); } else if (strcmp(p, "setpmem") == 0) @@ -4953,13 +5326,17 @@ bx_dbg_help_command(char* command) dbg_printf("%s break - show information about current breakpoint status\n", p); dbg_printf("%s dirty - show physical pages dirtied (written to) since last display\n", p); dbg_printf("%s program - execution status of the program\n", p); - dbg_printf("%s registers - list of CPU integer registers and their contents\n", p); + dbg_printf("%s r|reg|registers - list of CPU integer registers and their contents\n", p); + dbg_printf("%s cpu - list of CPU registers and their contents\n", p); dbg_printf("%s fpu - list of FPU registers and their contents\n", p); dbg_printf("%s idt - show interrupt descriptor table\n", p); dbg_printf("%s ivt - show interrupt vector table\n", p); dbg_printf("%s gdt - show global descriptor table\n", p); - dbg_printf("%s tss - show task ???\n", p); + dbg_printf("%s tss - show current task state segment\n", p); dbg_printf("%s cr - show CR0-4 registers\n", p); + dbg_printf("%s flags - show decoded EFLAGS register\n", p); + dbg_printf("%s symbols [string] - list symbols whose prefix is string\n", p); + dbg_printf("%s pic - show PICs registers\n", p); dbg_printf("%s ne2000 - show NE2000 registers\n", p); } else @@ -4983,9 +5360,11 @@ bx_dbg_help_command(char* command) } else if ((strcmp(p, "disassemble") == 0) || - (strcmp(p, "disas") == 0)) + (strcmp(p, "disas") == 0) || + (strcmp(p, "u") == 0)) { - dbg_printf("%s start end - disassemble instructions for given linear adress\n", p); + dbg_printf("%s [/count] start end - disassemble instructions for given linear adress\n", p); + dbg_printf(" Optional 'count' is the number of disassembled instructions\n"); } else if (strcmp(p, "instrument") == 0) @@ -5057,6 +5436,11 @@ bx_dbg_help_command(char* command) dbg_printf("%s [global] filename [offset] - load symbols from file filename\n", p); } else + if ((strcmp(p, "slist") == 0)) + { + dbg_printf("%s [string] - list symbols whose preffix is string (same as 'info symbols')\n", p); + } + else if (strcmp(p, "modebp") == 0) { dbg_printf("%s - toggles vm86 mode switch breakpoint\n", p); @@ -5076,6 +5460,17 @@ bx_dbg_help_command(char* command) dbg_printf("%s \"tab\" - show page tables\n", p); } else + if ((strcmp(p, "calc") == 0) || + (strcmp(p, "?") == 0)) + { + dbg_printf("%s expr - calculate a expression and display the result.\n", p); + dbg_printf(" 'expr' can reference any general-purpose and segment\n"); + dbg_printf(" registers, use any arithmetic and logic operations, and\n"); + dbg_printf(" also the special ':' operator which computes the linear\n"); + dbg_printf(" address for a segment:offset (in real and v86 mode) or\n"); + dbg_printf(" of a selector:offset (in protected mode) pair.\n"); + } + else { dbg_printf("%s - unknow command, try help\n", p); } @@ -5083,5 +5478,404 @@ bx_dbg_help_command(char* command) return; } +void +bx_dbg_calc_command(Bit64u value) +{ + dbg_printf ("0x" FMT_LL "x\n", value); +} +Bit32u +bx_dbg_get_reg_value(Regs reg) +{ + switch(reg) + { + case rAL: + return BX_CPU(dbg_cpu)->get_AL(); + case rBL: + return BX_CPU(dbg_cpu)->get_BL(); + case rCL: + return BX_CPU(dbg_cpu)->get_CL(); + case rDL: + return BX_CPU(dbg_cpu)->get_DL(); + case rAH: + return BX_CPU(dbg_cpu)->get_AH(); + case rBH: + return BX_CPU(dbg_cpu)->get_BH(); + case rCH: + return BX_CPU(dbg_cpu)->get_CH(); + case rDH: + return BX_CPU(dbg_cpu)->get_DH(); + case rAX: + return BX_CPU(dbg_cpu)->get_AX(); + case rBX: + return BX_CPU(dbg_cpu)->get_BX(); + case rCX: + return BX_CPU(dbg_cpu)->get_CX(); + case rDX: + return BX_CPU(dbg_cpu)->get_DX(); + case rEAX: + return BX_CPU(dbg_cpu)->get_EAX(); + case rEBX: + return BX_CPU(dbg_cpu)->get_EBX(); + case rECX: + return BX_CPU(dbg_cpu)->get_ECX(); + case rEDX: + return BX_CPU(dbg_cpu)->get_EDX(); + + case rSI: + return BX_CPU(dbg_cpu)->get_SI(); + case rDI: + return BX_CPU(dbg_cpu)->get_DI(); + case rESI: + return BX_CPU(dbg_cpu)->get_ESI(); + case rEDI: + return BX_CPU(dbg_cpu)->get_EDI(); + + case rBP: + return BX_CPU(dbg_cpu)->get_BP(); + case rEBP: + return BX_CPU(dbg_cpu)->get_EBP(); + case rSP: + return BX_CPU(dbg_cpu)->get_SP(); + case rESP: + return BX_CPU(dbg_cpu)->get_ESP(); + case rIP: + return (Bit16u)BX_CPU(dbg_cpu)->get_EIP(); + case rEIP: + return BX_CPU(dbg_cpu)->get_EIP(); + default: + fprintf(stderr, "unknown register ??? (BUG!!!)\n"); + return 0; + } +} + +void +bx_dbg_set_reg_value (Regs reg, Bit32u value) +{ + switch(reg) + { + case rAL: + BX_CPU(dbg_cpu)->set_AL(value); + break; + case rBL: + BX_CPU(dbg_cpu)->set_BL(value); + break; + case rCL: + BX_CPU(dbg_cpu)->set_CL(value); + break; + case rDL: + BX_CPU(dbg_cpu)->set_DL(value); + break; + case rAH: + BX_CPU(dbg_cpu)->set_AH(value>>8); + break; + case rBH: + BX_CPU(dbg_cpu)->set_BH(value>>8); + break; + case rCH: + BX_CPU(dbg_cpu)->set_CH(value>>8); + break; + case rDH: + BX_CPU(dbg_cpu)->set_DH(value>>8); + break; + case rAX: + BX_CPU(dbg_cpu)->set_AX(value); + break; + case rBX: + BX_CPU(dbg_cpu)->set_BX(value); + break; + case rCX: + BX_CPU(dbg_cpu)->set_CX(value); + break; + case rDX: + BX_CPU(dbg_cpu)->set_DX(value); + break; + case rEAX: + BX_CPU(dbg_cpu)->set_EAX(value); + break; + case rEBX: + BX_CPU(dbg_cpu)->set_EBX(value); + break; + case rECX: + BX_CPU(dbg_cpu)->set_ECX(value); + break; + case rEDX: + BX_CPU(dbg_cpu)->set_EDX(value); + break; + + case rSI: + BX_CPU(dbg_cpu)->set_SI(value); + break; + case rDI: + BX_CPU(dbg_cpu)->set_DI(value); + break; + case rESI: + BX_CPU(dbg_cpu)->set_ESI(value); + break; + case rEDI: + BX_CPU(dbg_cpu)->set_EDI(value); + break; + + case rBP: + BX_CPU(dbg_cpu)->set_BP(value); + break; + case rEBP: + BX_CPU(dbg_cpu)->set_EBP(value); + break; + case rSP: + BX_CPU(dbg_cpu)->set_SP(value); + break; + case rESP: + BX_CPU(dbg_cpu)->set_ESP(value); + break; +/* + case rIP: + BX_CPU(dbg_cpu)->set_IP(value); + break; + case rEIP: + BX_CPU(dbg_cpu)->set_EIP(value); + break; +*/ + default: + fprintf(stderr, "unknown register ??? (BUG!!!)\n"); + } +} + +Bit16u +bx_dbg_get_selector_value(unsigned int seg_no) +{ + bx_dbg_sreg_t sreg; + + if (seg_no > 5) { + dbg_printf ( "Error: seg_no out of bounds\n"); + return 0; + } + BX_CPU(dbg_cpu)->dbg_get_sreg(&sreg, seg_no); + if (!sreg.valid) { + dbg_printf ( "Error: segment valid bit cleared\n"); + return 0; + } + return sreg.sel; +} + +Bit32u +bx_dbg_get_laddr(Bit16u sel, Bit32u ofs) +{ + bool protmode = (BX_CPU(dbg_cpu)->cr0.pe) + && !(BX_CPU(dbg_cpu)->get_VM()); + + if (protmode) { + bx_descriptor_t descriptor; + bx_selector_t selector; + Bit32u dword1, dword2; + + /* if selector is NULL, error */ + if ((sel & 0xfffc) == 0) { + dbg_printf ("ERROR: Dereferencing a NULL selector!\n"); + return 0; + } + + /* parse fields in selector */ + BX_CPU(dbg_cpu)->parse_selector(sel, &selector); + + Bit32u desc_base; + if (selector.ti) { + // LDT + if ((selector.index*8 + 7) > BX_CPU(dbg_cpu)->ldtr.cache.u.ldt.limit) { + dbg_printf ("ERROR: selector (%04x) > GDT size limit\n", selector.index*8); + return 0; + } + desc_base = BX_CPU(dbg_cpu)->ldtr.cache.u.ldt.base; + } + else { + // GDT + if ((selector.index*8 + 7) > BX_CPU(dbg_cpu)->gdtr.limit) { + dbg_printf ("ERROR: selector (%04x) > GDT size limit\n", selector.index*8); + return 0; + } + desc_base = BX_CPU(dbg_cpu)->gdtr.base; + } + + BX_CPU(dbg_cpu)->access_linear(desc_base + selector.index * 8, 4, 0, BX_READ, &dword1); + BX_CPU(dbg_cpu)->access_linear(desc_base + selector.index * 8 + 4, 4, 0, BX_READ, &dword2); + + memset (&descriptor, 0, sizeof (descriptor)); + BX_CPU(dbg_cpu)->parse_descriptor(dword1, dword2, &descriptor); + + if (!descriptor.segment) { + dbg_printf ("ERROR: selector %04x points to a system descriptor and is not supported!\n", sel); + return 0; + } + + /* #NP(selector) if descriptor is not present */ + if (descriptor.p==0) { + dbg_printf ("ERROR: descriptor %04x not present!\n", sel); + return 0; + } + + Bit32u lowaddr, highaddr; + if (descriptor.u.segment.c_ed && !descriptor.u.segment.executable) // expand-down + lowaddr = descriptor.u.segment.limit_scaled, + highaddr = descriptor.u.segment.g ? 0xffffffff : 0xffff; + else + lowaddr = 0, highaddr = descriptor.u.segment.limit_scaled; + + if ((ofs < lowaddr) || (ofs > highaddr)) { + dbg_printf ("WARNING: Offset %08X is out of selector %04x limit (%08x...%08x)!\n", + ofs, sel, lowaddr, highaddr); + } + + return descriptor.u.segment.base + ofs; + } + else { + return sel * 16 + ofs; + } +} + +void +bx_dbg_step_over_command () +{ + Bit8u *fetchPtr; + bxInstruction_c iStorage BX_CPP_AlignN (32); + bxInstruction_c *i = &iStorage; + Bit32u Laddr = BX_CPU (dbg_cpu)->sregs [BX_SEG_REG_CS].cache.u.segment.base + + BX_CPU (dbg_cpu)->get_EIP (); + Bit32u Paddr; + bx_bool paddr_valid; + + BX_CPU (dbg_cpu)->dbg_xlate_linear2phy (Laddr, &Paddr, &paddr_valid); + + if(!paddr_valid) { + dbg_printf ("bx_dbg_step_over_command:: Invalid physical address\n"); + return; + } + fetchPtr = BX_CPU (dbg_cpu)->mem->getHostMemAddr (BX_CPU(dbg_cpu), Paddr, BX_READ); + unsigned ret = BX_CPU (dbg_cpu)->fetchDecode (fetchPtr, i, 15); + + if (ret == 0) + BX_CPU (dbg_cpu)->boundaryFetch (i); + + unsigned b1 = i->b1 (); + + switch(b1) { + // Jcc short + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + + // Jcc near + case 0x180: + case 0x181: + case 0x182: + case 0x183: + case 0x184: + case 0x185: + case 0x186: + case 0x187: + case 0x188: + case 0x189: + case 0x18A: + case 0x18B: + case 0x18C: + case 0x18D: + case 0x18E: + case 0x18F: + + // jcxz + case 0xE3: + + // retn n + case 0xC2: + // retn + case 0xC3: + // retf n + case 0xCA: + // retf + case 0xCB: + // iret + case 0xCF: + + // jmp near + case 0xE9: + // jmp far + case 0xEA: + // jmp short + case 0xEB: + bx_dbg_stepN_command (1); + return; + // jmp absolute indirect + case 0xFF: + switch (i->nnn ()) { + // near + case 4: + // far + case 5: + bx_dbg_stepN_command (1); + return; + } + } + + // calls, ints, loops and so on + int BpId = bx_dbg_lbreakpoint_command (bkStepOver, Laddr + i->ilen ()); + if (BpId == -1) + return; + + bx_dbg_continue_command (); + + if (bx_dbg_del_lbreak (BpId)) + bx_dbg_breakpoint_changed (); +} + +void +bx_dbg_info_flags(void) +{ + if(BX_CPU(dbg_cpu)->getB_ID()) + dbg_printf ("ID "); + if(BX_CPU(dbg_cpu)->getB_VP()) + dbg_printf ("VIP "); + if(BX_CPU(dbg_cpu)->getB_VF()) + dbg_printf ("VIF "); + if(BX_CPU(dbg_cpu)->getB_AC()) + dbg_printf ("AC "); + if(BX_CPU(dbg_cpu)->getB_VM()) + dbg_printf ("VM "); + if(BX_CPU(dbg_cpu)->getB_RF()) + dbg_printf ("RF "); + if(BX_CPU(dbg_cpu)->getB_NT()) + dbg_printf ("NT "); + dbg_printf ("IOPL=%d ", BX_CPU(dbg_cpu)->get_IOPL()); + if(BX_CPU(dbg_cpu)->eflags.val32 & EFlagsOFMask) + dbg_printf ("OF "); + if(BX_CPU(dbg_cpu)->getB_DF()) + dbg_printf ("DF "); + if(BX_CPU(dbg_cpu)->getB_IF()) + dbg_printf ("IF "); + if(BX_CPU(dbg_cpu)->getB_TF()) + dbg_printf ("TF "); + if(BX_CPU(dbg_cpu)->getB_SF()) + dbg_printf ("SF "); + if(BX_CPU(dbg_cpu)->getB_ZF()) + dbg_printf ("ZF "); + if(BX_CPU(dbg_cpu)->getB_AF()) + dbg_printf ("AF "); + if(BX_CPU(dbg_cpu)->getB_PF()) + dbg_printf ("PF "); + if(BX_CPU(dbg_cpu)->getB_CF()) + dbg_printf ("CF"); + dbg_printf ("\n"); +} #endif /* if BX_DEBUGGER */ + diff --git a/bochs/debug/debug.h b/bochs/debug/debug.h index e4cd05826..d68cb4e46 100644 --- a/bochs/debug/debug.h +++ b/bochs/debug/debug.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: debug.h,v 1.18 2003-08-01 10:14:48 akrisak Exp $ +// $Id: debug.h,v 1.19 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -56,6 +56,24 @@ unsigned long crc32(unsigned char *buf, int len); extern "C" { #endif +typedef enum +{ + rAL, rBL, rCL, rDL, + rAH, rBH, rCH, rDH, + rAX, rBX, rCX, rDX, + rEAX, rEBX, rECX, rEDX, + rSI, rDI, rESI, rEDI, + rBP, rEBP, rSP, rESP, + rIP, rEIP +} Regs; + +typedef enum +{ + bkRegular, + bkAtIP, + bkStepOver +} BreakpointKind; + // Flex defs extern int bxlex(void); extern char *bxtext; // Using the pointer option rather than array @@ -72,8 +90,15 @@ typedef struct { } bx_num_range; #define EMPTY_ARG (-1) +Bit16u bx_dbg_get_selector_value(unsigned int seg_no); +Bit32u bx_dbg_get_reg_value(Regs reg); +void bx_dbg_set_reg_value (Regs reg, Bit32u value); +Bit32u bx_dbg_get_laddr(Bit16u sel, Bit32u ofs); +void bx_dbg_step_over_command(void); bx_num_range make_num_range (Bit64s from, Bit64s to); char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base); +char* bx_dbg_disasm_symbolic_address(Bit32u eip, Bit32u base); +Bit32u bx_dbg_get_symbol_value(char *Symbol); void bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset); void bx_dbg_trace_on_command(void); void bx_dbg_trace_off_command(void); @@ -97,7 +122,7 @@ void bx_dbg_modebp_command(char*); /* BW */ void bx_dbg_where_command(void); void bx_dbg_print_string_command(Bit32u addr); void bx_dbg_show_command(char*); /* BW */ -void enter_playback_entry(); +void enter_playback_entry(void); void bx_dbg_print_stack_command(int nwords); void bx_dbg_watch(int read, Bit32u address); void bx_dbg_unwatch(int read, Bit32u address); @@ -105,9 +130,17 @@ 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_del_breakpoint_command(unsigned handle); -void bx_dbg_vbreakpoint_command(bx_bool specific, Bit32u cs, Bit32u eip); -void bx_dbg_lbreakpoint_command(bx_bool specific, Bit32u laddress); -void bx_dbg_pbreakpoint_command(bx_bool specific, Bit32u paddress); +void bx_dbg_en_dis_breakpoint_command(unsigned handle, bx_bool enable); +bx_bool bx_dbg_en_dis_pbreak (unsigned handle, bx_bool enable); +bx_bool bx_dbg_en_dis_lbreak (unsigned handle, bx_bool enable); +bx_bool bx_dbg_en_dis_vbreak (unsigned handle, bx_bool enable); +bx_bool bx_dbg_del_pbreak(unsigned handle); +bx_bool bx_dbg_del_lbreak (unsigned handle); +bx_bool bx_dbg_del_vbreak (unsigned handle); +int bx_dbg_vbreakpoint_command(BreakpointKind bk, Bit32u cs, Bit32u eip); +int bx_dbg_lbreakpoint_command(BreakpointKind bk, Bit32u laddress); +int bx_dbg_lbreakpoint_symbol_command(char *Symbol); +int bx_dbg_pbreakpoint_command(BreakpointKind bk, Bit32u paddress); void bx_dbg_info_bpoints_command(void); void bx_dbg_quit_command(void); void bx_dbg_info_program_command(void); @@ -120,7 +153,9 @@ void bx_dbg_info_gdt_command(bx_num_range); void bx_dbg_info_ldt_command(bx_num_range); void bx_dbg_info_tss_command(bx_num_range); void bx_dbg_info_control_regs_command(void); +void bx_dbg_info_flags(void); void bx_dbg_info_linux_command(void); +void bx_dbg_info_symbols_command(char *Symbol); void bx_dbg_examine_command(char *command, char *format, bx_bool format_passed, Bit32u addr, bx_bool addr_passed, int simulator); void bx_dbg_setpmem_command(Bit32u addr, unsigned len, Bit32u val); @@ -129,18 +164,17 @@ void bx_dbg_query_command(char *); void bx_dbg_take_command(char *, unsigned n); void bx_dbg_dump_cpu_command(void); void bx_dbg_set_cpu_command(void); -void bx_dbg_disassemble_command(bx_num_range); +void bx_dbg_disassemble_command(const char *,bx_num_range); void bx_dbg_instrument_command(char *); void bx_dbg_loader_command(char *); void bx_dbg_doit_command(unsigned); void bx_dbg_crc_command(Bit32u addr1, Bit32u addr2); -void bx_dbg_maths_command(char *command, int data1, int data2); -void bx_dbg_maths_expression_command(char *expr); -void bx_dbg_v2l_command(unsigned seg_no, Bit32u offset); extern bx_bool watchpoint_continue; -void bx_dbg_linux_syscall (); +void bx_dbg_linux_syscall (void); void bx_dbg_info_ne2k(int page, int reg); +void bx_dbg_info_pic(void); void bx_dbg_help_command(char* command); +void bx_dbg_calc_command(Bit64u value); void bx_dbg_info_ivt_command(bx_num_range); #ifdef __cplusplus } @@ -235,6 +269,7 @@ typedef struct { Bit32u cs; // only use 16 bits Bit32u eip; unsigned bpoint_id; + bx_bool enabled; } vir[BX_DBG_MAX_VIR_BPOINTS]; #endif @@ -243,6 +278,7 @@ typedef struct { struct { Bit32u addr; unsigned bpoint_id; + bx_bool enabled; } lin[BX_DBG_MAX_LIN_BPOINTS]; #endif @@ -251,6 +287,7 @@ typedef struct { struct { Bit32u addr; unsigned bpoint_id; + bx_bool enabled; } phy[BX_DBG_MAX_PHY_BPOINTS]; #endif } iaddr; diff --git a/bochs/debug/lexer.c b/bochs/debug/lexer.c index 8941d9ea2..06e7791c6 100644 --- a/bochs/debug/lexer.c +++ b/bochs/debug/lexer.c @@ -19,7 +19,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/volker/Archiv/bochs-cvs-rsync-20110222/bochs/debug/lexer.c,v 1.13 2003-08-01 10:14:48 akrisak Exp $ + * $Header: /home/volker/Archiv/bochs-cvs-rsync-20110222/bochs/debug/lexer.c,v 1.14 2003-08-04 16:03:09 akrisak Exp $ */ #define FLEX_SCANNER @@ -300,51 +300,59 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 117 -#define YY_END_OF_BUFFER 118 -static yyconst short int yy_accept[377] = +#define YY_NUM_RULES 166 +#define YY_END_OF_BUFFER 167 +static yyconst short int yy_accept[449] = { 0, - 0, 0, 118, 116, 1, 114, 116, 115, 116, 116, - 112, 112, 116, 20, 7, 40, 116, 116, 116, 116, - 116, 116, 116, 116, 116, 116, 42, 25, 11, 116, - 116, 116, 116, 43, 1, 0, 105, 115, 113, 108, - 107, 110, 112, 111, 0, 0, 0, 0, 0, 22, - 96, 0, 0, 0, 0, 99, 0, 97, 0, 0, - 0, 100, 0, 0, 101, 0, 0, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 71, - 0, 0, 10, 98, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 167, 164, 1, 162, + 152, 164, 163, 164, 149, 164, 153, 154, 145, 143, + 144, 146, 160, 160, 164, 164, 138, 151, 164, 21, + 7, 45, 164, 164, 164, 164, 164, 164, 164, 13, + 164, 14, 50, 29, 11, 164, 61, 164, 164, 51, + 150, 165, 1, 165, 165, 1, 0, 156, 163, 161, + 0, 155, 158, 160, 159, 0, 148, 147, 0, 107, + 103, 111, 108, 104, 121, 0, 112, 0, 109, 105, + 0, 0, 26, 129, 113, 0, 110, 120, 106, 0, + 0, 132, 0, 114, 0, 0, 0, 0, 0, 130, - 0, 0, 12, 0, 0, 0, 44, 113, 106, 109, - 55, 29, 0, 0, 6, 0, 39, 0, 0, 3, - 58, 49, 0, 0, 0, 0, 28, 32, 0, 0, - 30, 0, 0, 50, 31, 0, 33, 0, 0, 0, - 0, 57, 0, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 72, 2, - 0, 0, 0, 0, 56, 0, 0, 0, 34, 0, - 103, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 65, 0, 0, 0, 0, 104, 18, - 0, 0, 0, 0, 0, 0, 0, 93, 95, 0, + 0, 0, 0, 0, 0, 133, 0, 0, 134, 0, + 0, 0, 123, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 4, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 76, 0, 0, 119, 0, 122, 131, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, + 52, 140, 141, 142, 161, 157, 0, 34, 0, 47, + 46, 0, 0, 0, 33, 6, 0, 44, 0, 0, + 3, 57, 0, 0, 115, 126, 116, 117, 125, 118, + 128, 124, 127, 0, 0, 0, 0, 32, 37, 0, + 0, 35, 0, 0, 58, 36, 0, 38, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 41, 79, 0, - 0, 0, 0, 0, 82, 0, 9, 61, 0, 48, - 0, 0, 0, 0, 0, 0, 0, 19, 0, 24, - 0, 0, 35, 52, 0, 0, 0, 0, 0, 0, - 36, 0, 0, 54, 0, 0, 0, 0, 0, 0, - 63, 0, 70, 46, 0, 0, 62, 0, 0, 60, - 8, 0, 0, 0, 0, 77, 85, 80, 0, 0, - 38, 0, 0, 0, 0, 0, 84, 0, 15, 0, - 64, 75, 94, 17, 0, 0, 0, 0, 0, 73, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, + 0, 0, 0, 5, 0, 0, 0, 0, 59, 0, + 0, 0, 0, 0, 0, 0, 0, 30, 0, 77, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 39, 0, 0, 0, 0, 0, 0, 0, 0, 139, + 8, 27, 0, 0, 0, 0, 70, 0, 49, 0, + 0, 0, 0, 137, 24, 0, 0, 0, 0, 0, + 0, 100, 12, 102, 0, 0, 0, 0, 0, 0, + 0, 0, 48, 84, 0, 0, 0, 0, 0, 87, + 0, 0, 10, 66, 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 15, 20, 0, 28, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 47, 91, 0, - 0, 21, 0, 51, 45, 0, 0, 0, 0, 78, - 0, 81, 0, 0, 37, 0, 0, 0, 0, 74, - 0, 0, 89, 0, 0, 66, 0, 92, 0, 0, - 0, 0, 0, 0, 0, 0, 27, 0, 67, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 87, 53, 0, 102, 0, 76, 0, 88, 0, 90, - 83, 86, 0, 68, 69, 0 + 40, 62, 0, 0, 135, 0, 0, 0, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, + 75, 54, 0, 0, 67, 0, 0, 90, 65, 9, + 0, 0, 0, 0, 0, 82, 92, 85, 0, 0, + 43, 0, 0, 0, 0, 0, 91, 0, 19, 0, + 69, 80, 101, 23, 0, 0, 0, 0, 0, 78, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 55, 98, + 0, 0, 25, 0, 60, 53, 89, 0, 0, 0, + 0, 83, 0, 86, 0, 0, 42, 0, 0, 0, + + 0, 79, 0, 0, 96, 0, 0, 71, 0, 99, + 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, + 72, 0, 0, 0, 0, 0, 64, 0, 0, 0, + 0, 0, 94, 63, 0, 136, 0, 81, 0, 95, + 0, 97, 88, 93, 0, 73, 74, 0 } ; static yyconst int yy_ec[256] = @@ -352,17 +360,17 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 5, 6, 1, 1, 1, 1, - 1, 1, 1, 1, 7, 1, 8, 9, 10, 11, - 10, 10, 10, 10, 10, 12, 12, 1, 1, 1, - 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 15, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 1, 1, 1, 1, 16, 1, 17, 18, 19, 20, + 1, 2, 4, 5, 6, 7, 1, 8, 9, 10, + 11, 12, 13, 1, 14, 1, 15, 16, 17, 18, + 17, 17, 17, 17, 17, 19, 19, 1, 1, 20, + 1, 21, 22, 1, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 25, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 1, 1, 1, 26, 27, 1, 28, 29, 30, 31, - 21, 22, 23, 24, 25, 14, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 14, 1, 1, 1, 1, 1, 1, 1, 1, + 32, 33, 34, 35, 36, 24, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 24, 1, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -379,216 +387,258 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[41] = +static yyconst int yy_meta[53] = { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, - 3, 3, 4, 5, 5, 5, 4, 6, 6, 6, - 4, 4, 7, 7, 7, 5, 5, 5, 5, 7, - 5, 5, 5, 7, 7, 7, 5, 7, 7, 5 + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, + 1, 1, 4, 5, 5, 1, 5, 4, 6, 6, + 6, 4, 4, 7, 7, 7, 5, 5, 7, 5, + 7, 5, 5, 5, 7, 7, 7, 5, 7, 7, + 5, 1 } ; -static yyconst short int yy_base[384] = +static yyconst short int yy_base[457] = { 0, - 0, 0, 430, 431, 427, 431, 424, 0, 0, 32, - 36, 43, 29, 394, 27, 38, 392, 47, 42, 404, - 50, 64, 50, 403, 63, 78, 387, 401, 96, 73, - 392, 80, 76, 389, 417, 414, 431, 0, 0, 113, - 0, 128, 135, 431, 0, 397, 389, 394, 385, 52, - 431, 386, 82, 395, 386, 431, 382, 431, 375, 375, - 371, 431, 371, 375, 431, 377, 368, 107, 370, 366, - 367, 364, 369, 380, 361, 375, 367, 382, 370, 431, - 368, 357, 360, 348, 370, 78, 361, 76, 132, 368, - 349, 353, 431, 431, 131, 364, 352, 354, 362, 344, + 0, 0, 51, 53, 55, 57, 529, 530, 526, 530, + 530, 522, 0, 0, 530, 517, 530, 530, 530, 530, + 530, 530, 46, 57, 505, 503, 530, 530, 48, 43, + 71, 90, 74, 104, 46, 491, 99, 59, 481, 489, + 61, 122, 473, 487, 140, 89, 478, 488, 79, 474, + 530, 530, 513, 145, 171, 512, 508, 530, 0, 0, + 503, 530, 176, 180, 530, 0, 530, 530, 480, 530, + 472, 530, 530, 473, 121, 476, 530, 469, 530, 530, + 466, 458, 37, 530, 530, 466, 530, 111, 530, 475, + 466, 530, 462, 530, 450, 47, 449, 123, 456, 129, - 339, 349, 342, 339, 352, 347, 431, 0, 431, 0, - 338, 431, 353, 334, 431, 345, 346, 344, 330, 347, - 431, 431, 328, 331, 326, 341, 431, 431, 341, 327, - 431, 327, 321, 431, 431, 334, 431, 318, 333, 328, - 330, 431, 101, 431, 329, 328, 328, 336, 306, 316, - 321, 315, 309, 306, 320, 309, 313, 316, 431, 34, - 298, 302, 303, 302, 431, 313, 310, 311, 431, 312, - 431, 307, 308, 293, 290, 317, 297, 297, 287, 285, - 312, 278, 283, 431, 300, 308, 293, 296, 431, 431, - 279, 294, 271, 105, 275, 290, 298, 431, 431, 289, + 461, 451, 467, 450, 446, 530, 446, 450, 530, 452, + 443, 47, 530, 445, 441, 442, 439, 444, 455, 451, + 120, 448, 530, 446, 435, 438, 426, 446, 447, 138, + 438, 145, 172, 445, 426, 430, 530, 434, 530, 530, + 175, 144, 432, 440, 422, 417, 421, 418, 431, 426, + 530, 192, 196, 202, 0, 0, 417, 530, 415, 530, + 530, 431, 428, 411, 530, 530, 422, 423, 421, 407, + 424, 530, 405, 408, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 403, 402, 413, 416, 530, 530, 416, + 402, 530, 402, 396, 530, 530, 409, 530, 393, 408, - 280, 277, 285, 267, 268, 279, 259, 431, 431, 265, - 263, 261, 276, 266, 431, 258, 267, 431, 284, 431, - 269, 254, 271, 263, 265, 264, 259, 431, 254, 431, - 261, 253, 431, 246, 260, 256, 270, 249, 239, 248, - 431, 239, 239, 431, 240, 261, 243, 239, 237, 249, - 258, 247, 431, 431, 243, 227, 431, 230, 239, 431, - 431, 114, 252, 239, 231, 431, 431, 431, 227, 219, - 431, 233, 232, 221, 221, 231, 431, 221, 431, 208, - 431, 431, 431, 431, 224, 223, 226, 210, 215, 431, - 221, 205, 212, 208, 217, 123, 213, 431, 214, 214, + 406, 111, 391, 530, 404, 403, 403, 415, 530, 381, + 391, 396, 390, 384, 381, 395, 384, 388, 391, 530, + 195, 373, 376, 376, 377, 376, 388, 386, 383, 384, + 530, 385, 380, 381, 366, 363, 394, 361, 369, 530, + 369, 359, 357, 388, 350, 355, 530, 372, 530, 384, + 352, 364, 367, 530, 530, 350, 365, 342, 104, 362, + 374, 530, 530, 530, 361, 352, 349, 357, 339, 340, + 351, 331, 530, 530, 337, 335, 333, 348, 338, 530, + 330, 329, 338, 530, 332, 358, 530, 339, 324, 341, + 333, 335, 334, 329, 530, 530, 324, 530, 331, 323, - 206, 205, 196, 198, 206, 208, 200, 431, 431, 201, - 191, 431, 192, 431, 431, 188, 195, 106, 201, 431, - 191, 431, 190, 201, 431, 180, 196, 187, 197, 431, - 101, 180, 431, 183, 190, 431, 188, 431, 177, 182, - 191, 188, 171, 175, 185, 178, 431, 169, 431, 194, - 159, 166, 153, 149, 431, 141, 139, 134, 122, 130, - 431, 431, 139, 431, 124, 431, 131, 431, 135, 431, - 431, 431, 66, 431, 431, 431, 166, 173, 177, 182, - 187, 189, 194 + 530, 316, 330, 326, 530, 344, 319, 309, 318, 530, + 309, 309, 310, 335, 313, 309, 307, 319, 332, 317, + 530, 530, 313, 297, 530, 300, 309, 530, 530, 530, + 302, 81, 325, 308, 300, 530, 530, 530, 296, 288, + 530, 302, 301, 290, 290, 300, 530, 290, 530, 277, + 530, 530, 530, 530, 293, 292, 295, 279, 284, 530, + 290, 274, 281, 274, 276, 285, 182, 281, 530, 282, + 282, 274, 273, 264, 266, 274, 276, 268, 530, 530, + 269, 259, 530, 260, 530, 530, 530, 256, 263, 191, + 269, 530, 259, 530, 258, 269, 530, 248, 264, 255, + + 265, 530, 197, 248, 530, 251, 258, 530, 256, 530, + 245, 250, 258, 246, 229, 227, 227, 214, 530, 196, + 530, 225, 187, 204, 191, 196, 530, 194, 193, 189, + 177, 163, 530, 530, 149, 530, 122, 530, 74, 530, + 194, 530, 530, 530, 28, 530, 530, 530, 241, 248, + 255, 259, 266, 271, 276, 281 } ; -static yyconst short int yy_def[384] = +static yyconst short int yy_def[457] = { 0, - 376, 1, 376, 376, 376, 376, 377, 378, 379, 380, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 377, 376, 378, 381, 380, - 382, 376, 376, 376, 383, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, + 448, 1, 449, 449, 449, 449, 448, 448, 448, 448, + 448, 450, 451, 452, 448, 453, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 454, 448, 448, 450, 448, 451, 455, + 453, 448, 448, 448, 448, 456, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, - 376, 376, 376, 376, 376, 376, 376, 381, 376, 383, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 454, 454, 448, 455, 456, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 0, 376, 376, 376, 376, - 376, 376, 376 + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 0, 448, 448, + 448, 448, 448, 448, 448, 448 } ; -static yyconst short int yy_nxt[472] = +static yyconst short int yy_nxt[583] = { 0, - 4, 5, 6, 7, 8, 9, 4, 10, 11, 12, - 12, 12, 4, 4, 4, 4, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 4, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 4, - 40, 40, 40, 40, 42, 42, 42, 43, 46, 213, - 44, 43, 43, 43, 43, 47, 49, 44, 52, 50, - 51, 63, 53, 59, 214, 54, 75, 55, 64, 67, - 115, 56, 116, 57, 45, 65, 60, 61, 68, 76, - 62, 71, 69, 72, 79, 77, 70, 375, 73, 98, - 102, 80, 104, 74, 81, 82, 153, 103, 83, 105, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 24, 24, 25, + 26, 27, 8, 8, 8, 28, 8, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 8, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 8, 51, 53, 10, 53, 10, 53, 10, 53, 10, + 447, 63, 63, 63, 64, 54, 166, 54, 167, 55, + 65, 55, 64, 64, 64, 64, 107, 73, 69, 193, + 74, 65, 70, 108, 75, 71, 76, 116, 176, 117, + 109, 194, 77, 122, 118, 66, 177, 72, 78, 119, - 154, 84, 150, 118, 85, 99, 100, 151, 106, 197, - 86, 242, 87, 90, 119, 120, 91, 345, 121, 92, - 93, 40, 40, 40, 40, 243, 198, 335, 132, 94, - 95, 96, 294, 346, 336, 97, 42, 42, 42, 43, - 133, 295, 44, 43, 43, 43, 43, 162, 155, 44, - 156, 163, 318, 372, 157, 319, 373, 371, 370, 369, - 164, 368, 367, 374, 366, 158, 36, 365, 36, 36, - 36, 36, 36, 38, 364, 38, 38, 38, 38, 38, - 39, 39, 39, 39, 41, 363, 362, 41, 41, 108, - 108, 108, 108, 108, 109, 109, 110, 110, 361, 110, + 123, 95, 96, 97, 98, 79, 148, 444, 80, 99, + 365, 81, 82, 149, 83, 84, 143, 311, 100, 366, + 85, 86, 150, 101, 87, 88, 261, 89, 90, 111, + 91, 102, 144, 145, 92, 312, 93, 202, 112, 94, + 113, 103, 114, 169, 104, 105, 115, 262, 106, 124, + 125, 160, 161, 126, 170, 171, 127, 128, 179, 129, + 152, 152, 152, 152, 182, 130, 443, 131, 134, 203, + 183, 135, 180, 211, 136, 137, 214, 138, 212, 442, + 215, 139, 227, 228, 140, 141, 154, 154, 154, 154, + 142, 63, 63, 63, 64, 64, 64, 64, 64, 216, - 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 347, 344, 343, 342, 341, 340, 339, - 338, 337, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 321, 320, 317, 316, 315, - 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, - 304, 303, 302, 301, 300, 299, 298, 297, 296, 293, - 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, - 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, - 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, - 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, + 65, 217, 224, 441, 65, 218, 225, 152, 152, 152, + 152, 448, 448, 448, 448, 226, 219, 154, 154, 154, + 154, 278, 390, 407, 417, 391, 445, 440, 439, 438, + 408, 437, 436, 446, 435, 434, 279, 433, 432, 431, + 418, 52, 52, 52, 52, 52, 52, 52, 57, 430, + 57, 57, 57, 57, 57, 59, 429, 59, 59, 59, + 59, 59, 60, 60, 60, 60, 61, 428, 61, 61, + 61, 61, 61, 153, 427, 426, 153, 153, 155, 155, + 155, 155, 155, 156, 156, 425, 156, 424, 423, 422, + 421, 420, 419, 416, 415, 414, 413, 412, 411, 410, - 252, 251, 250, 249, 248, 247, 246, 245, 244, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, - 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, - 220, 219, 218, 217, 216, 215, 212, 211, 210, 209, - 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, - 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, - 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, - 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 161, 160, 159, 152, 149, 148, 147, 146, - 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, + 409, 406, 405, 404, 403, 402, 401, 400, 399, 398, + 397, 396, 395, 394, 393, 392, 389, 388, 387, 386, + 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, + 375, 374, 373, 372, 371, 370, 369, 368, 367, 364, + 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, + 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, + 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, + 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, + 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, + 313, 310, 309, 308, 307, 306, 305, 304, 303, 302, - 135, 134, 131, 130, 129, 128, 127, 126, 125, 124, - 123, 122, 117, 114, 113, 112, 111, 37, 35, 107, - 101, 89, 88, 78, 66, 58, 48, 37, 35, 376, - 3, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376 + 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, + 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, + 281, 280, 277, 276, 275, 274, 273, 272, 271, 270, + 269, 268, 267, 266, 265, 264, 263, 260, 259, 258, + 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, + 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, + 237, 236, 235, 234, 233, 232, 231, 230, 229, 223, + 222, 221, 220, 213, 210, 209, 208, 207, 206, 205, + 204, 201, 200, 199, 198, 197, 196, 195, 192, 191, + 190, 189, 188, 187, 186, 185, 184, 181, 178, 175, + + 174, 173, 172, 168, 165, 164, 163, 162, 159, 158, + 157, 62, 58, 56, 56, 151, 147, 146, 133, 132, + 121, 120, 110, 68, 67, 62, 58, 56, 448, 7, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448 } ; -static yyconst short int yy_chk[472] = +static yyconst short int yy_chk[583] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 10, 10, 10, 10, 11, 11, 11, 11, 13, 160, - 11, 12, 12, 12, 12, 13, 15, 12, 16, 15, - 15, 19, 16, 18, 160, 16, 23, 16, 19, 21, - 50, 16, 50, 16, 11, 19, 18, 18, 21, 23, - 18, 22, 21, 22, 25, 23, 21, 373, 22, 30, - 32, 25, 33, 22, 26, 26, 88, 32, 26, 33, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 3, 4, 4, 5, 5, 6, 6, + 445, 23, 23, 23, 23, 3, 83, 4, 83, 5, + 23, 6, 24, 24, 24, 24, 35, 30, 29, 112, + 30, 24, 29, 35, 30, 29, 30, 38, 96, 38, + 35, 112, 30, 41, 38, 23, 96, 29, 31, 38, - 88, 26, 86, 53, 26, 30, 30, 86, 33, 143, - 26, 194, 26, 29, 53, 53, 29, 331, 53, 29, - 29, 40, 40, 40, 40, 194, 143, 318, 68, 29, - 29, 29, 262, 331, 318, 29, 42, 42, 42, 42, - 68, 262, 42, 43, 43, 43, 43, 95, 89, 43, - 89, 95, 296, 367, 89, 296, 369, 365, 363, 360, - 95, 359, 358, 369, 357, 89, 377, 356, 377, 377, - 377, 377, 377, 378, 354, 378, 378, 378, 378, 378, - 379, 379, 379, 379, 380, 353, 352, 380, 380, 381, - 381, 381, 381, 381, 382, 382, 383, 383, 351, 383, + 41, 33, 33, 33, 33, 31, 49, 439, 31, 33, + 332, 31, 31, 49, 31, 31, 46, 259, 33, 332, + 31, 32, 49, 33, 32, 32, 202, 32, 32, 37, + 32, 34, 46, 46, 32, 259, 32, 121, 37, 32, + 37, 34, 37, 88, 34, 34, 37, 202, 34, 42, + 42, 75, 75, 42, 88, 88, 42, 42, 98, 42, + 54, 54, 54, 54, 100, 42, 437, 42, 45, 121, + 100, 45, 98, 130, 45, 45, 132, 45, 130, 435, + 132, 45, 142, 142, 45, 45, 55, 55, 55, 55, + 45, 63, 63, 63, 63, 64, 64, 64, 64, 133, - 350, 348, 346, 345, 344, 343, 342, 341, 340, 339, - 337, 335, 334, 332, 329, 328, 327, 326, 324, 323, - 321, 319, 317, 316, 313, 311, 310, 307, 306, 305, - 304, 303, 302, 301, 300, 299, 297, 295, 294, 293, - 292, 291, 289, 288, 287, 286, 285, 280, 278, 276, - 275, 274, 273, 272, 270, 269, 265, 264, 263, 259, - 258, 256, 255, 252, 251, 250, 249, 248, 247, 246, - 245, 243, 242, 240, 239, 238, 237, 236, 235, 234, - 232, 231, 229, 227, 226, 225, 224, 223, 222, 221, - 219, 217, 216, 214, 213, 212, 211, 210, 207, 206, + 63, 133, 141, 432, 64, 133, 141, 152, 152, 152, + 152, 153, 153, 153, 153, 141, 133, 154, 154, 154, + 154, 221, 367, 390, 403, 367, 441, 431, 430, 429, + 390, 428, 426, 441, 425, 424, 221, 423, 422, 420, + 403, 449, 449, 449, 449, 449, 449, 449, 450, 418, + 450, 450, 450, 450, 450, 451, 417, 451, 451, 451, + 451, 451, 452, 452, 452, 452, 453, 416, 453, 453, + 453, 453, 453, 454, 415, 414, 454, 454, 455, 455, + 455, 455, 455, 456, 456, 413, 456, 412, 411, 409, + 407, 406, 404, 401, 400, 399, 398, 396, 395, 393, - 205, 204, 203, 202, 201, 200, 197, 196, 195, 193, - 192, 191, 188, 187, 186, 185, 183, 182, 181, 180, - 179, 178, 177, 176, 175, 174, 173, 172, 170, 168, - 167, 166, 164, 163, 162, 161, 158, 157, 156, 155, - 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, - 141, 140, 139, 138, 136, 133, 132, 130, 129, 126, - 125, 124, 123, 120, 119, 118, 117, 116, 114, 113, - 111, 106, 105, 104, 103, 102, 101, 100, 99, 98, - 97, 96, 92, 91, 90, 87, 85, 84, 83, 82, - 81, 79, 78, 77, 76, 75, 74, 73, 72, 71, + 391, 389, 388, 384, 382, 381, 378, 377, 376, 375, + 374, 373, 372, 371, 370, 368, 366, 365, 364, 363, + 362, 361, 359, 358, 357, 356, 355, 350, 348, 346, + 345, 344, 343, 342, 340, 339, 335, 334, 333, 331, + 327, 326, 324, 323, 320, 319, 318, 317, 316, 315, + 314, 313, 312, 311, 309, 308, 307, 306, 304, 303, + 302, 300, 299, 297, 294, 293, 292, 291, 290, 289, + 288, 286, 285, 283, 282, 281, 279, 278, 277, 276, + 275, 272, 271, 270, 269, 268, 267, 266, 265, 261, + 260, 258, 257, 256, 253, 252, 251, 250, 248, 246, - 70, 69, 67, 66, 64, 63, 61, 60, 59, 57, - 55, 54, 52, 49, 48, 47, 46, 36, 35, 34, - 31, 28, 27, 24, 20, 17, 14, 7, 5, 3, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376 + 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, + 234, 233, 232, 230, 229, 228, 227, 226, 225, 224, + 223, 222, 219, 218, 217, 216, 215, 214, 213, 212, + 211, 210, 208, 207, 206, 205, 203, 201, 200, 199, + 197, 194, 193, 191, 190, 187, 186, 185, 184, 174, + 173, 171, 170, 169, 168, 167, 164, 163, 162, 159, + 157, 150, 149, 148, 147, 146, 145, 144, 143, 138, + 136, 135, 134, 131, 129, 128, 127, 126, 125, 124, + 122, 120, 119, 118, 117, 116, 115, 114, 111, 110, + 108, 107, 105, 104, 103, 102, 101, 99, 97, 95, + + 93, 91, 90, 86, 82, 81, 78, 76, 74, 71, + 69, 61, 57, 56, 53, 50, 48, 47, 44, 43, + 40, 39, 36, 26, 25, 16, 12, 9, 7, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 448 } ; static yy_state_type yy_last_accepting_state; @@ -606,7 +656,7 @@ char *yytext; #define INITIAL 0 #line 2 "lexer.l" ///////////////////////////////////////////////////////////////////////// -// $Id: lexer.c,v 1.13 2003-08-01 10:14:48 akrisak Exp $ +// $Id: lexer.c,v 1.14 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// #include @@ -623,6 +673,10 @@ int bx_yyinput(char *buf, int max_size); static char *lex_input_ptr = NULL; static unsigned lex_input_size = 0; +#define EXAMINE 1 + +#define DISASM 2 + /* Macros after this point can all be overridden by user definitions in * section 1. @@ -773,7 +827,7 @@ YY_DECL register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 23 "lexer.l" +#line 25 "lexer.l" if ( yy_init ) @@ -825,13 +879,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 377 ) + if ( yy_current_state >= 449 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 431 ); + while ( yy_base[yy_current_state] != 530 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -859,566 +913,768 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 24 "lexer.l" +#line 26 "lexer.l" ; // eat up whitespace YY_BREAK case 2: YY_RULE_SETUP -#line 25 "lexer.l" +#line 27 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET); } YY_BREAK case 3: YY_RULE_SETUP -#line 26 "lexer.l" +#line 28 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIS); } YY_BREAK case 4: YY_RULE_SETUP -#line 27 "lexer.l" +#line 29 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ON); } YY_BREAK case 5: YY_RULE_SETUP -#line 28 "lexer.l" +#line 30 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_OFF); } YY_BREAK case 6: YY_RULE_SETUP -#line 29 "lexer.l" +#line 31 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CRC); } YY_BREAK case 7: +#line 33 "lexer.l" +case 8: YY_RULE_SETUP -#line 30 "lexer.l" +#line 33 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } YY_BREAK -case 8: -#line 32 "lexer.l" case 9: -#line 33 "lexer.l" +#line 35 "lexer.l" case 10: -#line 34 "lexer.l" +#line 36 "lexer.l" case 11: YY_RULE_SETUP -#line 34 "lexer.l" +#line 36 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STEPN); } YY_BREAK case 12: -YY_RULE_SETUP -#line 35 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_VBREAKPOINT); } - YY_BREAK +#line 38 "lexer.l" case 13: -YY_RULE_SETUP -#line 36 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_VBREAKPOINT); } - YY_BREAK +#line 39 "lexer.l" case 14: YY_RULE_SETUP -#line 37 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LBREAKPOINT); } +#line 39 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_STEP_OVER); } YY_BREAK case 15: YY_RULE_SETUP -#line 38 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LBREAKPOINT); } +#line 40 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LIST_BREAK); } YY_BREAK case 16: -YY_RULE_SETUP -#line 39 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } - YY_BREAK +#line 42 "lexer.l" case 17: YY_RULE_SETUP -#line 40 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } +#line 42 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_VBREAKPOINT); } YY_BREAK case 18: -YY_RULE_SETUP -#line 41 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO); } - YY_BREAK +#line 44 "lexer.l" case 19: YY_RULE_SETUP -#line 42 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } +#line 44 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LBREAKPOINT); } YY_BREAK case 20: +#line 46 "lexer.l" +case 21: +#line 47 "lexer.l" +case 22: +#line 48 "lexer.l" +case 23: YY_RULE_SETUP -#line 43 "lexer.l" +#line 48 "lexer.l" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } YY_BREAK -case 21: -YY_RULE_SETUP -#line 44 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PROGRAM); } - YY_BREAK -case 22: -#line 46 "lexer.l" -case 23: -#line 47 "lexer.l" case 24: YY_RULE_SETUP -#line 47 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTROL_REGS); } +#line 49 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO); } YY_BREAK case 25: -#line 49 "lexer.l" -case 26: -#line 50 "lexer.l" -case 27: YY_RULE_SETUP #line 50 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGISTERS); } +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PROGRAM); } YY_BREAK +case 26: +#line 52 "lexer.l" +case 27: +#line 53 "lexer.l" case 28: YY_RULE_SETUP -#line 51 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FPU); } +#line 53 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTROL_REGS); } YY_BREAK case 29: -YY_RULE_SETUP -#line 52 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALL); } - YY_BREAK +#line 55 "lexer.l" case 30: -YY_RULE_SETUP -#line 53 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); } - YY_BREAK +#line 56 "lexer.l" case 31: YY_RULE_SETUP -#line 54 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IVT); } +#line 56 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGISTERS); } YY_BREAK case 32: YY_RULE_SETUP -#line 55 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GDT); } +#line 57 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FPU); } YY_BREAK case 33: YY_RULE_SETUP -#line 56 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LDT); } +#line 58 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CPU); } YY_BREAK case 34: YY_RULE_SETUP -#line 57 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TSS); } +#line 59 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALL); } YY_BREAK case 35: YY_RULE_SETUP -#line 58 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIRTY); } +#line 60 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); } YY_BREAK case 36: YY_RULE_SETUP -#line 59 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LINUX); } +#line 61 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IVT); } YY_BREAK case 37: YY_RULE_SETUP -#line 60 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DUMP_CPU); } +#line 62 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GDT); } YY_BREAK case 38: YY_RULE_SETUP -#line 61 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } +#line 63 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LDT); } YY_BREAK case 39: YY_RULE_SETUP -#line 62 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } +#line 64 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TSS); } YY_BREAK case 40: YY_RULE_SETUP -#line 63 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } +#line 65 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIRTY); } YY_BREAK case 41: YY_RULE_SETUP -#line 64 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); } +#line 66 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LINUX); } YY_BREAK case 42: YY_RULE_SETUP -#line 65 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); } +#line 67 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DUMP_CPU); } YY_BREAK case 43: -YY_RULE_SETUP -#line 66 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } - YY_BREAK +#line 69 "lexer.l" case 44: -YY_RULE_SETUP -#line 67 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } - YY_BREAK +#line 70 "lexer.l" case 45: YY_RULE_SETUP -#line 68 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SETPMEM); } +#line 70 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } YY_BREAK case 46: YY_RULE_SETUP -#line 69 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUERY); } +#line 71 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ENABLE_BREAKPOINT); } YY_BREAK case 47: YY_RULE_SETUP -#line 70 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PENDING); } +#line 72 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISABLE_BREAKPOINT); } YY_BREAK case 48: -YY_RULE_SETUP -#line 71 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TAKE); } - YY_BREAK +#line 74 "lexer.l" case 49: -YY_RULE_SETUP -#line 72 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DMA); } - YY_BREAK +#line 75 "lexer.l" case 50: YY_RULE_SETUP -#line 73 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IRQ); } +#line 75 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); } YY_BREAK case 51: -YY_RULE_SETUP -#line 74 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET_CPU); } - YY_BREAK +#line 77 "lexer.l" case 52: -#line 76 "lexer.l" +YY_RULE_SETUP +#line 77 "lexer.l" +{ BEGIN(EXAMINE); bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } + YY_BREAK case 53: YY_RULE_SETUP -#line 76 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISASSEMBLE); } +#line 78 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SETPMEM); } YY_BREAK case 54: YY_RULE_SETUP -#line 77 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_MATHS); } +#line 79 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUERY); } YY_BREAK case 55: YY_RULE_SETUP -#line 78 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ADD); } +#line 80 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PENDING); } YY_BREAK case 56: YY_RULE_SETUP -#line 79 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SUB); } +#line 81 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TAKE); } YY_BREAK case 57: YY_RULE_SETUP -#line 80 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_MUL); } +#line 82 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DMA); } YY_BREAK case 58: YY_RULE_SETUP -#line 81 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIV); } +#line 83 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_IRQ); } YY_BREAK case 59: YY_RULE_SETUP -#line 82 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INSTRUMENT); } +#line 84 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PIC); } YY_BREAK case 60: YY_RULE_SETUP -#line 83 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_START); } +#line 85 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET_CPU); } YY_BREAK case 61: -YY_RULE_SETUP -#line 84 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_STOP); } - YY_BREAK +#line 87 "lexer.l" case 62: -YY_RULE_SETUP -#line 85 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_RESET); } - YY_BREAK +#line 88 "lexer.l" case 63: YY_RULE_SETUP -#line 86 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT); } +#line 88 "lexer.l" +{ BEGIN(DISASM); bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISASSEMBLE); } YY_BREAK case 64: YY_RULE_SETUP -#line 87 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LOADER); } +#line 89 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INSTRUMENT); } YY_BREAK case 65: YY_RULE_SETUP -#line 88 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DOIT); } +#line 90 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_START); } YY_BREAK case 66: YY_RULE_SETUP -#line 89 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEON); } +#line 91 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_STOP); } YY_BREAK case 67: YY_RULE_SETUP -#line 90 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEOFF); } +#line 92 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_RESET); } YY_BREAK case 68: YY_RULE_SETUP -#line 91 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGON); } +#line 93 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT); } YY_BREAK case 69: YY_RULE_SETUP -#line 92 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGOFF); } +#line 94 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LOADER); } YY_BREAK case 70: YY_RULE_SETUP -#line 93 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PTIME); } +#line 95 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DOIT); } YY_BREAK case 71: YY_RULE_SETUP -#line 94 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP); } +#line 96 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEON); } YY_BREAK case 72: YY_RULE_SETUP -#line 95 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP_ABSOLUTE); } +#line 97 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEOFF); } YY_BREAK case 73: YY_RULE_SETUP -#line 96 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_RECORD); } +#line 98 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGON); } YY_BREAK case 74: YY_RULE_SETUP -#line 97 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PLAYBACK); } +#line 99 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TRACEREGOFF); } YY_BREAK case 75: YY_RULE_SETUP -#line 98 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_MODEBP); } +#line 100 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PTIME); } YY_BREAK case 76: YY_RULE_SETUP -#line 99 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STACK); } +#line 101 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP); } YY_BREAK case 77: YY_RULE_SETUP -#line 100 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WATCH); } +#line 102 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_TIMEBP_ABSOLUTE); } YY_BREAK case 78: YY_RULE_SETUP -#line 101 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_UNWATCH); } +#line 103 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_RECORD); } YY_BREAK case 79: YY_RULE_SETUP -#line 102 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_READ); } +#line 104 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PLAYBACK); } YY_BREAK case 80: YY_RULE_SETUP -#line 103 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WRITE); } +#line 105 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_MODEBP); } YY_BREAK case 81: YY_RULE_SETUP -#line 104 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } +#line 106 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STACK); } YY_BREAK case 82: YY_RULE_SETUP -#line 105 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SHOW); } +#line 107 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WATCH); } YY_BREAK case 83: YY_RULE_SETUP -#line 106 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOL); } +#line 108 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_UNWATCH); } YY_BREAK case 84: YY_RULE_SETUP -#line 107 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GLOBAL); } +#line 109 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_READ); } YY_BREAK case 85: YY_RULE_SETUP -#line 108 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WHERE); } +#line 110 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WRITE); } YY_BREAK case 86: YY_RULE_SETUP -#line 109 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STRING); } +#line 111 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } YY_BREAK case 87: YY_RULE_SETUP -#line 110 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIFF_MEMORY); } +#line 112 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SHOW); } YY_BREAK case 88: YY_RULE_SETUP -#line 111 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYNC_MEMORY); } +#line 113 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOL); } YY_BREAK case 89: YY_RULE_SETUP -#line 112 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYNC_CPU); } +#line 114 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOLS); } YY_BREAK case 90: YY_RULE_SETUP -#line 113 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FAST_FORWARD); } +#line 115 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_LIST_SYMBOLS); } YY_BREAK case 91: YY_RULE_SETUP -#line 114 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PHY_2_LOG); } +#line 116 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GLOBAL); } YY_BREAK case 92: YY_RULE_SETUP -#line 115 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO_ADDRESS); } +#line 117 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_WHERE); } YY_BREAK case 93: YY_RULE_SETUP -#line 116 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } +#line 118 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STRING); } YY_BREAK case 94: YY_RULE_SETUP -#line 117 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } +#line 119 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIFF_MEMORY); } YY_BREAK case 95: YY_RULE_SETUP -#line 118 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PAGE); } +#line 120 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYNC_MEMORY); } YY_BREAK case 96: YY_RULE_SETUP -#line 119 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CS); } +#line 121 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYNC_CPU); } YY_BREAK case 97: YY_RULE_SETUP -#line 120 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ES); } +#line 122 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FAST_FORWARD); } YY_BREAK case 98: YY_RULE_SETUP -#line 121 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SS); } +#line 123 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PHY_2_LOG); } YY_BREAK case 99: YY_RULE_SETUP -#line 122 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DS); } +#line 124 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO_ADDRESS); } YY_BREAK case 100: YY_RULE_SETUP -#line 123 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); } +#line 125 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } YY_BREAK case 101: YY_RULE_SETUP -#line 124 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GS); } +#line 126 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } YY_BREAK case 102: YY_RULE_SETUP -#line 125 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALWAYS_CHECK); } +#line 127 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_PAGE); } YY_BREAK case 103: YY_RULE_SETUP -#line 126 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_V2L); } +#line 128 "lexer.l" +{ bxlval.reg=rAL; return (BX_TOKEN_REG_AL);} YY_BREAK case 104: YY_RULE_SETUP -#line 127 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); } +#line 129 "lexer.l" +{ bxlval.reg=rBL; return (BX_TOKEN_REG_BL);} YY_BREAK case 105: YY_RULE_SETUP -#line 128 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_STRING); } +#line 130 "lexer.l" +{ bxlval.reg=rCL; return (BX_TOKEN_REG_CL);} YY_BREAK case 106: YY_RULE_SETUP -#line 129 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } +#line 131 "lexer.l" +{ bxlval.reg=rDL; return (BX_TOKEN_REG_DL);} YY_BREAK case 107: YY_RULE_SETUP -#line 130 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } +#line 132 "lexer.l" +{ bxlval.reg=rAH; return (BX_TOKEN_REG_AH);} YY_BREAK case 108: YY_RULE_SETUP -#line 131 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } +#line 133 "lexer.l" +{ bxlval.reg=rBH; return (BX_TOKEN_REG_BH);} YY_BREAK case 109: YY_RULE_SETUP -#line 132 "lexer.l" -{ bxlval.uval = strtoul(bxtext+2, NULL, 16); return(BX_TOKEN_NUMERIC); } +#line 134 "lexer.l" +{ bxlval.reg=rCH; return (BX_TOKEN_REG_CH);} YY_BREAK case 110: YY_RULE_SETUP -#line 133 "lexer.l" -{ bxlval.uval = strtoul(bxtext+1, NULL, 8); return(BX_TOKEN_NUMERIC); } +#line 135 "lexer.l" +{ bxlval.reg=rDH; return (BX_TOKEN_REG_DH);} YY_BREAK case 111: YY_RULE_SETUP -#line 134 "lexer.l" -{ bxlval.ulval = strtoull(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); } +#line 136 "lexer.l" +{ bxlval.reg=rAX; return (BX_TOKEN_REG_AX);} YY_BREAK case 112: YY_RULE_SETUP -#line 135 "lexer.l" -{ bxlval.uval = strtoul(bxtext, NULL, 10); return(BX_TOKEN_NUMERIC); } +#line 137 "lexer.l" +{ bxlval.reg=rBX; return (BX_TOKEN_REG_BX);} YY_BREAK case 113: YY_RULE_SETUP -#line 136 "lexer.l" -{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOLNAME); } +#line 138 "lexer.l" +{ bxlval.reg=rCX; return (BX_TOKEN_REG_CX);} YY_BREAK case 114: YY_RULE_SETUP -#line 137 "lexer.l" -{ return('\n'); } +#line 139 "lexer.l" +{ bxlval.reg=rDX; return (BX_TOKEN_REG_DX);} YY_BREAK case 115: YY_RULE_SETUP -#line 138 "lexer.l" -; // eat up comments '//' +#line 140 "lexer.l" +{ bxlval.reg=rEAX; return (BX_TOKEN_REG_EAX);} YY_BREAK case 116: YY_RULE_SETUP -#line 139 "lexer.l" -{ return(bxtext[0]); } +#line 141 "lexer.l" +{ bxlval.reg=rEBX; return (BX_TOKEN_REG_EBX);} YY_BREAK case 117: YY_RULE_SETUP -#line 140 "lexer.l" +#line 142 "lexer.l" +{ bxlval.reg=rECX; return (BX_TOKEN_REG_ECX);} + YY_BREAK +case 118: +YY_RULE_SETUP +#line 143 "lexer.l" +{ bxlval.reg=rEDX; return (BX_TOKEN_REG_EDX);} + YY_BREAK +case 119: +YY_RULE_SETUP +#line 144 "lexer.l" +{ bxlval.reg=rSI; return (BX_TOKEN_REG_SI);} + YY_BREAK +case 120: +YY_RULE_SETUP +#line 145 "lexer.l" +{ bxlval.reg=rDI; return (BX_TOKEN_REG_DI);} + YY_BREAK +case 121: +YY_RULE_SETUP +#line 146 "lexer.l" +{ bxlval.reg=rBP; return (BX_TOKEN_REG_BP);} + YY_BREAK +case 122: +YY_RULE_SETUP +#line 147 "lexer.l" +{ bxlval.reg=rSP; return (BX_TOKEN_REG_SP);} + YY_BREAK +case 123: +YY_RULE_SETUP +#line 148 "lexer.l" +{ bxlval.reg=rIP; return (BX_TOKEN_REG_IP);} + YY_BREAK +case 124: +YY_RULE_SETUP +#line 149 "lexer.l" +{ bxlval.reg=rESI; return (BX_TOKEN_REG_ESI);} + YY_BREAK +case 125: +YY_RULE_SETUP +#line 150 "lexer.l" +{ bxlval.reg=rEDI; return (BX_TOKEN_REG_EDI);} + YY_BREAK +case 126: +YY_RULE_SETUP +#line 151 "lexer.l" +{ bxlval.reg=rEBP; return (BX_TOKEN_REG_EBP);} + YY_BREAK +case 127: +YY_RULE_SETUP +#line 152 "lexer.l" +{ bxlval.reg=rESP; return (BX_TOKEN_REG_ESP);} + YY_BREAK +case 128: +YY_RULE_SETUP +#line 153 "lexer.l" +{ bxlval.reg=rEIP; return (BX_TOKEN_REG_EIP);} + YY_BREAK +case 129: +YY_RULE_SETUP +#line 154 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CS); } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 155 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ES); } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 156 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SS); } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 157 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_DS); } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 158 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 159 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_GS); } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 160 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_FLAGS); } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 161 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALWAYS_CHECK); } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 162 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); } + YY_BREAK +case 138: +#line 164 "lexer.l" +case 139: +YY_RULE_SETUP +#line 164 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_CALC); } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 165 "lexer.l" +{ BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 166 "lexer.l" +{ BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 167 "lexer.l" +{ BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISFORMAT); } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 168 "lexer.l" +{ return ('+'); } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 169 "lexer.l" +{ return ('-'); } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 170 "lexer.l" +{ return ('*'); } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 171 "lexer.l" +{ return ('/'); } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 172 "lexer.l" +{ return (BX_TOKEN_RSHIFT); } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 173 "lexer.l" +{ return (BX_TOKEN_LSHIFT); } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 174 "lexer.l" +{ return ('&'); } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 175 "lexer.l" +{ return ('|'); } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 176 "lexer.l" +{ return ('^'); } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 177 "lexer.l" +{ return ('!'); } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 178 "lexer.l" +{ return ('('); } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 179 "lexer.l" +{ return (')'); } + YY_BREAK +case 155: +#line 181 "lexer.l" +case 156: +YY_RULE_SETUP +#line 181 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_STRING); } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 182 "lexer.l" +{ bxlval.uval = strtoul(bxtext+2, NULL, 16); return(BX_TOKEN_NUMERIC); } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 183 "lexer.l" +{ bxlval.uval = strtoul(bxtext+1, NULL, 8); return(BX_TOKEN_NUMERIC); } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 184 "lexer.l" +{ bxlval.ulval = strtoull(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 185 "lexer.l" +{ bxlval.uval = strtoul(bxtext, NULL, 10); return(BX_TOKEN_NUMERIC); } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 186 "lexer.l" +{ bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOLNAME); } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 187 "lexer.l" +{ return('\n'); } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 188 "lexer.l" +; // eat up comments '//' + YY_BREAK +case 164: +YY_RULE_SETUP +#line 189 "lexer.l" +{ return(bxtext[0]); } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 190 "lexer.l" +{ BEGIN(INITIAL); unput(*bxtext); } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 191 "lexer.l" ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(EXAMINE): +case YY_STATE_EOF(DISASM): yyterminate(); case YY_END_OF_BUFFER: @@ -1709,7 +1965,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 377 ) + if ( yy_current_state >= 449 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1744,11 +2000,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 377 ) + if ( yy_current_state >= 449 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 376); + yy_is_jam = (yy_current_state == 448); return yy_is_jam ? 0 : yy_current_state; } @@ -2298,7 +2554,7 @@ int main() return 0; } #endif -#line 140 "lexer.l" +#line 191 "lexer.l" // [A-Za-z_][A-Za-z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GENERIC); } diff --git a/bochs/debug/lexer.l b/bochs/debug/lexer.l index 34c1e3d5c..988e8f156 100644 --- a/bochs/debug/lexer.l +++ b/bochs/debug/lexer.l @@ -1,6 +1,6 @@ %{ ///////////////////////////////////////////////////////////////////////// -// $Id: lexer.l,v 1.11 2003-08-01 10:14:48 akrisak Exp $ +// $Id: lexer.l,v 1.12 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// #include @@ -19,28 +19,34 @@ static char *lex_input_ptr = NULL; static unsigned lex_input_size = 0; %} +%x EXAMINE +%x DISASM %% -[ \t]+ ; // eat up whitespace +<*>[ \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); } -c { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } +c | +cont { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } stepi | step | -si | s { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STEPN); } -vb { bxlval.sval = strdup(bxtext); return(BX_TOKEN_VBREAKPOINT); } +next | +n | +p { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STEP_OVER); } +blist { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LIST_BREAK); } +vb | vbreak { bxlval.sval = strdup(bxtext); return(BX_TOKEN_VBREAKPOINT); } -lb { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LBREAKPOINT); } +lb | lbreak { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LBREAKPOINT); } -pb { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } +break | +b | +pb | pbreak { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } info { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO); } -break { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } -b { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); } program { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PROGRAM); } cr | creg | @@ -49,6 +55,7 @@ r | reg | registers { bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGISTERS); } fpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FPU); } +cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CPU); } all { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALL); } idt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); } ivt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IVT); } @@ -58,27 +65,27 @@ tss { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TSS); } dirty { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIRTY); } linux { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LINUX); } dump_cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DUMP_CPU); } -delete { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } -del { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } +delete | +del | d { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); } -quit { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); } +bpe { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ENABLE_BREAKPOINT); } +bpd { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISABLE_BREAKPOINT); } +quit | +exit | q { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); } -x { bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } -xp { bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } +x | +xp { BEGIN(EXAMINE); bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); } setpmem { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SETPMEM); } query { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUERY); } pending { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PENDING); } take { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TAKE); } dma { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DMA); } irq { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IRQ); } +pic { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PIC); } set_cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET_CPU); } +u | disas | -disassemble { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISASSEMBLE); } -maths { bxlval.sval = strdup(bxtext); return(BX_TOKEN_MATHS); } -add { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ADD); } -sub { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SUB); } -mul { bxlval.sval = strdup(bxtext); return(BX_TOKEN_MUL); } -div { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIV); } +disassemble { BEGIN(DISASM); bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISASSEMBLE); } instrument { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INSTRUMENT); } start { bxlval.sval = strdup(bxtext); return(BX_TOKEN_START); } stop { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STOP); } @@ -104,6 +111,8 @@ write { bxlval.sval = strdup(bxtext); return(BX_TOKEN_WRITE); } continue { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); } show { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SHOW); } load-symbols { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOL); } +symbols { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOLS); } +slist { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LIST_SYMBOLS); } global { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GLOBAL); } where { bxlval.sval = strdup(bxtext); return(BX_TOKEN_WHERE); } print-string { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STRING); } @@ -116,27 +125,69 @@ addr-info { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO_ADDRESS); } ne2k { bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } ne2000 { bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); } page { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PAGE); } +al { bxlval.reg=rAL; return (BX_TOKEN_REG_AL);} +bl { bxlval.reg=rBL; return (BX_TOKEN_REG_BL);} +cl { bxlval.reg=rCL; return (BX_TOKEN_REG_CL);} +dl { bxlval.reg=rDL; return (BX_TOKEN_REG_DL);} +ah { bxlval.reg=rAH; return (BX_TOKEN_REG_AH);} +bh { bxlval.reg=rBH; return (BX_TOKEN_REG_BH);} +ch { bxlval.reg=rCH; return (BX_TOKEN_REG_CH);} +dh { bxlval.reg=rDH; return (BX_TOKEN_REG_DH);} +ax { bxlval.reg=rAX; return (BX_TOKEN_REG_AX);} +bx { bxlval.reg=rBX; return (BX_TOKEN_REG_BX);} +cx { bxlval.reg=rCX; return (BX_TOKEN_REG_CX);} +dx { bxlval.reg=rDX; return (BX_TOKEN_REG_DX);} +eax { bxlval.reg=rEAX; return (BX_TOKEN_REG_EAX);} +ebx { bxlval.reg=rEBX; return (BX_TOKEN_REG_EBX);} +ecx { bxlval.reg=rECX; return (BX_TOKEN_REG_ECX);} +edx { bxlval.reg=rEDX; return (BX_TOKEN_REG_EDX);} +si { bxlval.reg=rSI; return (BX_TOKEN_REG_SI);} +di { bxlval.reg=rDI; return (BX_TOKEN_REG_DI);} +bp { bxlval.reg=rBP; return (BX_TOKEN_REG_BP);} +sp { bxlval.reg=rSP; return (BX_TOKEN_REG_SP);} +ip { bxlval.reg=rIP; return (BX_TOKEN_REG_IP);} +esi { bxlval.reg=rESI; return (BX_TOKEN_REG_ESI);} +edi { bxlval.reg=rEDI; return (BX_TOKEN_REG_EDI);} +ebp { bxlval.reg=rEBP; return (BX_TOKEN_REG_EBP);} +esp { bxlval.reg=rESP; return (BX_TOKEN_REG_ESP);} +eip { bxlval.reg=rEIP; return (BX_TOKEN_REG_EIP);} cs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CS); } es { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ES); } ss { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SS); } ds { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DS); } fs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); } gs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GS); } +flags { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FLAGS); } force-check { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALWAYS_CHECK); } -v2l { bxlval.sval = strdup(bxtext); return(BX_TOKEN_V2L); } help { bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); } +\? | +calc { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CALC); } +\/[0-9]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } +\/[0-9]*[mxduotcsibhwg]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } +\/[0-9]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISFORMAT); } +"+" { return ('+'); } +"-" { return ('-'); } +"*" { return ('*'); } +"/" { return ('/'); } +">>" { return (BX_TOKEN_RSHIFT); } +"<<" { return (BX_TOKEN_LSHIFT); } +"&" { return ('&'); } +"|" { return ('|'); } +"^" { return ('^'); } +"!" { return ('!'); } +"(" { return ('('); } +")" { return (')'); } +\'[^\'\n]*\' | \"[^\"\n]*\" { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STRING); } -\/[0-9]*[xduotcsibhwg][xduotcsibhwg] { bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } -\/[0-9]*[xduotcsibhwg] { bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } -\/[0-9]+ { bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); } 0x[0-9a-fA-F]+ { bxlval.uval = strtoul(bxtext+2, NULL, 16); return(BX_TOKEN_NUMERIC); } 0[0-7]+ { bxlval.uval = strtoul(bxtext+1, NULL, 8); return(BX_TOKEN_NUMERIC); } [0-9]+L { bxlval.ulval = strtoull(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); } [0-9]+ { bxlval.uval = strtoul(bxtext, NULL, 10); return(BX_TOKEN_NUMERIC); } $[a-zA-Z_][a-zA-Z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOLNAME); } -\n { return('\n'); } +<*>\n { return('\n'); } [#][^\n]* ; // eat up comments '//' . { return(bxtext[0]); } +. { BEGIN(INITIAL); unput(*bxtext); } %% // [A-Za-z_][A-Za-z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GENERIC); } diff --git a/bochs/debug/parser.c b/bochs/debug/parser.c index fddc5b33c..c9f07253e 100644 --- a/bochs/debug/parser.c +++ b/bochs/debug/parser.c @@ -45,236 +45,295 @@ static int yygrowstack(); #include "debug.h" #if BX_DEBUGGER -/* -NOTE: The #if comes from parser.y. The makefile will add the matching #endif -at the end of parser.c. I don't know any way to ask yacc to put it at the end. -*/ /* %left '-' '+'*/ /* %left '*' '/'*/ /* %right*/ /* %nonassoc UMINUS*/ -#line 23 "parser.y" +#line 19 "parser.y" typedef union { char *sval; Bit32u uval; Bit64u ulval; bx_num_range uval_range; + Regs reg; } YYSTYPE; -#line 65 "y.tab.c" +#line 62 "y.tab.c" #define YYERRCODE 256 -#define BX_TOKEN_CONTINUE 257 -#define BX_TOKEN_STEPN 258 -#define BX_TOKEN_NEXT_STEP 259 -#define BX_TOKEN_SET 260 -#define BX_TOKEN_DEBUGGER 261 -#define BX_TOKEN_VBREAKPOINT 262 -#define BX_TOKEN_LBREAKPOINT 263 -#define BX_TOKEN_PBREAKPOINT 264 -#define BX_TOKEN_DEL_BREAKPOINT 265 -#define BX_TOKEN_INFO 266 -#define BX_TOKEN_QUIT 267 -#define BX_TOKEN_PROGRAM 268 -#define BX_TOKEN_REGISTERS 269 -#define BX_TOKEN_FPU 270 -#define BX_TOKEN_ALL 271 -#define BX_TOKEN_IDT 272 -#define BX_TOKEN_GDT 273 -#define BX_TOKEN_LDT 274 -#define BX_TOKEN_TSS 275 -#define BX_TOKEN_DIRTY 276 -#define BX_TOKEN_LINUX 277 -#define BX_TOKEN_CONTROL_REGS 278 -#define BX_TOKEN_EXAMINE 279 -#define BX_TOKEN_XFORMAT 280 -#define BX_TOKEN_SETPMEM 281 -#define BX_TOKEN_SYMBOLNAME 282 -#define BX_TOKEN_QUERY 283 -#define BX_TOKEN_PENDING 284 -#define BX_TOKEN_TAKE 285 -#define BX_TOKEN_DMA 286 -#define BX_TOKEN_IRQ 287 -#define BX_TOKEN_DUMP_CPU 288 -#define BX_TOKEN_SET_CPU 289 -#define BX_TOKEN_DIS 290 -#define BX_TOKEN_ON 291 -#define BX_TOKEN_OFF 292 -#define BX_TOKEN_DISASSEMBLE 293 -#define BX_TOKEN_INSTRUMENT 294 -#define BX_TOKEN_START 295 -#define BX_TOKEN_STOP 296 -#define BX_TOKEN_RESET 297 -#define BX_TOKEN_PRINT 298 -#define BX_TOKEN_LOADER 299 -#define BX_TOKEN_STRING 300 -#define BX_TOKEN_DOIT 301 -#define BX_TOKEN_CRC 302 -#define BX_TOKEN_TRACEON 303 -#define BX_TOKEN_TRACEOFF 304 -#define BX_TOKEN_PTIME 305 -#define BX_TOKEN_TIMEBP_ABSOLUTE 306 -#define BX_TOKEN_TIMEBP 307 -#define BX_TOKEN_RECORD 308 -#define BX_TOKEN_PLAYBACK 309 -#define BX_TOKEN_MODEBP 310 -#define BX_TOKEN_PRINT_STACK 311 -#define BX_TOKEN_WATCH 312 -#define BX_TOKEN_UNWATCH 313 -#define BX_TOKEN_READ 314 -#define BX_TOKEN_WRITE 315 -#define BX_TOKEN_SHOW 316 -#define BX_TOKEN_SYMBOL 317 -#define BX_TOKEN_GLOBAL 318 -#define BX_TOKEN_WHERE 319 -#define BX_TOKEN_PRINT_STRING 320 -#define BX_TOKEN_DIFF_MEMORY 321 -#define BX_TOKEN_SYNC_MEMORY 322 -#define BX_TOKEN_SYNC_CPU 323 -#define BX_TOKEN_FAST_FORWARD 324 -#define BX_TOKEN_PHY_2_LOG 325 -#define BX_TOKEN_NUMERIC 326 -#define BX_TOKEN_LONG_NUMERIC 327 -#define BX_TOKEN_INFO_ADDRESS 328 -#define BX_TOKEN_NE2000 329 -#define BX_TOKEN_PAGE 330 -#define BX_TOKEN_CS 331 -#define BX_TOKEN_ES 332 -#define BX_TOKEN_SS 333 -#define BX_TOKEN_DS 334 -#define BX_TOKEN_FS 335 -#define BX_TOKEN_GS 336 -#define BX_TOKEN_ALWAYS_CHECK 337 -#define BX_TOKEN_MATHS 338 -#define BX_TOKEN_ADD 339 -#define BX_TOKEN_SUB 340 -#define BX_TOKEN_MUL 341 -#define BX_TOKEN_DIV 342 -#define BX_TOKEN_V2L 343 -#define BX_TOKEN_TRACEREGON 344 -#define BX_TOKEN_TRACEREGOFF 345 -#define BX_TOKEN_HELP 346 -#define BX_TOKEN_IVT 347 +#define BX_TOKEN_REG_AL 257 +#define BX_TOKEN_REG_BL 258 +#define BX_TOKEN_REG_CL 259 +#define BX_TOKEN_REG_DL 260 +#define BX_TOKEN_REG_AH 261 +#define BX_TOKEN_REG_BH 262 +#define BX_TOKEN_REG_CH 263 +#define BX_TOKEN_REG_DH 264 +#define BX_TOKEN_REG_AX 265 +#define BX_TOKEN_REG_BX 266 +#define BX_TOKEN_REG_CX 267 +#define BX_TOKEN_REG_DX 268 +#define BX_TOKEN_REG_EAX 269 +#define BX_TOKEN_REG_EBX 270 +#define BX_TOKEN_REG_ECX 271 +#define BX_TOKEN_REG_EDX 272 +#define BX_TOKEN_REG_SI 273 +#define BX_TOKEN_REG_DI 274 +#define BX_TOKEN_REG_BP 275 +#define BX_TOKEN_REG_SP 276 +#define BX_TOKEN_REG_IP 277 +#define BX_TOKEN_REG_ESI 278 +#define BX_TOKEN_REG_EDI 279 +#define BX_TOKEN_REG_EBP 280 +#define BX_TOKEN_REG_ESP 281 +#define BX_TOKEN_REG_EIP 282 +#define BX_TOKEN_CONTINUE 283 +#define BX_TOKEN_STEPN 284 +#define BX_TOKEN_STEP_OVER 285 +#define BX_TOKEN_NEXT_STEP 286 +#define BX_TOKEN_SET 287 +#define BX_TOKEN_DEBUGGER 288 +#define BX_TOKEN_LIST_BREAK 289 +#define BX_TOKEN_VBREAKPOINT 290 +#define BX_TOKEN_LBREAKPOINT 291 +#define BX_TOKEN_PBREAKPOINT 292 +#define BX_TOKEN_DEL_BREAKPOINT 293 +#define BX_TOKEN_ENABLE_BREAKPOINT 294 +#define BX_TOKEN_DISABLE_BREAKPOINT 295 +#define BX_TOKEN_INFO 296 +#define BX_TOKEN_QUIT 297 +#define BX_TOKEN_PROGRAM 298 +#define BX_TOKEN_REGISTERS 299 +#define BX_TOKEN_CPU 300 +#define BX_TOKEN_FPU 301 +#define BX_TOKEN_ALL 302 +#define BX_TOKEN_IDT 303 +#define BX_TOKEN_GDT 304 +#define BX_TOKEN_LDT 305 +#define BX_TOKEN_TSS 306 +#define BX_TOKEN_DIRTY 307 +#define BX_TOKEN_LINUX 308 +#define BX_TOKEN_CONTROL_REGS 309 +#define BX_TOKEN_EXAMINE 310 +#define BX_TOKEN_XFORMAT 311 +#define BX_TOKEN_DISFORMAT 312 +#define BX_TOKEN_SETPMEM 313 +#define BX_TOKEN_SYMBOLNAME 314 +#define BX_TOKEN_QUERY 315 +#define BX_TOKEN_PENDING 316 +#define BX_TOKEN_TAKE 317 +#define BX_TOKEN_DMA 318 +#define BX_TOKEN_IRQ 319 +#define BX_TOKEN_DUMP_CPU 320 +#define BX_TOKEN_SET_CPU 321 +#define BX_TOKEN_DIS 322 +#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_PTIME 337 +#define BX_TOKEN_TIMEBP_ABSOLUTE 338 +#define BX_TOKEN_TIMEBP 339 +#define BX_TOKEN_RECORD 340 +#define BX_TOKEN_PLAYBACK 341 +#define BX_TOKEN_MODEBP 342 +#define BX_TOKEN_PRINT_STACK 343 +#define BX_TOKEN_WATCH 344 +#define BX_TOKEN_UNWATCH 345 +#define BX_TOKEN_READ 346 +#define BX_TOKEN_WRITE 347 +#define BX_TOKEN_SHOW 348 +#define BX_TOKEN_SYMBOL 349 +#define BX_TOKEN_SYMBOLS 350 +#define BX_TOKEN_LIST_SYMBOLS 351 +#define BX_TOKEN_GLOBAL 352 +#define BX_TOKEN_WHERE 353 +#define BX_TOKEN_PRINT_STRING 354 +#define BX_TOKEN_DIFF_MEMORY 355 +#define BX_TOKEN_SYNC_MEMORY 356 +#define BX_TOKEN_SYNC_CPU 357 +#define BX_TOKEN_FAST_FORWARD 358 +#define BX_TOKEN_PHY_2_LOG 359 +#define BX_TOKEN_NUMERIC 360 +#define BX_TOKEN_LONG_NUMERIC 361 +#define BX_TOKEN_INFO_ADDRESS 362 +#define BX_TOKEN_NE2000 363 +#define BX_TOKEN_PIC 364 +#define BX_TOKEN_PAGE 365 +#define BX_TOKEN_CS 366 +#define BX_TOKEN_ES 367 +#define BX_TOKEN_SS 368 +#define BX_TOKEN_DS 369 +#define BX_TOKEN_FS 370 +#define BX_TOKEN_GS 371 +#define BX_TOKEN_FLAGS 372 +#define BX_TOKEN_ALWAYS_CHECK 373 +#define BX_TOKEN_TRACEREGON 374 +#define BX_TOKEN_TRACEREGOFF 375 +#define BX_TOKEN_HELP 376 +#define BX_TOKEN_CALC 377 +#define BX_TOKEN_RSHIFT 378 +#define BX_TOKEN_LSHIFT 379 +#define BX_TOKEN_IVT 380 +#define NOT 381 +#define NEG 382 const short bxlhs[] = { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 1, - 1, 1, 1, 1, 1, 27, 27, 28, 29, 30, - 30, 33, 33, 26, 24, 25, 31, 31, 32, 32, - 32, 32, 32, 32, 32, 32, 34, 34, 34, 35, - 36, 5, 6, 6, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 5, 5, 5, 5, 5, 5, + 38, 38, 39, 40, 41, 41, 44, 44, 37, 35, + 36, 42, 42, 43, 43, 43, 43, 43, 43, 43, + 43, 45, 45, 45, 46, 47, 11, 12, 12, 13, + 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 18, 19, 19, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 6, 6, 8, 8, 7, + 7, 20, 21, 22, 23, 24, 25, 25, 25, 25, + 26, 27, 28, 28, 28, 29, 30, 30, 31, 31, + 31, 31, 32, 33, 34, 49, 50, 51, 51, 52, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 4, 4, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 2, 2, 4, 4, 3, 3, 3, 10, 11, 12, - 13, 13, 13, 13, 14, 15, 16, 16, 16, 17, - 18, 19, 19, 19, 19, 20, 21, 22, 23, 23, - 23, 23, 23, 38, 39, 40, 41, 41, + 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 15, }; const short bxlen[] = { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, - 3, 3, 3, 3, 3, 3, 5, 4, 4, 1, - 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, - 2, 3, 2, 2, 2, 2, 2, 3, 3, 3, - 2, 2, 4, 4, 4, 4, 3, 4, 5, 2, - 3, 2, 2, 3, 4, 4, 5, 2, 5, 2, - 3, 2, 3, 4, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 3, 3, 3, 5, 7, - 0, 1, 0, 1, 1, 2, 3, 2, 3, 2, - 4, 3, 3, 2, 5, 3, 3, 4, 3, 2, - 3, 3, 3, 3, 3, 3, 3, 4, 5, 5, - 5, 5, 3, 5, 2, 2, 3, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 2, 3, 3, 3, 3, 3, + 3, 5, 4, 4, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, + 2, 2, 3, 3, 3, 2, 2, 4, 4, 4, + 4, 3, 4, 5, 2, 3, 2, 2, 3, 2, + 4, 4, 5, 2, 5, 2, 3, 3, 2, 3, + 4, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 3, 3, 3, 4, + 3, 3, 5, 7, 3, 0, 1, 0, 1, 1, + 2, 2, 3, 3, 3, 2, 4, 3, 3, 2, + 5, 3, 3, 4, 3, 2, 3, 4, 3, 3, + 3, 3, 3, 3, 4, 2, 2, 3, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 3, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 3, 5, }; const short bxdefred[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 39, 0, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 82, 0, 83, 0, - 0, 0, 88, 0, 90, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 120, 0, 0, 124, 0, 0, 0, - 0, 118, 130, 0, 114, 0, 0, 0, 0, 0, - 0, 0, 0, 65, 66, 64, 0, 0, 0, 0, - 0, 61, 0, 67, 0, 0, 0, 0, 71, 0, - 0, 72, 0, 63, 0, 0, 80, 0, 40, 0, - 0, 0, 0, 0, 0, 50, 51, 52, 53, 54, - 55, 0, 0, 0, 0, 0, 0, 0, 0, 145, - 146, 0, 148, 84, 0, 0, 0, 0, 91, 93, - 0, 119, 95, 96, 97, 98, 99, 0, 0, 0, - 0, 100, 106, 107, 0, 108, 0, 0, 122, 123, - 0, 126, 0, 127, 129, 116, 0, 131, 132, 133, - 134, 135, 136, 137, 0, 57, 56, 58, 59, 60, - 68, 70, 69, 0, 0, 0, 0, 62, 0, 77, - 0, 81, 41, 42, 43, 44, 45, 46, 0, 0, - 0, 143, 0, 0, 0, 0, 0, 147, 0, 85, - 86, 0, 94, 101, 103, 104, 105, 0, 102, 121, - 0, 128, 117, 138, 73, 75, 74, 76, 78, 0, - 0, 48, 49, 0, 0, 0, 0, 0, 87, 89, - 0, 109, 125, 79, 47, 139, 140, 141, 142, 144, - 0, 110, + 0, 0, 44, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 87, 0, 88, 90, + 0, 0, 102, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 181, 182, 183, 179, 180, 184, 185, 186, 190, + 191, 55, 56, 57, 58, 59, 60, 0, 94, 0, + 0, 187, 188, 189, 192, 193, 0, 0, 206, 207, + 0, 96, 0, 0, 209, 210, 0, 208, 0, 99, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 140, 0, 0, 0, 0, + 0, 132, 146, 0, 129, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 70, 71, 69, 0, 0, 0, + 0, 0, 66, 0, 72, 0, 0, 0, 0, 76, + 0, 0, 77, 0, 68, 0, 0, 0, 103, 85, + 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, + 156, 157, 0, 159, 0, 89, 0, 0, 0, 204, + 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 0, 100, 133, + 134, 135, 105, 107, 108, 106, 109, 110, 0, 0, + 0, 0, 111, 118, 121, 0, 119, 0, 122, 125, + 117, 0, 0, 138, 0, 139, 0, 142, 0, 143, + 145, 0, 147, 0, 0, 149, 150, 151, 152, 153, + 154, 0, 62, 61, 63, 64, 65, 73, 75, 74, + 0, 0, 0, 0, 67, 0, 82, 0, 104, 86, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 158, + 160, 0, 91, 92, 205, 198, 199, 0, 0, 0, + 0, 196, 197, 202, 0, 223, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 101, 112, 114, 115, + 116, 120, 0, 113, 0, 137, 0, 144, 148, 0, + 155, 78, 80, 79, 81, 83, 0, 0, 53, 54, + 93, 95, 0, 123, 224, 141, 84, 52, 0, 124, }; -const short bxdgoto[] = { 49, - 172, 0, 125, 126, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, +const short bxdgoto[] = { 54, + 142, 143, 144, 155, 156, 0, 195, 196, 147, 197, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, }; -const short bxsindex[] = { -10, - 1, -4, -246, -3, -2, -7, -309, -248, 28, -6, - -285, -213, -241, 33, 38, -254, -236, -227, -252, -251, - 66, 67, 68, -247, -245, -221, -217, 8, -1, 30, - 2, 32, -281, 74, -240, 75, -228, -226, -239, -238, - -278, -237, -290, -278, 80, 81, 37, 0, 0, 0, +const short bxsindex[] = { 610, + 4, -8, 12, -301, 33, 1846, 1655, 1251, -312, -309, + -296, 1480, 57, 446, 1534, -291, -244, -272, 64, 72, + 1999, -310, -247, -269, -264, 79, 91, 98, -250, -243, + -212, -208, -9, -7, 17, 26, -2, -308, -1, 115, + -234, 119, -271, -229, -232, -230, -290, -227, 125, 128, + 1, 2114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 82, 0, 34, - -224, 35, 0, 84, 0, 86, 0, -229, 88, 90, - 91, 92, 93, 94, -254, -254, -254, -254, 95, 96, - 97, -9, -254, 0, 3, 98, 0, -216, 99, 4, - 101, 0, 0, -56, 0, 102, 103, 104, 105, 106, - 107, 108, -207, 0, 0, 0, 110, 111, 112, 113, - 114, 0, 115, 0, 116, 117, -198, -197, 0, -196, - -195, 0, 122, 0, 5, -167, 0, 124, 0, 125, - 126, 127, 128, 129, 130, 0, 0, 0, 0, 0, - 0, 83, -222, 132, -183, -182, -181, -180, 89, 0, - 0, 138, 0, 0, -177, 140, 141, -174, 0, 0, - 143, 0, 0, 0, 0, 0, 0, 144, 145, 146, - 147, 0, 0, 0, -168, 0, 149, 150, 0, 0, - -165, 0, 152, 0, 0, 0, -163, 0, 0, 0, - 0, 0, 0, 0, 154, 0, 0, 0, 0, 0, - 0, 0, 0, 155, 156, 157, 158, 0, 159, 0, - -156, 0, 0, 0, 0, 0, 0, 0, -155, 162, - 163, 0, -152, -151, -150, -149, -148, 0, 169, 0, - 0, 170, 0, 0, 0, 0, 0, -5, 0, 0, - 171, 0, 0, 0, 0, 0, 0, 0, 0, 172, - 173, 0, 0, 174, 175, 176, 177, 178, 0, 0, - -137, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 180, 0, + 0, 0, 0, 0, 0, 0, 0, 133, 0, 0, + 84, -219, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2190, 0, 2190, + 2190, 0, 0, 0, 0, 0, 1158, 138, 0, 0, + 2114, 0, 2114, 2114, 0, 0, 28, 0, 2114, 0, + 45, 140, 143, 144, 152, 154, 155, 156, 157, 160, + 2114, 2114, 2114, 2114, 162, 163, 164, 6, -3, 165, + 167, 2114, 0, 117, 1731, 0, 55, -180, 171, -6, + 172, 0, 0, 2114, 0, 174, 1923, 175, 176, 177, + 178, 179, 180, -169, 0, 0, 0, 186, 187, 189, + 190, 191, 0, 192, 0, 193, 194, -155, -154, 0, + -152, -151, 0, 200, 0, -5, -121, 204, 0, 0, + 205, 0, 206, 207, 208, 209, 210, 211, 166, -217, + 0, 0, 212, 0, 89, 0, -135, 216, 217, 0, + 0, 74, 2190, 2190, 2190, 2190, 2190, 2190, 2190, 2190, + 2190, 2114, 0, 170, 170, 1054, 2114, 2114, 2114, 2114, + 2114, 2114, 2114, 2114, 2114, 0, 2114, 99, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, + 221, 222, 0, 0, 0, 223, 0, -126, 0, 0, + 0, 225, 2114, 0, 113, 0, -124, 0, 228, 0, + 0, 229, 0, 2114, 1175, 0, 0, 0, 0, 0, + 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, + 231, 233, 234, 235, 0, 236, 0, -61, 0, 0, + 0, 0, 0, 0, 0, 0, -58, 293, 295, 0, + 0, 296, 0, 0, 0, 0, 0, -32, -32, -32, + -32, 0, 0, 0, 792, 0, 170, 170, -13, -13, + -13, -13, 170, 170, 170, 1175, 0, 0, 0, 0, + 0, 0, 2, 0, 832, 0, 306, 0, 0, 170, + 0, 0, 0, 0, 0, 0, 307, 308, 0, 0, + 0, 0, -41, 0, 0, 0, 0, 0, 310, 0, }; -const short bxrindex[] = { 191, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, +const short bxrindex[] = { 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 182, 182, 182, 182, 0, 0, - 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 183, 0, 0, 0, 0, 0, 0, + 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -286,144 +345,642 @@ const short bxrindex[] = { 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 314, 314, 314, 314, 0, 0, 0, 0, 0, 0, + 0, 314, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 314, 0, 0, 315, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -10, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 356, 455, + 456, 0, 0, 0, 0, 0, 294, 370, 1078, 1104, + 1382, 1458, 418, 494, 772, 1807, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 798, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; +const short bxgindex[] = { 0, + 0, 0, 0, 54, 343, 0, 0, -132, 188, 2346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -const short bxgindex[] = { 0, - 151, 0, 0, -74, 0, 0, 0, 0, 0, 0, +#define YYTABLESIZE 2660 +const short bxtable[] = { 222, + 213, 99, 215, 310, 337, 261, 299, 225, 229, 259, + 244, 404, 101, 97, 260, 297, 198, 199, 200, 201, + 102, 100, 222, 226, 275, 221, 220, 222, 273, 222, + 222, 222, 222, 274, 222, 223, 222, 276, 289, 290, + 291, 292, 103, 227, 277, 190, 191, 162, 221, 302, + 163, 233, 234, 221, 279, 221, 221, 221, 221, 145, + 221, 312, 221, 164, 306, 275, 183, 184, 188, 273, + 269, 189, 270, 192, 274, 132, 133, 134, 135, 136, + 137, 193, 275, 222, 202, 277, 273, 269, 205, 270, + 203, 274, 275, 235, 236, 204, 273, 269, 351, 270, + 206, 274, 277, 248, 249, 348, 349, 207, 377, 221, + 208, 261, 277, 222, 355, 259, 255, 209, 256, 210, + 260, 272, 386, 211, 230, 231, 275, 237, 232, 238, + 273, 269, 240, 270, 241, 274, 275, 242, 272, 221, + 273, 269, 246, 270, 247, 274, 277, 263, 272, 280, + 275, 271, 281, 282, 273, 269, 277, 270, 194, 274, + 194, 283, 194, 284, 285, 286, 287, 258, 271, 288, + 277, 293, 294, 295, 300, 194, 301, 303, 271, 307, + 308, 311, 272, 313, 316, 317, 318, 319, 320, 321, + 322, 145, 272, 145, 145, 323, 324, 257, 325, 326, + 327, 328, 329, 330, 331, 332, 272, 333, 334, 335, + 338, 194, 271, 339, 340, 341, 342, 343, 344, 345, + 346, 350, 271, 347, 352, 353, 354, 277, 378, 379, + 380, 381, 382, 383, 384, 387, 271, 388, 389, 391, + 392, 194, 393, 394, 395, 396, 222, 222, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, + 222, 222, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 397, 216, + 403, 398, 399, 216, 400, 401, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 406, 407, 408, 409, 410, + 43, 222, 212, 128, 130, 250, 216, 251, 252, 224, + 228, 216, 243, 216, 216, 216, 216, 296, 216, 131, + 216, 0, 0, 0, 217, 253, 254, 221, 146, 222, + 222, 98, 214, 309, 336, 222, 222, 222, 222, 222, + 222, 298, 218, 219, 267, 268, 0, 222, 222, 0, + 0, 221, 222, 0, 0, 221, 221, 0, 0, 217, + 0, 221, 221, 221, 221, 221, 221, 216, 0, 239, + 0, 0, 0, 221, 221, 0, 195, 0, 195, 0, + 195, 0, 217, 0, 0, 267, 268, 217, 0, 217, + 217, 217, 217, 195, 217, 0, 217, 216, 0, 0, + 0, 0, 267, 268, 0, 0, 0, 214, 0, 0, + 0, 0, 267, 268, 0, 0, 0, 0, 0, 0, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 195, + 214, 253, 254, 0, 0, 214, 0, 214, 214, 214, + 214, 0, 214, 217, 214, 0, 267, 268, 0, 0, + 0, 0, 0, 0, 0, 0, 267, 268, 0, 195, + 146, 0, 146, 146, 0, 0, 0, 0, 0, 0, + 267, 268, 0, 217, 0, 200, 201, 200, 201, 200, + 201, 0, 0, 215, 0, 0, 0, 0, 0, 0, + 0, 214, 200, 201, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, + 0, 215, 0, 215, 215, 215, 215, 0, 215, 0, + 215, 214, 0, 0, 0, 0, 0, 0, 200, 201, + 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, + 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, + 216, 216, 216, 216, 216, 216, 0, 0, 200, 201, + 0, 0, 0, 0, 0, 0, 0, 215, 0, 0, + 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 215, 0, 53, + 0, 0, 0, 0, 0, 216, 217, 217, 217, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 0, 216, 216, 0, 0, 0, 0, 216, + 216, 216, 216, 216, 216, 0, 0, 0, 0, 0, + 0, 216, 216, 0, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 0, 217, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 0, 217, + 217, 0, 0, 0, 0, 217, 217, 217, 217, 217, + 217, 0, 0, 0, 0, 0, 0, 217, 217, 214, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 0, 214, 214, 0, + 0, 220, 0, 214, 214, 214, 214, 214, 214, 0, + 0, 0, 0, 0, 0, 214, 214, 0, 0, 0, + 0, 402, 0, 0, 220, 0, 0, 213, 0, 220, + 0, 220, 220, 220, 220, 0, 220, 0, 220, 0, + 0, 0, 0, 0, 0, 215, 0, 0, 0, 275, + 213, 0, 0, 273, 269, 222, 270, 213, 274, 222, + 213, 405, 213, 0, 222, 0, 0, 0, 0, 277, + 0, 0, 0, 215, 215, 0, 0, 0, 0, 215, + 215, 215, 215, 215, 215, 220, 0, 0, 0, 275, + 0, 215, 215, 273, 269, 0, 270, 0, 274, 0, + 0, 0, 0, 0, 0, 272, 0, 0, 0, 277, + 0, 213, 1, 2, 3, 220, 4, 0, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 0, 14, 0, + 0, 0, 0, 0, 0, 271, 0, 0, 0, 15, + 0, 213, 16, 0, 17, 272, 18, 0, 0, 19, + 20, 0, 0, 0, 21, 22, 0, 0, 0, 0, + 23, 0, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 271, 0, 37, 38, 0, + 39, 0, 40, 41, 42, 43, 44, 45, 46, 0, + 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 48, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 345 -const short bxtable[] = { 48, - 206, 217, 97, 117, 292, 89, 93, 95, 144, 174, - 87, 152, 209, 214, 240, 100, 99, 142, 155, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 198, 199, 200, 201, 98, 90, 156, 114, 207, 149, - 118, 154, 122, 91, 120, 121, 183, 123, 175, 176, - 177, 178, 166, 167, 168, 169, 170, 171, 127, 128, - 129, 130, 160, 161, 162, 163, 186, 187, 250, 251, - 119, 124, 131, 132, 133, 134, 135, 136, 139, 137, - 112, 138, 140, 157, 159, 158, 164, 165, 173, 180, - 181, 184, 188, 189, 185, 190, 191, 192, 113, 193, - 194, 195, 196, 197, 202, 203, 204, 210, 212, 211, - 215, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 38, 113, 115, 0, 179, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, + 0, 275, 0, 0, 366, 273, 269, 0, 270, 0, + 274, 0, 0, 220, 0, 0, 0, 0, 0, 0, + 212, 277, 0, 213, 0, 0, 0, 212, 212, 0, + 212, 0, 212, 0, 0, 0, 0, 0, 0, 213, + 0, 220, 220, 0, 0, 0, 213, 220, 220, 220, + 220, 220, 220, 213, 213, 0, 213, 272, 213, 220, + 220, 0, 0, 0, 0, 0, 0, 213, 213, 0, + 0, 0, 0, 213, 213, 213, 213, 213, 213, 267, + 268, 212, 0, 0, 0, 222, 222, 271, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 261, 0, 213, 0, 259, + 255, 212, 256, 0, 260, 0, 0, 0, 0, 267, + 268, 0, 275, 0, 0, 262, 273, 269, 0, 270, + 0, 274, 0, 0, 208, 0, 0, 213, 208, 208, + 0, 208, 277, 208, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, + 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 0, 0, 0, 0, 272, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 208, 257, 0, 153, 0, 0, 0, 0, 0, 0, + 154, 0, 159, 0, 0, 151, 0, 0, 271, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 0, 0, 0, 0, + 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, + 0, 0, 0, 0, 218, 0, 0, 0, 0, 0, + 0, 218, 218, 0, 218, 0, 218, 0, 0, 0, + 0, 267, 268, 0, 0, 213, 0, 212, 212, 0, + 0, 0, 0, 212, 212, 212, 212, 212, 212, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 213, 213, 0, 0, 219, 0, 213, + 213, 213, 213, 213, 213, 218, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 219, 0, 0, 0, 0, 0, 0, 219, 219, 0, + 219, 0, 219, 0, 0, 218, 0, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 0, 0, 253, 254, 0, 0, 0, + 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, + 0, 219, 267, 268, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 208, 208, 153, 0, 0, 0, + 0, 0, 0, 154, 0, 0, 0, 0, 151, 0, + 0, 219, 158, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 149, 150, 0, 0, 0, 0, 132, 133, 134, 135, + 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 152, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, + 0, 0, 0, 0, 154, 0, 0, 0, 0, 151, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 218, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 304, 218, 218, 0, 0, 0, 0, 218, 218, 218, + 218, 218, 218, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 153, 0, 0, 0, 0, 0, 0, + 154, 165, 0, 0, 0, 151, 0, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 219, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 211, 219, 219, 0, + 0, 0, 0, 219, 219, 219, 219, 219, 219, 178, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, + 0, 0, 179, 180, 185, 0, 211, 211, 0, 0, + 0, 181, 0, 0, 0, 139, 0, 0, 0, 182, + 0, 0, 0, 0, 0, 158, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 140, 0, + 0, 0, 0, 0, 0, 141, 0, 0, 0, 0, + 138, 0, 0, 149, 150, 0, 0, 0, 0, 132, + 133, 134, 135, 136, 137, 0, 0, 0, 0, 0, + 0, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 0, 0, 0, 0, + 275, 0, 154, 0, 273, 269, 0, 314, 0, 274, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 277, 0, 0, 0, 0, 0, 148, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 0, 149, 150, 272, 0, 0, 0, + 132, 133, 134, 135, 136, 137, 0, 0, 0, 0, + 0, 153, 0, 0, 0, 0, 0, 0, 154, 0, + 0, 0, 0, 151, 0, 0, 271, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 158, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 0, + 149, 150, 0, 0, 0, 0, 132, 133, 134, 135, + 136, 137, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, + 0, 0, 0, 0, 0, 0, 153, 0, 0, 0, + 0, 0, 0, 154, 0, 0, 0, 0, 151, 0, + 0, 0, 0, 0, 0, 0, 211, 211, 0, 0, + 0, 0, 211, 211, 211, 211, 211, 211, 0, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 0, 0, 0, + 0, 132, 133, 134, 135, 136, 137, 0, 0, 0, + 0, 0, 140, 0, 0, 0, 0, 0, 0, 141, + 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 158, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 0, 149, 150, 0, 0, 0, 0, 132, 133, + 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, + 267, 268, 0, 0, 0, 0, 0, 0, 0, 0, + 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 157, 161, 0, 0, 0, 0, 149, 150, + 187, 0, 0, 0, 132, 133, 134, 135, 136, 137, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 0, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 2, 0, 3, - 0, 4, 5, 6, 7, 8, 9, 0, 0, 0, - 0, 0, 0, 291, 0, 0, 0, 0, 10, 216, - 11, 0, 12, 115, 13, 0, 0, 14, 15, 0, - 0, 0, 16, 17, 0, 0, 145, 0, 18, 0, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 0, 0, 32, 33, 141, 34, 35, - 36, 37, 38, 39, 40, 150, 151, 41, 96, 116, - 205, 88, 92, 94, 143, 146, 42, 43, 208, 213, - 239, 153, 44, 45, 46, 47, 182, 0, 0, 0, - 0, 0, 0, 147, 148, + 0, 0, 0, 0, 0, 158, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 0, 149, 150, 0, 0, 0, 0, 132, + 133, 134, 135, 136, 137, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 264, 0, 265, 266, + 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 315, 0, 0, 0, 0, 0, 0, 130, + 131, 0, 0, 0, 0, 132, 133, 134, 135, 136, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 365, 0, 0, + 0, 0, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 0, 376, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 385, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, }; const short bxcheck[] = { 10, - 10, 58, 10, 10, 10, 10, 10, 10, 10, 300, - 10, 10, 10, 10, 10, 264, 326, 10, 300, 268, + 10, 10, 10, 10, 10, 38, 10, 10, 10, 42, + 10, 10, 314, 10, 47, 10, 327, 328, 329, 330, + 322, 10, 33, 332, 38, 10, 10, 38, 42, 40, + 41, 42, 43, 47, 45, 10, 47, 10, 171, 172, + 173, 174, 10, 352, 58, 318, 319, 360, 33, 182, + 360, 323, 324, 38, 10, 40, 41, 42, 43, 6, + 45, 194, 47, 360, 10, 38, 10, 14, 360, 42, + 43, 316, 45, 10, 47, 366, 367, 368, 369, 370, + 371, 10, 38, 94, 332, 58, 42, 43, 10, 45, + 360, 47, 38, 323, 324, 360, 42, 43, 10, 45, + 10, 47, 58, 323, 324, 323, 324, 10, 10, 94, + 361, 38, 58, 124, 41, 42, 43, 361, 45, 332, + 47, 94, 10, 332, 10, 360, 38, 360, 10, 360, + 42, 43, 360, 45, 10, 47, 38, 10, 94, 124, + 42, 43, 10, 45, 61, 47, 58, 10, 94, 10, + 38, 124, 10, 10, 42, 43, 58, 45, 41, 47, + 43, 10, 45, 10, 10, 10, 10, 94, 124, 10, + 58, 10, 10, 10, 10, 58, 10, 61, 124, 360, + 10, 10, 94, 10, 10, 10, 10, 10, 10, 10, + 360, 138, 94, 140, 141, 10, 10, 124, 10, 10, + 10, 10, 10, 10, 360, 360, 94, 360, 360, 10, + 332, 94, 124, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 124, 58, 360, 10, 10, 58, 10, 10, + 10, 10, 10, 360, 10, 360, 124, 10, 10, 10, + 10, 124, 10, 10, 10, 10, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 360, 283, + 299, 360, 10, 10, 10, 10, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 10, 10, 10, 360, 10, + 0, 332, 332, 10, 10, 138, 33, 140, 141, 332, + 332, 38, 332, 40, 41, 42, 43, 332, 45, 10, + 47, -1, -1, -1, 328, 378, 379, 332, 6, 360, + 361, 360, 360, 360, 360, 366, 367, 368, 369, 370, + 371, 365, 346, 347, 378, 379, -1, 378, 379, -1, + -1, 346, 347, -1, -1, 360, 361, -1, -1, 10, + -1, 366, 367, 368, 369, 370, 371, 94, -1, 47, + -1, -1, -1, 378, 379, -1, 41, -1, 43, -1, + 45, -1, 33, -1, -1, 378, 379, 38, -1, 40, + 41, 42, 43, 58, 45, -1, 47, 124, -1, -1, + -1, -1, 378, 379, -1, -1, -1, 10, -1, -1, + -1, -1, 378, 379, -1, -1, -1, -1, -1, -1, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 94, + 33, 378, 379, -1, -1, 38, -1, 40, 41, 42, + 43, -1, 45, 94, 47, -1, 378, 379, -1, -1, + -1, -1, -1, -1, -1, -1, 378, 379, -1, 124, + 138, -1, 140, 141, -1, -1, -1, -1, -1, -1, + 378, 379, -1, 124, -1, 41, 41, 43, 43, 45, + 45, -1, -1, 10, -1, -1, -1, -1, -1, -1, + -1, 94, 58, 58, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, + -1, 38, -1, 40, 41, 42, 43, -1, 45, -1, + 47, 124, -1, -1, -1, -1, -1, -1, 94, 94, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, -1, -1, 124, 124, + -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, + -1, -1, -1, -1, -1, 253, 254, 255, 256, 257, + 258, 259, 260, 261, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 124, -1, 10, + -1, -1, -1, -1, -1, 332, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, -1, 360, 361, -1, -1, -1, -1, 366, + 367, 368, 369, 370, 371, -1, -1, -1, -1, -1, + -1, 378, 379, -1, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + -1, 332, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, -1, 360, + 361, -1, -1, -1, -1, 366, 367, 368, 369, 370, + 371, -1, -1, -1, -1, -1, -1, 378, 379, 332, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, -1, 360, 361, -1, + -1, 10, -1, 366, 367, 368, 369, 370, 371, -1, + -1, -1, -1, -1, -1, 378, 379, -1, -1, -1, + -1, 10, -1, -1, 33, -1, -1, 10, -1, 38, + -1, 40, 41, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, 332, -1, -1, -1, 38, + 33, -1, -1, 42, 43, 38, 45, 40, 47, 42, + 43, 10, 45, -1, 47, -1, -1, -1, -1, 58, + -1, -1, -1, 360, 361, -1, -1, -1, -1, 366, + 367, 368, 369, 370, 371, 94, -1, -1, -1, 38, + -1, 378, 379, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, 94, -1, -1, -1, 58, + -1, 94, 283, 284, 285, 124, 287, -1, 289, 290, + 291, 292, 293, 294, 295, 296, 297, -1, 299, -1, + -1, -1, -1, -1, -1, 124, -1, -1, -1, 310, + -1, 124, 313, -1, 315, 94, 317, -1, -1, 320, + 321, -1, -1, -1, 325, 326, -1, -1, -1, -1, + 331, -1, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 124, -1, 348, 349, -1, + 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, + -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 373, 374, 375, 376, 377, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 105, 106, 107, 108, 42, 282, 318, 10, 113, 10, - 326, 10, 10, 290, 286, 287, 10, 10, 339, 340, - 341, 342, 331, 332, 333, 334, 335, 336, 295, 296, - 297, 298, 291, 292, 291, 292, 291, 292, 291, 292, - 284, 326, 300, 326, 326, 10, 10, 10, 300, 327, - 329, 327, 300, 10, 10, 326, 326, 326, 326, 10, - 10, 10, 58, 10, 61, 10, 326, 10, 347, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 326, - 10, 10, 10, 10, 10, 10, 10, 10, 326, 10, - 10, 10, 10, 10, 10, 10, 10, 326, 326, 326, - 326, 10, 300, 10, 10, 10, 10, 10, 10, 10, - 58, 10, 326, 326, 326, 326, 58, 10, 326, 10, - 10, 326, 10, 10, 10, 10, 10, 326, 10, 10, - 326, 10, 326, 10, 10, 10, 10, 10, 10, 326, - 326, 10, 10, 326, 326, 326, 326, 326, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 326, 10, - 0, 10, 10, -1, 44, -1, -1, -1, -1, -1, + 279, 280, 281, 282, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, + -1, 38, -1, -1, 41, 42, 43, -1, 45, -1, + 47, -1, -1, 332, -1, -1, -1, -1, -1, -1, + 33, 58, -1, 10, -1, -1, -1, 40, 41, -1, + 43, -1, 45, -1, -1, -1, -1, -1, -1, 332, + -1, 360, 361, -1, -1, -1, 33, 366, 367, 368, + 369, 370, 371, 40, 41, -1, 43, 94, 45, 378, + 379, -1, -1, -1, -1, -1, -1, 360, 361, -1, + -1, -1, -1, 366, 367, 368, 369, 370, 371, 378, + 379, 94, -1, -1, -1, 378, 379, 124, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 38, -1, 94, -1, 42, + 43, 124, 45, -1, 47, -1, -1, -1, -1, 378, + 379, -1, 38, -1, -1, 58, 42, 43, -1, 45, + -1, 47, -1, -1, 38, -1, -1, 124, 42, 43, + -1, 45, 58, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, + -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, + 10, -1, -1, -1, -1, -1, -1, -1, 94, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 94, 124, -1, 33, -1, -1, -1, -1, -1, -1, + 40, -1, 42, -1, -1, 45, -1, -1, 124, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, -1, -1, -1, -1, + -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, + -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, + -1, 40, 41, -1, 43, -1, 45, -1, -1, -1, + -1, 378, 379, -1, -1, 332, -1, 360, 361, -1, + -1, -1, -1, 366, 367, 368, 369, 370, 371, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 360, 361, -1, -1, 10, -1, 366, + 367, 368, 369, 370, 371, 94, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, -1, -1, -1, -1, 40, 41, -1, + 43, -1, 45, -1, -1, 124, -1, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, -1, -1, 378, 379, -1, -1, -1, + -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, + -1, 94, 378, 379, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 378, 379, 33, -1, -1, -1, + -1, -1, -1, 40, -1, -1, -1, -1, 45, -1, + -1, 124, 332, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 360, 361, -1, -1, -1, -1, 366, 367, 368, 369, + 370, 371, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 10, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, + -1, -1, -1, -1, 40, -1, -1, -1, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 332, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 10, 360, 361, -1, -1, -1, -1, 366, 367, 368, + 369, 370, 371, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, + 40, 292, -1, -1, -1, 45, -1, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 332, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 10, 360, 361, -1, + -1, -1, -1, 366, 367, 368, 369, 370, 371, 350, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + -1, -1, 363, 364, 311, -1, 40, 41, -1, -1, + -1, 372, -1, -1, -1, 10, -1, -1, -1, 380, + -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, + -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, + 45, -1, -1, 360, 361, -1, -1, -1, -1, 366, + 367, 368, 369, 370, 371, -1, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, + 38, -1, 40, -1, 42, 43, -1, 45, -1, 47, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 58, -1, -1, -1, -1, -1, 332, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, -1, 360, 361, 94, -1, -1, -1, + 366, 367, 368, 369, 370, 371, -1, -1, -1, -1, + -1, 33, -1, -1, -1, -1, -1, -1, 40, -1, + -1, -1, -1, 45, -1, -1, 124, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 332, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, -1, + 360, 361, -1, -1, -1, -1, 366, 367, 368, 369, + 370, 371, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, + -1, -1, -1, 40, -1, -1, -1, -1, 45, -1, + -1, -1, -1, -1, -1, -1, 360, 361, -1, -1, + -1, -1, 366, 367, 368, 369, 370, 371, -1, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 360, 361, -1, -1, -1, + -1, 366, 367, 368, 369, 370, 371, -1, -1, -1, + -1, -1, 33, -1, -1, -1, -1, -1, -1, 40, + -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 332, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, -1, 360, 361, -1, -1, -1, -1, 366, 367, + 368, 369, 370, 371, -1, -1, -1, -1, -1, -1, + 378, 379, -1, -1, -1, -1, -1, -1, -1, -1, + 312, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 7, 8, -1, -1, -1, -1, 360, 361, + 15, -1, -1, -1, 366, 367, 368, 369, 370, 371, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 257, 258, -1, 260, - -1, 262, 263, 264, 265, 266, 267, -1, -1, -1, - -1, -1, -1, 269, -1, -1, -1, -1, 279, 326, - 281, -1, 283, 280, 285, -1, -1, 288, 289, -1, - -1, -1, 293, 294, -1, -1, 257, -1, 299, -1, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, -1, -1, 316, 317, 300, 319, 320, - 321, 322, 323, 324, 325, 314, 315, 328, 326, 326, - 330, 326, 326, 326, 326, 296, 337, 338, 326, 326, - 326, 300, 343, 344, 345, 346, 300, -1, -1, -1, - -1, -1, -1, 314, 315, + -1, -1, -1, -1, -1, 332, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, -1, 360, 361, -1, -1, -1, -1, 366, + 367, 368, 369, 370, 371, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 151, -1, 153, 154, + -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 185, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 197, -1, -1, -1, -1, -1, -1, 360, + 361, -1, -1, -1, -1, 366, 367, 368, 369, 370, + 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 262, -1, -1, + -1, -1, 267, 268, 269, 270, 271, 272, 273, 274, + 275, -1, 277, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 303, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, }; -#define YYFINAL 49 +#define YYFINAL 54 #ifndef YYDEBUG #define YYDEBUG 0 #endif -#define YYMAXTOKEN 347 +#define YYMAXTOKEN 382 #if YYDEBUG const char * const bxname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,"'*'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,"'='",0,0,0, +0,0,"'!'",0,0,0,0,"'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0, +0,0,0,"':'",0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -"BX_TOKEN_CONTINUE","BX_TOKEN_STEPN","BX_TOKEN_NEXT_STEP","BX_TOKEN_SET", -"BX_TOKEN_DEBUGGER","BX_TOKEN_VBREAKPOINT","BX_TOKEN_LBREAKPOINT", -"BX_TOKEN_PBREAKPOINT","BX_TOKEN_DEL_BREAKPOINT","BX_TOKEN_INFO", -"BX_TOKEN_QUIT","BX_TOKEN_PROGRAM","BX_TOKEN_REGISTERS","BX_TOKEN_FPU", -"BX_TOKEN_ALL","BX_TOKEN_IDT","BX_TOKEN_GDT","BX_TOKEN_LDT","BX_TOKEN_TSS", -"BX_TOKEN_DIRTY","BX_TOKEN_LINUX","BX_TOKEN_CONTROL_REGS","BX_TOKEN_EXAMINE", -"BX_TOKEN_XFORMAT","BX_TOKEN_SETPMEM","BX_TOKEN_SYMBOLNAME","BX_TOKEN_QUERY", -"BX_TOKEN_PENDING","BX_TOKEN_TAKE","BX_TOKEN_DMA","BX_TOKEN_IRQ", -"BX_TOKEN_DUMP_CPU","BX_TOKEN_SET_CPU","BX_TOKEN_DIS","BX_TOKEN_ON", -"BX_TOKEN_OFF","BX_TOKEN_DISASSEMBLE","BX_TOKEN_INSTRUMENT","BX_TOKEN_START", -"BX_TOKEN_STOP","BX_TOKEN_RESET","BX_TOKEN_PRINT","BX_TOKEN_LOADER", -"BX_TOKEN_STRING","BX_TOKEN_DOIT","BX_TOKEN_CRC","BX_TOKEN_TRACEON", -"BX_TOKEN_TRACEOFF","BX_TOKEN_PTIME","BX_TOKEN_TIMEBP_ABSOLUTE", -"BX_TOKEN_TIMEBP","BX_TOKEN_RECORD","BX_TOKEN_PLAYBACK","BX_TOKEN_MODEBP", -"BX_TOKEN_PRINT_STACK","BX_TOKEN_WATCH","BX_TOKEN_UNWATCH","BX_TOKEN_READ", -"BX_TOKEN_WRITE","BX_TOKEN_SHOW","BX_TOKEN_SYMBOL","BX_TOKEN_GLOBAL", +0,0,0,0,0,0,0,0,0,0,"BX_TOKEN_REG_AL","BX_TOKEN_REG_BL","BX_TOKEN_REG_CL", +"BX_TOKEN_REG_DL","BX_TOKEN_REG_AH","BX_TOKEN_REG_BH","BX_TOKEN_REG_CH", +"BX_TOKEN_REG_DH","BX_TOKEN_REG_AX","BX_TOKEN_REG_BX","BX_TOKEN_REG_CX", +"BX_TOKEN_REG_DX","BX_TOKEN_REG_EAX","BX_TOKEN_REG_EBX","BX_TOKEN_REG_ECX", +"BX_TOKEN_REG_EDX","BX_TOKEN_REG_SI","BX_TOKEN_REG_DI","BX_TOKEN_REG_BP", +"BX_TOKEN_REG_SP","BX_TOKEN_REG_IP","BX_TOKEN_REG_ESI","BX_TOKEN_REG_EDI", +"BX_TOKEN_REG_EBP","BX_TOKEN_REG_ESP","BX_TOKEN_REG_EIP","BX_TOKEN_CONTINUE", +"BX_TOKEN_STEPN","BX_TOKEN_STEP_OVER","BX_TOKEN_NEXT_STEP","BX_TOKEN_SET", +"BX_TOKEN_DEBUGGER","BX_TOKEN_LIST_BREAK","BX_TOKEN_VBREAKPOINT", +"BX_TOKEN_LBREAKPOINT","BX_TOKEN_PBREAKPOINT","BX_TOKEN_DEL_BREAKPOINT", +"BX_TOKEN_ENABLE_BREAKPOINT","BX_TOKEN_DISABLE_BREAKPOINT","BX_TOKEN_INFO", +"BX_TOKEN_QUIT","BX_TOKEN_PROGRAM","BX_TOKEN_REGISTERS","BX_TOKEN_CPU", +"BX_TOKEN_FPU","BX_TOKEN_ALL","BX_TOKEN_IDT","BX_TOKEN_GDT","BX_TOKEN_LDT", +"BX_TOKEN_TSS","BX_TOKEN_DIRTY","BX_TOKEN_LINUX","BX_TOKEN_CONTROL_REGS", +"BX_TOKEN_EXAMINE","BX_TOKEN_XFORMAT","BX_TOKEN_DISFORMAT","BX_TOKEN_SETPMEM", +"BX_TOKEN_SYMBOLNAME","BX_TOKEN_QUERY","BX_TOKEN_PENDING","BX_TOKEN_TAKE", +"BX_TOKEN_DMA","BX_TOKEN_IRQ","BX_TOKEN_DUMP_CPU","BX_TOKEN_SET_CPU", +"BX_TOKEN_DIS","BX_TOKEN_ON","BX_TOKEN_OFF","BX_TOKEN_DISASSEMBLE", +"BX_TOKEN_INSTRUMENT","BX_TOKEN_START","BX_TOKEN_STOP","BX_TOKEN_RESET", +"BX_TOKEN_PRINT","BX_TOKEN_LOADER","BX_TOKEN_STRING","BX_TOKEN_DOIT", +"BX_TOKEN_CRC","BX_TOKEN_TRACEON","BX_TOKEN_TRACEOFF","BX_TOKEN_PTIME", +"BX_TOKEN_TIMEBP_ABSOLUTE","BX_TOKEN_TIMEBP","BX_TOKEN_RECORD", +"BX_TOKEN_PLAYBACK","BX_TOKEN_MODEBP","BX_TOKEN_PRINT_STACK","BX_TOKEN_WATCH", +"BX_TOKEN_UNWATCH","BX_TOKEN_READ","BX_TOKEN_WRITE","BX_TOKEN_SHOW", +"BX_TOKEN_SYMBOL","BX_TOKEN_SYMBOLS","BX_TOKEN_LIST_SYMBOLS","BX_TOKEN_GLOBAL", "BX_TOKEN_WHERE","BX_TOKEN_PRINT_STRING","BX_TOKEN_DIFF_MEMORY", "BX_TOKEN_SYNC_MEMORY","BX_TOKEN_SYNC_CPU","BX_TOKEN_FAST_FORWARD", "BX_TOKEN_PHY_2_LOG","BX_TOKEN_NUMERIC","BX_TOKEN_LONG_NUMERIC", -"BX_TOKEN_INFO_ADDRESS","BX_TOKEN_NE2000","BX_TOKEN_PAGE","BX_TOKEN_CS", -"BX_TOKEN_ES","BX_TOKEN_SS","BX_TOKEN_DS","BX_TOKEN_FS","BX_TOKEN_GS", -"BX_TOKEN_ALWAYS_CHECK","BX_TOKEN_MATHS","BX_TOKEN_ADD","BX_TOKEN_SUB", -"BX_TOKEN_MUL","BX_TOKEN_DIV","BX_TOKEN_V2L","BX_TOKEN_TRACEREGON", -"BX_TOKEN_TRACEREGOFF","BX_TOKEN_HELP","BX_TOKEN_IVT", +"BX_TOKEN_INFO_ADDRESS","BX_TOKEN_NE2000","BX_TOKEN_PIC","BX_TOKEN_PAGE", +"BX_TOKEN_CS","BX_TOKEN_ES","BX_TOKEN_SS","BX_TOKEN_DS","BX_TOKEN_FS", +"BX_TOKEN_GS","BX_TOKEN_FLAGS","BX_TOKEN_ALWAYS_CHECK","BX_TOKEN_TRACEREGON", +"BX_TOKEN_TRACEREGOFF","BX_TOKEN_HELP","BX_TOKEN_CALC","BX_TOKEN_RSHIFT", +"BX_TOKEN_LSHIFT","BX_TOKEN_IVT","NOT","NEG", }; const char * const bxrule[] = { "$accept : command", "command : continue_command", "command : stepN_command", +"command : step_over_command", "command : set_command", +"command : set_reg_command", "command : breakpoint_command", "command : info_command", +"command : blist_command", +"command : slist_command", "command : dump_cpu_command", "command : delete_command", +"command : bpe_command", +"command : bpd_command", "command : quit_command", "command : examine_command", "command : setpmem_command", @@ -435,7 +992,6 @@ const char * const bxrule[] = { "command : loader_command", "command : doit_command", "command : crc_command", -"command : maths_command", "command : trace_on_command", "command : trace_off_command", "command : ptime_command", @@ -450,10 +1006,10 @@ const char * const bxrule[] = { "command : where_command", "command : print_string_command", "command : cosim_commands", -"command : v2l_command", "command : trace_reg_on_command", "command : trace_reg_off_command", "command : help_command", +"command : calc_command", "command :", "command : '\\n'", "cosim_commands : BX_TOKEN_DIFF_MEMORY '\\n'", @@ -501,17 +1057,23 @@ const char * const bxrule[] = { "continue_command : BX_TOKEN_CONTINUE '\\n'", "stepN_command : BX_TOKEN_STEPN '\\n'", "stepN_command : BX_TOKEN_STEPN BX_TOKEN_NUMERIC '\\n'", +"step_over_command : BX_TOKEN_STEP_OVER '\\n'", "set_command : BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_ON '\\n'", "set_command : BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_OFF '\\n'", "set_command : BX_TOKEN_SET BX_TOKEN_SYMBOLNAME '=' BX_TOKEN_NUMERIC '\\n'", "breakpoint_command : BX_TOKEN_VBREAKPOINT '\\n'", -"breakpoint_command : BX_TOKEN_VBREAKPOINT BX_TOKEN_NUMERIC ':' BX_TOKEN_NUMERIC '\\n'", +"breakpoint_command : BX_TOKEN_VBREAKPOINT vexpression ':' expression '\\n'", "breakpoint_command : BX_TOKEN_LBREAKPOINT '\\n'", -"breakpoint_command : BX_TOKEN_LBREAKPOINT BX_TOKEN_NUMERIC '\\n'", +"breakpoint_command : BX_TOKEN_LBREAKPOINT expression '\\n'", +"breakpoint_command : BX_TOKEN_LBREAKPOINT BX_TOKEN_STRING '\\n'", "breakpoint_command : BX_TOKEN_PBREAKPOINT '\\n'", -"breakpoint_command : BX_TOKEN_PBREAKPOINT BX_TOKEN_NUMERIC '\\n'", -"breakpoint_command : BX_TOKEN_PBREAKPOINT '*' BX_TOKEN_NUMERIC '\\n'", +"breakpoint_command : BX_TOKEN_PBREAKPOINT expression '\\n'", +"breakpoint_command : BX_TOKEN_PBREAKPOINT '*' expression '\\n'", +"blist_command : BX_TOKEN_LIST_BREAK '\\n'", +"slist_command : BX_TOKEN_LIST_SYMBOLS '\\n'", +"slist_command : BX_TOKEN_LIST_SYMBOLS BX_TOKEN_STRING '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_PBREAKPOINT '\\n'", +"info_command : BX_TOKEN_INFO BX_TOKEN_CPU '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_PROGRAM '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_REGISTERS '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_FPU '\\n'", @@ -522,24 +1084,29 @@ const char * const bxrule[] = { "info_command : BX_TOKEN_INFO BX_TOKEN_GDT optional_numeric_range '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_LDT optional_numeric_range '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_TSS optional_numeric_range '\\n'", +"info_command : BX_TOKEN_INFO BX_TOKEN_FLAGS '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_LINUX '\\n'", +"info_command : BX_TOKEN_INFO BX_TOKEN_SYMBOLS '\\n'", +"info_command : BX_TOKEN_INFO BX_TOKEN_SYMBOLS BX_TOKEN_STRING '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_CONTROL_REGS '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_NE2000 '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_NE2000 BX_TOKEN_PAGE BX_TOKEN_NUMERIC '\\n'", "info_command : BX_TOKEN_INFO BX_TOKEN_NE2000 BX_TOKEN_PAGE BX_TOKEN_NUMERIC BX_TOKEN_REGISTERS BX_TOKEN_NUMERIC '\\n'", +"info_command : BX_TOKEN_INFO BX_TOKEN_PIC '\\n'", "optional_numeric :", "optional_numeric : BX_TOKEN_NUMERIC", "optional_numeric_range :", "optional_numeric_range : numeric_range", -"numeric_range : BX_TOKEN_NUMERIC", -"numeric_range : BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC", -"numeric_range : BX_TOKEN_NUMERIC ':' BX_TOKEN_NUMERIC", +"numeric_range : expression", +"numeric_range : expression expression", "dump_cpu_command : BX_TOKEN_DUMP_CPU '\\n'", "delete_command : BX_TOKEN_DEL_BREAKPOINT BX_TOKEN_NUMERIC '\\n'", +"bpe_command : BX_TOKEN_ENABLE_BREAKPOINT BX_TOKEN_NUMERIC '\\n'", +"bpd_command : BX_TOKEN_DISABLE_BREAKPOINT BX_TOKEN_NUMERIC '\\n'", "quit_command : BX_TOKEN_QUIT '\\n'", -"examine_command : BX_TOKEN_EXAMINE BX_TOKEN_XFORMAT BX_TOKEN_NUMERIC '\\n'", +"examine_command : BX_TOKEN_EXAMINE BX_TOKEN_XFORMAT expression '\\n'", "examine_command : BX_TOKEN_EXAMINE BX_TOKEN_XFORMAT '\\n'", -"examine_command : BX_TOKEN_EXAMINE BX_TOKEN_NUMERIC '\\n'", +"examine_command : BX_TOKEN_EXAMINE expression '\\n'", "examine_command : BX_TOKEN_EXAMINE '\\n'", "setpmem_command : BX_TOKEN_SETPMEM BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", "query_command : BX_TOKEN_QUERY BX_TOKEN_PENDING '\\n'", @@ -548,6 +1115,7 @@ const char * const bxrule[] = { "take_command : BX_TOKEN_TAKE BX_TOKEN_IRQ '\\n'", "set_cpu_command : BX_TOKEN_SET_CPU '\\n'", "disassemble_command : BX_TOKEN_DISASSEMBLE optional_numeric_range '\\n'", +"disassemble_command : BX_TOKEN_DISASSEMBLE BX_TOKEN_DISFORMAT optional_numeric_range '\\n'", "instrument_command : BX_TOKEN_INSTRUMENT BX_TOKEN_START '\\n'", "instrument_command : BX_TOKEN_INSTRUMENT BX_TOKEN_STOP '\\n'", "instrument_command : BX_TOKEN_INSTRUMENT BX_TOKEN_RESET '\\n'", @@ -555,16 +1123,75 @@ const char * const bxrule[] = { "loader_command : BX_TOKEN_LOADER BX_TOKEN_STRING '\\n'", "doit_command : BX_TOKEN_DOIT BX_TOKEN_NUMERIC '\\n'", "crc_command : BX_TOKEN_CRC BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", -"maths_command : BX_TOKEN_MATHS BX_TOKEN_ADD BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", -"maths_command : BX_TOKEN_MATHS BX_TOKEN_SUB BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", -"maths_command : BX_TOKEN_MATHS BX_TOKEN_MUL BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", -"maths_command : BX_TOKEN_MATHS BX_TOKEN_DIV BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\\n'", -"maths_command : BX_TOKEN_MATHS BX_TOKEN_STRING '\\n'", -"v2l_command : BX_TOKEN_V2L segment_register ':' BX_TOKEN_NUMERIC '\\n'", "trace_reg_on_command : BX_TOKEN_TRACEREGON '\\n'", "trace_reg_off_command : BX_TOKEN_TRACEREGOFF '\\n'", "help_command : BX_TOKEN_HELP BX_TOKEN_STRING '\\n'", "help_command : BX_TOKEN_HELP '\\n'", +"calc_command : BX_TOKEN_CALC expression '\\n'", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_AL", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_BL", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_CL", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_DL", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_AH", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_BH", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_CH", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_DH", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_AX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_BX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_CX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_DX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_EAX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_EBX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_ECX", +"BX_TOKEN_COMMON_REG : BX_TOKEN_REG_EDX", +"BX_TOKEN_INDEX_REG : BX_TOKEN_REG_SI", +"BX_TOKEN_INDEX_REG : BX_TOKEN_REG_DI", +"BX_TOKEN_INDEX_REG : BX_TOKEN_REG_ESI", +"BX_TOKEN_INDEX_REG : BX_TOKEN_REG_EDI", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_BP", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_SP", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_IP", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_EBP", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_ESP", +"BX_TOKEN_PTR_REG : BX_TOKEN_REG_EIP", +"BX_TOKEN_NONSEG_REG : BX_TOKEN_COMMON_REG", +"BX_TOKEN_NONSEG_REG : BX_TOKEN_INDEX_REG", +"BX_TOKEN_NONSEG_REG : BX_TOKEN_PTR_REG", +"vexpression : BX_TOKEN_NUMERIC", +"vexpression : BX_TOKEN_LONG_NUMERIC", +"vexpression : BX_TOKEN_NONSEG_REG", +"vexpression : segment_register", +"vexpression : vexpression '+' vexpression", +"vexpression : vexpression '-' vexpression", +"vexpression : vexpression '*' vexpression", +"vexpression : vexpression '/' vexpression", +"vexpression : vexpression BX_TOKEN_RSHIFT vexpression", +"vexpression : vexpression BX_TOKEN_LSHIFT vexpression", +"vexpression : vexpression '|' vexpression", +"vexpression : vexpression '^' vexpression", +"vexpression : vexpression '&' vexpression", +"vexpression : '!' vexpression", +"vexpression : '-' vexpression", +"vexpression : '(' vexpression ')'", +"expression : BX_TOKEN_NUMERIC", +"expression : BX_TOKEN_LONG_NUMERIC", +"expression : BX_TOKEN_STRING", +"expression : BX_TOKEN_NONSEG_REG", +"expression : segment_register", +"expression : expression ':' expression", +"expression : expression '+' expression", +"expression : expression '-' expression", +"expression : expression '*' expression", +"expression : expression '/' expression", +"expression : expression BX_TOKEN_RSHIFT expression", +"expression : expression BX_TOKEN_LSHIFT expression", +"expression : expression '|' expression", +"expression : expression '^' expression", +"expression : expression '&' expression", +"expression : '!' expression", +"expression : '-' expression", +"expression : '(' expression ')'", +"set_reg_command : BX_TOKEN_REGISTERS BX_TOKEN_NONSEG_REG '=' expression '\\n'", }; #endif #if YYDEBUG @@ -788,545 +1415,623 @@ yyreduce: yyval = yyvsp[1-yym]; switch (yyn) { -case 39: -#line 168 "parser.y" +case 44: +#line 215 "parser.y" { } break; -case 40: -#line 174 "parser.y" +case 45: +#line 221 "parser.y" { bx_dbg_diff_memory(); free(yyvsp[-1].sval); } break; -case 41: -#line 179 "parser.y" +case 46: +#line 226 "parser.y" { bx_dbg_sync_memory(1); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 42: -#line 184 "parser.y" +case 47: +#line 231 "parser.y" { bx_dbg_sync_memory(0); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 43: -#line 189 "parser.y" +case 48: +#line 236 "parser.y" { bx_dbg_sync_cpu(1); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 44: -#line 194 "parser.y" +case 49: +#line 241 "parser.y" { bx_dbg_sync_cpu(0); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 45: -#line 199 "parser.y" +case 50: +#line 246 "parser.y" { free(yyvsp[-2].sval); bx_dbg_fast_forward(yyvsp[-1].uval); } break; -case 46: -#line 204 "parser.y" +case 51: +#line 251 "parser.y" { } break; -case 47: -#line 207 "parser.y" +case 52: +#line 254 "parser.y" { free(yyvsp[-4].sval); bx_dbg_info_address(yyvsp[-3].uval, yyvsp[-1].uval); } break; -case 48: -#line 212 "parser.y" -{ - } -break; -case 49: -#line 215 "parser.y" -{ - } -break; -case 50: -#line 220 "parser.y" -{ yyval.uval = 1; } -break; -case 51: -#line 221 "parser.y" -{ yyval.uval = 0; } -break; -case 52: -#line 222 "parser.y" -{ yyval.uval = 2; } -break; case 53: -#line 223 "parser.y" -{ yyval.uval = 3; } +#line 259 "parser.y" +{ + } break; case 54: -#line 224 "parser.y" -{ yyval.uval = 4; } +#line 262 "parser.y" +{ + } break; case 55: -#line 225 "parser.y" -{ yyval.uval = 5; } +#line 267 "parser.y" +{ yyval.uval = 1; } break; case 56: -#line 230 "parser.y" +#line 268 "parser.y" +{ yyval.uval = 0; } +break; +case 57: +#line 269 "parser.y" +{ yyval.uval = 2; } +break; +case 58: +#line 270 "parser.y" +{ yyval.uval = 3; } +break; +case 59: +#line 271 "parser.y" +{ yyval.uval = 4; } +break; +case 60: +#line 272 "parser.y" +{ yyval.uval = 5; } +break; +case 61: +#line 277 "parser.y" { bx_dbg_timebp_command(0, yyvsp[-1].ulval); free(yyvsp[-2].sval); } break; -case 57: -#line 235 "parser.y" +case 62: +#line 282 "parser.y" { bx_dbg_timebp_command(1, yyvsp[-1].ulval); free(yyvsp[-2].sval); } break; -case 58: -#line 243 "parser.y" +case 63: +#line 290 "parser.y" { bx_dbg_record_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 59: -#line 251 "parser.y" +case 64: +#line 298 "parser.y" { bx_dbg_playback_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 60: -#line 259 "parser.y" +case 65: +#line 306 "parser.y" { bx_dbg_modebp_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 61: -#line 264 "parser.y" +case 66: +#line 311 "parser.y" { bx_dbg_modebp_command(0); free(yyvsp[-1].sval); } break; -case 62: -#line 272 "parser.y" +case 67: +#line 319 "parser.y" { bx_dbg_show_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 63: -#line 277 "parser.y" +case 68: +#line 324 "parser.y" { bx_dbg_show_command(0); free(yyvsp[-1].sval); } break; -case 64: -#line 285 "parser.y" +case 69: +#line 332 "parser.y" { bx_dbg_ptime_command(); free(yyvsp[-1].sval); } break; -case 65: -#line 293 "parser.y" +case 70: +#line 340 "parser.y" { bx_dbg_trace_on_command(); free(yyvsp[-1].sval); } break; -case 66: -#line 301 "parser.y" +case 71: +#line 348 "parser.y" { bx_dbg_trace_off_command(); free(yyvsp[-1].sval); } break; -case 67: -#line 309 "parser.y" +case 72: +#line 356 "parser.y" { bx_dbg_print_stack_command(16); free(yyvsp[-1].sval); } break; -case 68: -#line 314 "parser.y" +case 73: +#line 361 "parser.y" { bx_dbg_print_stack_command(yyvsp[-1].uval); free(yyvsp[-2].sval); } break; -case 69: -#line 322 "parser.y" +case 74: +#line 369 "parser.y" { watchpoint_continue = 0; fprintf(stderr, "Will stop on watch points\n"); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 70: -#line 328 "parser.y" +case 75: +#line 375 "parser.y" { watchpoint_continue = 1; fprintf(stderr, "Will not stop on watch points (they will still be logged)\n"); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 71: -#line 334 "parser.y" +case 76: +#line 381 "parser.y" { bx_dbg_watch(-1, 0); free(yyvsp[-1].sval); } break; -case 72: -#line 339 "parser.y" +case 77: +#line 386 "parser.y" { bx_dbg_unwatch(-1, 0); free(yyvsp[-1].sval); } break; -case 73: -#line 344 "parser.y" +case 78: +#line 391 "parser.y" { bx_dbg_watch(1, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 74: -#line 349 "parser.y" +case 79: +#line 396 "parser.y" { bx_dbg_unwatch(1, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 75: -#line 354 "parser.y" +case 80: +#line 401 "parser.y" { bx_dbg_watch(0, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 76: -#line 359 "parser.y" +case 81: +#line 406 "parser.y" { bx_dbg_unwatch(0, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 77: -#line 367 "parser.y" +case 82: +#line 414 "parser.y" { bx_dbg_symbol_command(yyvsp[-1].sval, 0, 0); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 78: -#line 372 "parser.y" +case 83: +#line 419 "parser.y" { bx_dbg_symbol_command(yyvsp[-2].sval, 0, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 79: -#line 377 "parser.y" +case 84: +#line 424 "parser.y" { bx_dbg_symbol_command(yyvsp[-2].sval, 1, yyvsp[-1].uval); free(yyvsp[-4].sval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 80: -#line 385 "parser.y" +case 85: +#line 432 "parser.y" { bx_dbg_where_command(); free(yyvsp[-1].sval); } break; -case 81: -#line 393 "parser.y" +case 86: +#line 440 "parser.y" { bx_dbg_print_string_command(yyvsp[-1].uval); free(yyvsp[-2].sval); } break; -case 82: -#line 401 "parser.y" +case 87: +#line 448 "parser.y" { bx_dbg_continue_command(); free(yyvsp[-1].sval); } break; -case 83: -#line 409 "parser.y" +case 88: +#line 456 "parser.y" { bx_dbg_stepN_command(1); free(yyvsp[-1].sval); } break; -case 84: -#line 414 "parser.y" +case 89: +#line 461 "parser.y" { bx_dbg_stepN_command(yyvsp[-1].uval); free(yyvsp[-2].sval); } break; -case 85: -#line 422 "parser.y" +case 90: +#line 469 "parser.y" +{ + bx_dbg_step_over_command(); + free(yyvsp[-1].sval); + } +break; +case 91: +#line 477 "parser.y" { bx_dbg_set_command(yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 86: -#line 427 "parser.y" +case 92: +#line 482 "parser.y" { bx_dbg_set_command(yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 87: -#line 432 "parser.y" +case 93: +#line 487 "parser.y" { bx_dbg_set_symbol_command(yyvsp[-3].sval, yyvsp[-1].uval); free(yyvsp[-4].sval); free(yyvsp[-3].sval); } break; -case 88: -#line 440 "parser.y" -{ - bx_dbg_vbreakpoint_command(0, 0, 0); - free(yyvsp[-1].sval); - } -break; -case 89: -#line 445 "parser.y" -{ - bx_dbg_vbreakpoint_command(1, yyvsp[-3].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); - } -break; -case 90: -#line 450 "parser.y" -{ - bx_dbg_lbreakpoint_command(0, 0); - free(yyvsp[-1].sval); - } -break; -case 91: -#line 455 "parser.y" -{ - bx_dbg_lbreakpoint_command(1, yyvsp[-1].uval); - free(yyvsp[-2].sval); - } -break; -case 92: -#line 460 "parser.y" -{ - bx_dbg_pbreakpoint_command(0, 0); - free(yyvsp[-1].sval); - } -break; -case 93: -#line 465 "parser.y" -{ - bx_dbg_pbreakpoint_command(1, yyvsp[-1].uval); - free(yyvsp[-2].sval); - } -break; case 94: -#line 470 "parser.y" +#line 495 "parser.y" { - bx_dbg_pbreakpoint_command(1, yyvsp[-1].uval); - free(yyvsp[-3].sval); + bx_dbg_vbreakpoint_command(bkAtIP, 0, 0); + free(yyvsp[-1].sval); } break; case 95: -#line 478 "parser.y" +#line 500 "parser.y" +{ + bx_dbg_vbreakpoint_command(bkRegular, yyvsp[-3].ulval, yyvsp[-1].ulval); + free(yyvsp[-4].sval); + } +break; +case 96: +#line 505 "parser.y" +{ + bx_dbg_lbreakpoint_command(bkAtIP, 0); + free(yyvsp[-1].sval); + } +break; +case 97: +#line 510 "parser.y" +{ + bx_dbg_lbreakpoint_command(bkRegular, yyvsp[-1].ulval); + free(yyvsp[-2].sval); + } +break; +case 98: +#line 515 "parser.y" +{ + bx_dbg_lbreakpoint_symbol_command(yyvsp[-1].sval); + free(yyvsp[-2].sval);free(yyvsp[-1].sval); + } +break; +case 99: +#line 520 "parser.y" +{ + bx_dbg_pbreakpoint_command(bkAtIP, 0); + free(yyvsp[-1].sval); + } +break; +case 100: +#line 525 "parser.y" +{ + bx_dbg_pbreakpoint_command(bkRegular, yyvsp[-1].ulval); + free(yyvsp[-2].sval); + } +break; +case 101: +#line 530 "parser.y" +{ + bx_dbg_pbreakpoint_command(bkRegular, yyvsp[-1].ulval); + free(yyvsp[-3].sval); + } +break; +case 102: +#line 538 "parser.y" +{ + bx_dbg_info_bpoints_command(); + free(yyvsp[-1].sval); + } +break; +case 103: +#line 546 "parser.y" +{ + bx_dbg_info_symbols_command(0); + free(yyvsp[-1].sval); + } +break; +case 104: +#line 551 "parser.y" +{ + bx_dbg_info_symbols_command(yyvsp[-1].sval); + free(yyvsp[-2].sval);free(yyvsp[-1].sval); + } +break; +case 105: +#line 559 "parser.y" { bx_dbg_info_bpoints_command(); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 96: -#line 483 "parser.y" +case 106: +#line 564 "parser.y" +{ + bx_dbg_dump_cpu_command(); + free(yyvsp[-2].sval); free(yyvsp[-1].sval); + } +break; +case 107: +#line 569 "parser.y" { bx_dbg_info_program_command(); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 97: -#line 488 "parser.y" +case 108: +#line 574 "parser.y" { bx_dbg_info_registers_command(BX_INFO_CPU_REGS); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 98: -#line 493 "parser.y" +case 109: +#line 579 "parser.y" { bx_dbg_info_registers_command(BX_INFO_FPU_REGS); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 99: -#line 498 "parser.y" +case 110: +#line 584 "parser.y" { bx_dbg_info_registers_command(BX_INFO_CPU_REGS | BX_INFO_FPU_REGS); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 100: -#line 503 "parser.y" +case 111: +#line 589 "parser.y" { bx_dbg_info_dirty_command(); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 101: -#line 508 "parser.y" +case 112: +#line 594 "parser.y" { bx_dbg_info_idt_command(yyvsp[-1].uval_range); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 102: -#line 513 "parser.y" +case 113: +#line 599 "parser.y" { bx_dbg_info_ivt_command(yyvsp[-1].uval_range); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 103: -#line 518 "parser.y" +case 114: +#line 604 "parser.y" { bx_dbg_info_gdt_command(yyvsp[-1].uval_range); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 104: -#line 523 "parser.y" +case 115: +#line 609 "parser.y" { bx_dbg_info_ldt_command(yyvsp[-1].uval_range); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 105: -#line 528 "parser.y" +case 116: +#line 614 "parser.y" { bx_dbg_info_tss_command(yyvsp[-1].uval_range); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 106: -#line 533 "parser.y" +case 117: +#line 619 "parser.y" +{ + bx_dbg_info_flags(); + free(yyvsp[-2].sval); free(yyvsp[-1].sval); + } +break; +case 118: +#line 624 "parser.y" { bx_dbg_info_linux_command(); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 107: -#line 538 "parser.y" +case 119: +#line 629 "parser.y" +{ + bx_dbg_info_symbols_command(0); + free(yyvsp[-2].sval); free(yyvsp[-1].sval); + } +break; +case 120: +#line 634 "parser.y" +{ + bx_dbg_info_symbols_command(yyvsp[-1].sval); + free(yyvsp[-3].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); + } +break; +case 121: +#line 639 "parser.y" { bx_dbg_info_control_regs_command(); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 108: -#line 543 "parser.y" +case 122: +#line 644 "parser.y" { bx_dbg_info_ne2k(-1, -1); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 109: -#line 548 "parser.y" +case 123: +#line 649 "parser.y" { free(yyvsp[-4].sval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); bx_dbg_info_ne2k(yyvsp[-1].uval, -1); } break; -case 110: -#line 553 "parser.y" +case 124: +#line 654 "parser.y" { free(yyvsp[-6].sval); free(yyvsp[-5].sval); free(yyvsp[-4].sval); free(yyvsp[-2].sval); bx_dbg_info_ne2k(yyvsp[-3].uval, yyvsp[-1].uval); } break; -case 111: -#line 560 "parser.y" +case 125: +#line 659 "parser.y" +{ + bx_dbg_info_pic(); + free(yyvsp[-2].sval); free(yyvsp[-1].sval); + } +break; +case 126: +#line 666 "parser.y" { yyval.uval = EMPTY_ARG; } break; -case 113: -#line 564 "parser.y" +case 128: +#line 670 "parser.y" { yyval.uval_range = make_num_range (EMPTY_ARG, EMPTY_ARG); } break; -case 115: -#line 569 "parser.y" +case 130: +#line 675 "parser.y" { - yyval.uval_range = make_num_range (yyvsp[0].uval, yyvsp[0].uval); + yyval.uval_range = make_num_range (yyvsp[0].ulval, yyvsp[0].ulval); } break; -case 116: -#line 574 "parser.y" +case 131: +#line 680 "parser.y" { - yyval.uval_range = make_num_range (yyvsp[-1].uval, yyvsp[0].uval); + yyval.uval_range = make_num_range (yyvsp[-1].ulval, yyvsp[0].ulval); } break; -case 117: -#line 579 "parser.y" -{ - yyval.uval_range = make_num_range (yyvsp[-2].uval, yyvsp[0].uval); - } -break; -case 118: -#line 586 "parser.y" +case 132: +#line 687 "parser.y" { bx_dbg_dump_cpu_command(); free(yyvsp[-1].sval); } break; -case 119: -#line 594 "parser.y" +case 133: +#line 695 "parser.y" { bx_dbg_del_breakpoint_command(yyvsp[-1].uval); free(yyvsp[-2].sval); } break; -case 120: -#line 602 "parser.y" +case 134: +#line 703 "parser.y" +{ + bx_dbg_en_dis_breakpoint_command(yyvsp[-1].uval, 1); + free(yyvsp[-2].sval); + } +break; +case 135: +#line 710 "parser.y" +{ + bx_dbg_en_dis_breakpoint_command(yyvsp[-1].uval, 0); + free(yyvsp[-2].sval); + } +break; +case 136: +#line 718 "parser.y" { bx_dbg_quit_command(); free(yyvsp[-1].sval); } break; -case 121: -#line 611 "parser.y" +case 137: +#line 727 "parser.y" { - bx_dbg_examine_command(yyvsp[-3].sval, yyvsp[-2].sval,1, yyvsp[-1].uval,1, 0); + bx_dbg_examine_command(yyvsp[-3].sval, yyvsp[-2].sval,1, yyvsp[-1].ulval,1, 0); #if BX_NUM_SIMULATORS >= 2 - bx_dbg_examine_command(yyvsp[-3].sval, yyvsp[-2].sval,1, yyvsp[-1].uval,1, 1); + bx_dbg_examine_command(yyvsp[-3].sval, yyvsp[-2].sval,1, yyvsp[-1].ulval,1, 1); #endif free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 122: -#line 619 "parser.y" +case 138: +#line 735 "parser.y" { bx_dbg_examine_command(yyvsp[-2].sval, yyvsp[-1].sval,1, 0,0, 0); #if BX_NUM_SIMULATORS >= 2 @@ -1335,8 +2040,8 @@ case 122: free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 123: -#line 627 "parser.y" +case 139: +#line 743 "parser.y" { /*FIXME HanishKVC This method of hunting thro all the */ /* simulators may be better than using 2 calls if */ @@ -1345,13 +2050,13 @@ case 123: int iCurSim; for(iCurSim = 0; iCurSim < BX_NUM_SIMULATORS; iCurSim++) { - bx_dbg_examine_command(yyvsp[-2].sval, NULL,0, yyvsp[-1].uval,1, iCurSim); + bx_dbg_examine_command(yyvsp[-2].sval, NULL,0, yyvsp[-1].ulval,1, iCurSim); } free(yyvsp[-2].sval); } break; -case 124: -#line 640 "parser.y" +case 140: +#line 756 "parser.y" { /*FIXME HanishKVC This method of hunting thro all the */ /* simulators may be better than using 2 calls if */ @@ -1365,175 +2070,303 @@ case 124: free(yyvsp[-1].sval); } break; -case 125: -#line 656 "parser.y" +case 141: +#line 772 "parser.y" { bx_dbg_setpmem_command(yyvsp[-3].uval, yyvsp[-2].uval, yyvsp[-1].uval); free(yyvsp[-4].sval); } break; -case 126: -#line 664 "parser.y" +case 142: +#line 780 "parser.y" { bx_dbg_query_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 127: -#line 672 "parser.y" +case 143: +#line 788 "parser.y" { bx_dbg_take_command(yyvsp[-1].sval, 1); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 128: -#line 677 "parser.y" +case 144: +#line 793 "parser.y" { bx_dbg_take_command(yyvsp[-2].sval, yyvsp[-1].uval); free(yyvsp[-3].sval); free(yyvsp[-2].sval); } break; -case 129: -#line 682 "parser.y" +case 145: +#line 798 "parser.y" { bx_dbg_take_command(yyvsp[-1].sval, 1); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 130: -#line 690 "parser.y" +case 146: +#line 806 "parser.y" { bx_dbg_set_cpu_command(); free(yyvsp[-1].sval); } break; -case 131: -#line 698 "parser.y" +case 147: +#line 814 "parser.y" { - bx_dbg_disassemble_command(yyvsp[-1].uval_range); + bx_dbg_disassemble_command(NULL, yyvsp[-1].uval_range); free(yyvsp[-2].sval); } break; -case 132: -#line 706 "parser.y" +case 148: +#line 819 "parser.y" +{ + bx_dbg_disassemble_command(yyvsp[-2].sval, yyvsp[-1].uval_range); + free(yyvsp[-3].sval); free(yyvsp[-2].sval); + } +break; +case 149: +#line 827 "parser.y" { bx_dbg_instrument_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 133: -#line 711 "parser.y" +case 150: +#line 832 "parser.y" { bx_dbg_instrument_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 134: -#line 716 "parser.y" +case 151: +#line 837 "parser.y" { bx_dbg_instrument_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 135: -#line 721 "parser.y" +case 152: +#line 842 "parser.y" { bx_dbg_instrument_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 136: -#line 729 "parser.y" +case 153: +#line 850 "parser.y" { bx_dbg_loader_command(yyvsp[-1].sval); free(yyvsp[-2].sval); free(yyvsp[-1].sval); } break; -case 137: -#line 737 "parser.y" +case 154: +#line 858 "parser.y" { bx_dbg_doit_command(yyvsp[-1].uval); free(yyvsp[-2].sval); } break; -case 138: -#line 745 "parser.y" +case 155: +#line 866 "parser.y" { bx_dbg_crc_command(yyvsp[-2].uval, yyvsp[-1].uval); free(yyvsp[-3].sval); } break; -case 139: -#line 753 "parser.y" -{ - bx_dbg_maths_command(yyvsp[-3].sval, yyvsp[-2].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); free(yyvsp[-3].sval); - } -break; -case 140: -#line 758 "parser.y" -{ - bx_dbg_maths_command(yyvsp[-3].sval, yyvsp[-2].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); free(yyvsp[-3].sval); - } -break; -case 141: -#line 763 "parser.y" -{ - bx_dbg_maths_command(yyvsp[-3].sval, yyvsp[-2].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); free(yyvsp[-3].sval); - } -break; -case 142: -#line 768 "parser.y" -{ - bx_dbg_maths_command(yyvsp[-3].sval, yyvsp[-2].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); free(yyvsp[-3].sval); - } -break; -case 143: -#line 773 "parser.y" -{ - bx_dbg_maths_expression_command(yyvsp[-1].sval); - free(yyvsp[-2].sval); free(yyvsp[-1].sval); - } -break; -case 144: -#line 780 "parser.y" -{ - bx_dbg_v2l_command(yyvsp[-3].uval, yyvsp[-1].uval); - free(yyvsp[-4].sval); - } -break; -case 145: -#line 788 "parser.y" +case 156: +#line 874 "parser.y" { bx_dbg_trace_reg_on_command(); free(yyvsp[-1].sval); } break; -case 146: -#line 796 "parser.y" +case 157: +#line 882 "parser.y" { bx_dbg_trace_reg_off_command(); free(yyvsp[-1].sval); } break; -case 147: -#line 804 "parser.y" +case 158: +#line 890 "parser.y" { bx_dbg_help_command(yyvsp[-1].sval); free(yyvsp[-2].sval);free(yyvsp[-1].sval); } break; -case 148: -#line 809 "parser.y" +case 159: +#line 895 "parser.y" { bx_dbg_help_command(0); free(yyvsp[-1].sval); } break; -#line 1537 "y.tab.c" +case 160: +#line 903 "parser.y" +{ + bx_dbg_calc_command(yyvsp[-1].ulval); + free(yyvsp[-2].sval); + } +break; +case 176: +#line 926 "parser.y" +{ yyval.reg=yyvsp[0].reg; } +break; +case 180: +#line 934 "parser.y" +{ yyval.reg=yyvsp[0].reg; } +break; +case 186: +#line 944 "parser.y" +{ yyval.reg=yyvsp[0].reg; } +break; +case 189: +#line 951 "parser.y" +{ yyval.reg=yyvsp[0].reg; } +break; +case 190: +#line 956 "parser.y" +{ yyval.ulval = yyvsp[0].uval; } +break; +case 191: +#line 957 "parser.y" +{ yyval.ulval = yyvsp[0].ulval; } +break; +case 192: +#line 958 "parser.y" +{ yyval.ulval = bx_dbg_get_reg_value(yyvsp[0].reg); } +break; +case 193: +#line 959 "parser.y" +{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval); } +break; +case 194: +#line 960 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; } +break; +case 195: +#line 961 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; } +break; +case 196: +#line 962 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; } +break; +case 197: +#line 963 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval / yyvsp[0].ulval; } +break; +case 198: +#line 964 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; } +break; +case 199: +#line 965 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; } +break; +case 200: +#line 966 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; } +break; +case 201: +#line 967 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; } +break; +case 202: +#line 968 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; } +break; +case 203: +#line 969 "parser.y" +{ yyval.ulval = !yyvsp[0].ulval; } +break; +case 204: +#line 970 "parser.y" +{ yyval.ulval = -yyvsp[0].ulval; } +break; +case 205: +#line 971 "parser.y" +{ yyval.ulval = yyvsp[-1].ulval; } +break; +case 206: +#line 976 "parser.y" +{ yyval.ulval = yyvsp[0].uval; } +break; +case 207: +#line 977 "parser.y" +{ yyval.ulval = yyvsp[0].ulval; } +break; +case 208: +#line 978 "parser.y" +{ yyval.ulval = bx_dbg_get_symbol_value(yyvsp[0].sval); free(yyvsp[0].sval);} +break; +case 209: +#line 979 "parser.y" +{ yyval.ulval = bx_dbg_get_reg_value(yyvsp[0].reg);} +break; +case 210: +#line 980 "parser.y" +{ yyval.ulval = bx_dbg_get_selector_value(yyvsp[0].uval);} +break; +case 211: +#line 981 "parser.y" +{ yyval.ulval = bx_dbg_get_laddr (yyvsp[-2].ulval, yyvsp[0].ulval); } +break; +case 212: +#line 982 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval + yyvsp[0].ulval; } +break; +case 213: +#line 983 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval - yyvsp[0].ulval; } +break; +case 214: +#line 984 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval * yyvsp[0].ulval; } +break; +case 215: +#line 985 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval / yyvsp[0].ulval; } +break; +case 216: +#line 986 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval >> yyvsp[0].ulval; } +break; +case 217: +#line 987 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval << yyvsp[0].ulval; } +break; +case 218: +#line 988 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval | yyvsp[0].ulval; } +break; +case 219: +#line 989 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval ^ yyvsp[0].ulval; } +break; +case 220: +#line 990 "parser.y" +{ yyval.ulval = yyvsp[-2].ulval & yyvsp[0].ulval; } +break; +case 221: +#line 991 "parser.y" +{ yyval.ulval = !yyvsp[0].ulval; } +break; +case 222: +#line 992 "parser.y" +{ yyval.ulval = -yyvsp[0].ulval; } +break; +case 223: +#line 993 "parser.y" +{ yyval.ulval = yyvsp[-1].ulval; } +break; +case 224: +#line 998 "parser.y" +{ bx_dbg_set_reg_value(yyvsp[-3].reg, yyvsp[-1].ulval); } +break; +#line 2370 "y.tab.c" } yyssp -= yym; yystate = *yyssp; diff --git a/bochs/debug/parser.h b/bochs/debug/parser.h index b02ff8203..9755cf6f9 100644 --- a/bochs/debug/parser.h +++ b/bochs/debug/parser.h @@ -2,101 +2,137 @@ #define YYERRCODE 256 #endif -#define BX_TOKEN_CONTINUE 257 -#define BX_TOKEN_STEPN 258 -#define BX_TOKEN_NEXT_STEP 259 -#define BX_TOKEN_SET 260 -#define BX_TOKEN_DEBUGGER 261 -#define BX_TOKEN_VBREAKPOINT 262 -#define BX_TOKEN_LBREAKPOINT 263 -#define BX_TOKEN_PBREAKPOINT 264 -#define BX_TOKEN_DEL_BREAKPOINT 265 -#define BX_TOKEN_INFO 266 -#define BX_TOKEN_QUIT 267 -#define BX_TOKEN_PROGRAM 268 -#define BX_TOKEN_REGISTERS 269 -#define BX_TOKEN_FPU 270 -#define BX_TOKEN_ALL 271 -#define BX_TOKEN_IDT 272 -#define BX_TOKEN_GDT 273 -#define BX_TOKEN_LDT 274 -#define BX_TOKEN_TSS 275 -#define BX_TOKEN_DIRTY 276 -#define BX_TOKEN_LINUX 277 -#define BX_TOKEN_CONTROL_REGS 278 -#define BX_TOKEN_EXAMINE 279 -#define BX_TOKEN_XFORMAT 280 -#define BX_TOKEN_SETPMEM 281 -#define BX_TOKEN_SYMBOLNAME 282 -#define BX_TOKEN_QUERY 283 -#define BX_TOKEN_PENDING 284 -#define BX_TOKEN_TAKE 285 -#define BX_TOKEN_DMA 286 -#define BX_TOKEN_IRQ 287 -#define BX_TOKEN_DUMP_CPU 288 -#define BX_TOKEN_SET_CPU 289 -#define BX_TOKEN_DIS 290 -#define BX_TOKEN_ON 291 -#define BX_TOKEN_OFF 292 -#define BX_TOKEN_DISASSEMBLE 293 -#define BX_TOKEN_INSTRUMENT 294 -#define BX_TOKEN_START 295 -#define BX_TOKEN_STOP 296 -#define BX_TOKEN_RESET 297 -#define BX_TOKEN_PRINT 298 -#define BX_TOKEN_LOADER 299 -#define BX_TOKEN_STRING 300 -#define BX_TOKEN_DOIT 301 -#define BX_TOKEN_CRC 302 -#define BX_TOKEN_TRACEON 303 -#define BX_TOKEN_TRACEOFF 304 -#define BX_TOKEN_PTIME 305 -#define BX_TOKEN_TIMEBP_ABSOLUTE 306 -#define BX_TOKEN_TIMEBP 307 -#define BX_TOKEN_RECORD 308 -#define BX_TOKEN_PLAYBACK 309 -#define BX_TOKEN_MODEBP 310 -#define BX_TOKEN_PRINT_STACK 311 -#define BX_TOKEN_WATCH 312 -#define BX_TOKEN_UNWATCH 313 -#define BX_TOKEN_READ 314 -#define BX_TOKEN_WRITE 315 -#define BX_TOKEN_SHOW 316 -#define BX_TOKEN_SYMBOL 317 -#define BX_TOKEN_GLOBAL 318 -#define BX_TOKEN_WHERE 319 -#define BX_TOKEN_PRINT_STRING 320 -#define BX_TOKEN_DIFF_MEMORY 321 -#define BX_TOKEN_SYNC_MEMORY 322 -#define BX_TOKEN_SYNC_CPU 323 -#define BX_TOKEN_FAST_FORWARD 324 -#define BX_TOKEN_PHY_2_LOG 325 -#define BX_TOKEN_NUMERIC 326 -#define BX_TOKEN_LONG_NUMERIC 327 -#define BX_TOKEN_INFO_ADDRESS 328 -#define BX_TOKEN_NE2000 329 -#define BX_TOKEN_PAGE 330 -#define BX_TOKEN_CS 331 -#define BX_TOKEN_ES 332 -#define BX_TOKEN_SS 333 -#define BX_TOKEN_DS 334 -#define BX_TOKEN_FS 335 -#define BX_TOKEN_GS 336 -#define BX_TOKEN_ALWAYS_CHECK 337 -#define BX_TOKEN_MATHS 338 -#define BX_TOKEN_ADD 339 -#define BX_TOKEN_SUB 340 -#define BX_TOKEN_MUL 341 -#define BX_TOKEN_DIV 342 -#define BX_TOKEN_V2L 343 -#define BX_TOKEN_TRACEREGON 344 -#define BX_TOKEN_TRACEREGOFF 345 -#define BX_TOKEN_HELP 346 -#define BX_TOKEN_IVT 347 +#define BX_TOKEN_REG_AL 257 +#define BX_TOKEN_REG_BL 258 +#define BX_TOKEN_REG_CL 259 +#define BX_TOKEN_REG_DL 260 +#define BX_TOKEN_REG_AH 261 +#define BX_TOKEN_REG_BH 262 +#define BX_TOKEN_REG_CH 263 +#define BX_TOKEN_REG_DH 264 +#define BX_TOKEN_REG_AX 265 +#define BX_TOKEN_REG_BX 266 +#define BX_TOKEN_REG_CX 267 +#define BX_TOKEN_REG_DX 268 +#define BX_TOKEN_REG_EAX 269 +#define BX_TOKEN_REG_EBX 270 +#define BX_TOKEN_REG_ECX 271 +#define BX_TOKEN_REG_EDX 272 +#define BX_TOKEN_REG_SI 273 +#define BX_TOKEN_REG_DI 274 +#define BX_TOKEN_REG_BP 275 +#define BX_TOKEN_REG_SP 276 +#define BX_TOKEN_REG_IP 277 +#define BX_TOKEN_REG_ESI 278 +#define BX_TOKEN_REG_EDI 279 +#define BX_TOKEN_REG_EBP 280 +#define BX_TOKEN_REG_ESP 281 +#define BX_TOKEN_REG_EIP 282 +#define BX_TOKEN_CONTINUE 283 +#define BX_TOKEN_STEPN 284 +#define BX_TOKEN_STEP_OVER 285 +#define BX_TOKEN_NEXT_STEP 286 +#define BX_TOKEN_SET 287 +#define BX_TOKEN_DEBUGGER 288 +#define BX_TOKEN_LIST_BREAK 289 +#define BX_TOKEN_VBREAKPOINT 290 +#define BX_TOKEN_LBREAKPOINT 291 +#define BX_TOKEN_PBREAKPOINT 292 +#define BX_TOKEN_DEL_BREAKPOINT 293 +#define BX_TOKEN_ENABLE_BREAKPOINT 294 +#define BX_TOKEN_DISABLE_BREAKPOINT 295 +#define BX_TOKEN_INFO 296 +#define BX_TOKEN_QUIT 297 +#define BX_TOKEN_PROGRAM 298 +#define BX_TOKEN_REGISTERS 299 +#define BX_TOKEN_CPU 300 +#define BX_TOKEN_FPU 301 +#define BX_TOKEN_ALL 302 +#define BX_TOKEN_IDT 303 +#define BX_TOKEN_GDT 304 +#define BX_TOKEN_LDT 305 +#define BX_TOKEN_TSS 306 +#define BX_TOKEN_DIRTY 307 +#define BX_TOKEN_LINUX 308 +#define BX_TOKEN_CONTROL_REGS 309 +#define BX_TOKEN_EXAMINE 310 +#define BX_TOKEN_XFORMAT 311 +#define BX_TOKEN_DISFORMAT 312 +#define BX_TOKEN_SETPMEM 313 +#define BX_TOKEN_SYMBOLNAME 314 +#define BX_TOKEN_QUERY 315 +#define BX_TOKEN_PENDING 316 +#define BX_TOKEN_TAKE 317 +#define BX_TOKEN_DMA 318 +#define BX_TOKEN_IRQ 319 +#define BX_TOKEN_DUMP_CPU 320 +#define BX_TOKEN_SET_CPU 321 +#define BX_TOKEN_DIS 322 +#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_PTIME 337 +#define BX_TOKEN_TIMEBP_ABSOLUTE 338 +#define BX_TOKEN_TIMEBP 339 +#define BX_TOKEN_RECORD 340 +#define BX_TOKEN_PLAYBACK 341 +#define BX_TOKEN_MODEBP 342 +#define BX_TOKEN_PRINT_STACK 343 +#define BX_TOKEN_WATCH 344 +#define BX_TOKEN_UNWATCH 345 +#define BX_TOKEN_READ 346 +#define BX_TOKEN_WRITE 347 +#define BX_TOKEN_SHOW 348 +#define BX_TOKEN_SYMBOL 349 +#define BX_TOKEN_SYMBOLS 350 +#define BX_TOKEN_LIST_SYMBOLS 351 +#define BX_TOKEN_GLOBAL 352 +#define BX_TOKEN_WHERE 353 +#define BX_TOKEN_PRINT_STRING 354 +#define BX_TOKEN_DIFF_MEMORY 355 +#define BX_TOKEN_SYNC_MEMORY 356 +#define BX_TOKEN_SYNC_CPU 357 +#define BX_TOKEN_FAST_FORWARD 358 +#define BX_TOKEN_PHY_2_LOG 359 +#define BX_TOKEN_NUMERIC 360 +#define BX_TOKEN_LONG_NUMERIC 361 +#define BX_TOKEN_INFO_ADDRESS 362 +#define BX_TOKEN_NE2000 363 +#define BX_TOKEN_PIC 364 +#define BX_TOKEN_PAGE 365 +#define BX_TOKEN_CS 366 +#define BX_TOKEN_ES 367 +#define BX_TOKEN_SS 368 +#define BX_TOKEN_DS 369 +#define BX_TOKEN_FS 370 +#define BX_TOKEN_GS 371 +#define BX_TOKEN_FLAGS 372 +#define BX_TOKEN_ALWAYS_CHECK 373 +#define BX_TOKEN_TRACEREGON 374 +#define BX_TOKEN_TRACEREGOFF 375 +#define BX_TOKEN_HELP 376 +#define BX_TOKEN_CALC 377 +#define BX_TOKEN_RSHIFT 378 +#define BX_TOKEN_LSHIFT 379 +#define BX_TOKEN_IVT 380 +#define NOT 381 +#define NEG 382 typedef union { char *sval; Bit32u uval; Bit64u ulval; bx_num_range uval_range; + Regs reg; } YYSTYPE; extern YYSTYPE bxlval; diff --git a/bochs/debug/parser.y b/bochs/debug/parser.y index 948dbccdc..b9512243c 100644 --- a/bochs/debug/parser.y +++ b/bochs/debug/parser.y @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: parser.y,v 1.9 2003-08-01 10:14:48 akrisak Exp $ +// $Id: parser.y,v 1.10 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// %{ @@ -8,10 +8,6 @@ #include "debug.h" #if BX_DEBUGGER -/* -NOTE: The #if comes from parser.y. The makefile will add the matching #endif -at the end of parser.c. I don't know any way to ask yacc to put it at the end. -*/ // %left '-' '+' // %left '*' '/' @@ -25,21 +21,59 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. Bit32u uval; Bit64u ulval; bx_num_range uval_range; + Regs reg; } +// Common registers +%type BX_TOKEN_COMMON_REG +%type BX_TOKEN_INDEX_REG +%type BX_TOKEN_PTR_REG +%type BX_TOKEN_NONSEG_REG +%token BX_TOKEN_REG_AL +%token BX_TOKEN_REG_BL +%token BX_TOKEN_REG_CL +%token BX_TOKEN_REG_DL +%token BX_TOKEN_REG_AH +%token BX_TOKEN_REG_BH +%token BX_TOKEN_REG_CH +%token BX_TOKEN_REG_DH +%token BX_TOKEN_REG_AX +%token BX_TOKEN_REG_BX +%token BX_TOKEN_REG_CX +%token BX_TOKEN_REG_DX +%token BX_TOKEN_REG_EAX +%token BX_TOKEN_REG_EBX +%token BX_TOKEN_REG_ECX +%token BX_TOKEN_REG_EDX +%token BX_TOKEN_REG_SI +%token BX_TOKEN_REG_DI +%token BX_TOKEN_REG_BP +%token BX_TOKEN_REG_SP +%token BX_TOKEN_REG_IP +%token BX_TOKEN_REG_ESI +%token BX_TOKEN_REG_EDI +%token BX_TOKEN_REG_EBP +%token BX_TOKEN_REG_ESP +%token BX_TOKEN_REG_EIP + %token BX_TOKEN_CONTINUE %token BX_TOKEN_STEPN +%token BX_TOKEN_STEP_OVER %token BX_TOKEN_NEXT_STEP %token BX_TOKEN_SET %token BX_TOKEN_DEBUGGER +%token BX_TOKEN_LIST_BREAK %token BX_TOKEN_VBREAKPOINT %token BX_TOKEN_LBREAKPOINT %token BX_TOKEN_PBREAKPOINT %token BX_TOKEN_DEL_BREAKPOINT +%token BX_TOKEN_ENABLE_BREAKPOINT +%token BX_TOKEN_DISABLE_BREAKPOINT %token BX_TOKEN_INFO %token BX_TOKEN_QUIT %token BX_TOKEN_PROGRAM %token BX_TOKEN_REGISTERS +%token BX_TOKEN_CPU %token BX_TOKEN_FPU %token BX_TOKEN_ALL %token BX_TOKEN_IDT @@ -51,6 +85,7 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. %token BX_TOKEN_CONTROL_REGS %token BX_TOKEN_EXAMINE %token BX_TOKEN_XFORMAT +%token BX_TOKEN_DISFORMAT %token BX_TOKEN_SETPMEM %token BX_TOKEN_SYMBOLNAME %token BX_TOKEN_QUERY @@ -88,6 +123,8 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. %token BX_TOKEN_WRITE %token BX_TOKEN_SHOW %token BX_TOKEN_SYMBOL +%token BX_TOKEN_SYMBOLS +%token BX_TOKEN_LIST_SYMBOLS %token BX_TOKEN_GLOBAL %token BX_TOKEN_WHERE %token BX_TOKEN_PRINT_STRING @@ -100,6 +137,7 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. %token BX_TOKEN_LONG_NUMERIC %token BX_TOKEN_INFO_ADDRESS %token BX_TOKEN_NE2000 +%token BX_TOKEN_PIC %token BX_TOKEN_PAGE %token BX_TOKEN_CS %token BX_TOKEN_ES @@ -107,20 +145,24 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. %token BX_TOKEN_DS %token BX_TOKEN_FS %token BX_TOKEN_GS +%token BX_TOKEN_FLAGS %token BX_TOKEN_ALWAYS_CHECK -%token BX_TOKEN_MATHS -%token BX_TOKEN_ADD -%token BX_TOKEN_SUB -%token BX_TOKEN_MUL -%token BX_TOKEN_DIV -%token BX_TOKEN_V2L %token BX_TOKEN_TRACEREGON %token BX_TOKEN_TRACEREGOFF %token BX_TOKEN_HELP +%token BX_TOKEN_CALC +%token BX_TOKEN_RSHIFT +%token BX_TOKEN_LSHIFT %token BX_TOKEN_IVT %type segment_register %type optional_numeric %type numeric_range optional_numeric_range +%type vexpression +%type expression + +%left '+' '-' '|' '^' +%left '*' '/' '&' BX_TOKEN_LSHIFT BX_TOKEN_RSHIFT +%left NOT NEG %start command @@ -128,11 +170,17 @@ at the end of parser.c. I don't know any way to ask yacc to put it at the end. command: continue_command | stepN_command + | step_over_command | set_command + | set_reg_command | breakpoint_command | info_command + | blist_command + | slist_command | dump_cpu_command | delete_command + | bpe_command + | bpd_command | quit_command | examine_command | setpmem_command @@ -144,7 +192,6 @@ command: | loader_command | doit_command | crc_command - | maths_command | trace_on_command | trace_off_command | ptime_command @@ -159,10 +206,10 @@ command: | where_command | print_string_command | cosim_commands - | v2l_command | trace_reg_on_command | trace_reg_off_command | help_command + | calc_command | | '\n' { @@ -417,6 +464,14 @@ stepN_command: } ; +step_over_command: + BX_TOKEN_STEP_OVER '\n' + { + bx_dbg_step_over_command(); + free($1); + } + ; + set_command: BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_ON '\n' { @@ -438,47 +493,78 @@ set_command: breakpoint_command: BX_TOKEN_VBREAKPOINT '\n' { - bx_dbg_vbreakpoint_command(0, 0, 0); + bx_dbg_vbreakpoint_command(bkAtIP, 0, 0); free($1); } - | BX_TOKEN_VBREAKPOINT BX_TOKEN_NUMERIC ':' BX_TOKEN_NUMERIC '\n' + | BX_TOKEN_VBREAKPOINT vexpression ':' expression '\n' { - bx_dbg_vbreakpoint_command(1, $2, $4); + bx_dbg_vbreakpoint_command(bkRegular, $2, $4); free($1); } | BX_TOKEN_LBREAKPOINT '\n' { - bx_dbg_lbreakpoint_command(0, 0); + bx_dbg_lbreakpoint_command(bkAtIP, 0); free($1); } - | BX_TOKEN_LBREAKPOINT BX_TOKEN_NUMERIC '\n' + | BX_TOKEN_LBREAKPOINT expression '\n' { - bx_dbg_lbreakpoint_command(1, $2); + bx_dbg_lbreakpoint_command(bkRegular, $2); free($1); } + | BX_TOKEN_LBREAKPOINT BX_TOKEN_STRING '\n' + { + bx_dbg_lbreakpoint_symbol_command($2); + free($1);free($2); + } | BX_TOKEN_PBREAKPOINT '\n' { - bx_dbg_pbreakpoint_command(0, 0); + bx_dbg_pbreakpoint_command(bkAtIP, 0); free($1); } - | BX_TOKEN_PBREAKPOINT BX_TOKEN_NUMERIC '\n' + | BX_TOKEN_PBREAKPOINT expression '\n' { - bx_dbg_pbreakpoint_command(1, $2); + bx_dbg_pbreakpoint_command(bkRegular, $2); free($1); } - | BX_TOKEN_PBREAKPOINT '*' BX_TOKEN_NUMERIC '\n' + | BX_TOKEN_PBREAKPOINT '*' expression '\n' { - bx_dbg_pbreakpoint_command(1, $3); + bx_dbg_pbreakpoint_command(bkRegular, $3); free($1); } ; +blist_command: + BX_TOKEN_LIST_BREAK '\n' + { + bx_dbg_info_bpoints_command(); + free($1); + } + ; + +slist_command: + BX_TOKEN_LIST_SYMBOLS '\n' + { + bx_dbg_info_symbols_command(0); + free($1); + } + | BX_TOKEN_LIST_SYMBOLS BX_TOKEN_STRING '\n' + { + bx_dbg_info_symbols_command($2); + free($1);free($2); + } + ; + info_command: BX_TOKEN_INFO BX_TOKEN_PBREAKPOINT '\n' { bx_dbg_info_bpoints_command(); free($1); free($2); } + | BX_TOKEN_INFO BX_TOKEN_CPU '\n' + { + bx_dbg_dump_cpu_command(); + free($1); free($2); + } | BX_TOKEN_INFO BX_TOKEN_PROGRAM '\n' { bx_dbg_info_program_command(); @@ -529,11 +615,26 @@ info_command: bx_dbg_info_tss_command($3); free($1); free($2); } + | BX_TOKEN_INFO BX_TOKEN_FLAGS '\n' + { + bx_dbg_info_flags(); + free($1); free($2); + } | BX_TOKEN_INFO BX_TOKEN_LINUX '\n' { bx_dbg_info_linux_command(); free($1); free($2); } + | BX_TOKEN_INFO BX_TOKEN_SYMBOLS '\n' + { + bx_dbg_info_symbols_command(0); + free($1); free($2); + } + | BX_TOKEN_INFO BX_TOKEN_SYMBOLS BX_TOKEN_STRING '\n' + { + bx_dbg_info_symbols_command($3); + free($1); free($2); free($3); + } | BX_TOKEN_INFO BX_TOKEN_CONTROL_REGS '\n' { bx_dbg_info_control_regs_command(); @@ -554,6 +655,11 @@ info_command: free($1); free($2); free($3); free($5); bx_dbg_info_ne2k($4, $6); } + | BX_TOKEN_INFO BX_TOKEN_PIC '\n' + { + bx_dbg_info_pic(); + free($1); free($2); + } ; optional_numeric : @@ -565,19 +671,14 @@ optional_numeric_range: | numeric_range; numeric_range : - BX_TOKEN_NUMERIC + expression { $$ = make_num_range ($1, $1); } | - BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC + expression expression { $$ = make_num_range ($1, $2); - } - | - BX_TOKEN_NUMERIC ':' BX_TOKEN_NUMERIC - { - $$ = make_num_range ($1, $3); }; @@ -597,6 +698,21 @@ delete_command: } ; +bpe_command: + BX_TOKEN_ENABLE_BREAKPOINT BX_TOKEN_NUMERIC '\n' + { + bx_dbg_en_dis_breakpoint_command($2, 1); + free($1); + } + ; +bpd_command: + BX_TOKEN_DISABLE_BREAKPOINT BX_TOKEN_NUMERIC '\n' + { + bx_dbg_en_dis_breakpoint_command($2, 0); + free($1); + } + ; + quit_command: BX_TOKEN_QUIT '\n' { @@ -607,7 +723,7 @@ quit_command: examine_command: - BX_TOKEN_EXAMINE BX_TOKEN_XFORMAT BX_TOKEN_NUMERIC '\n' + BX_TOKEN_EXAMINE BX_TOKEN_XFORMAT expression '\n' { bx_dbg_examine_command($1, $2,1, $3,1, 0); #if BX_NUM_SIMULATORS >= 2 @@ -623,7 +739,7 @@ examine_command: #endif free($1); free($2); } - | BX_TOKEN_EXAMINE BX_TOKEN_NUMERIC '\n' + | BX_TOKEN_EXAMINE expression '\n' { //FIXME HanishKVC This method of hunting thro all the // simulators may be better than using 2 calls if @@ -696,9 +812,14 @@ set_cpu_command: disassemble_command: BX_TOKEN_DISASSEMBLE optional_numeric_range '\n' { - bx_dbg_disassemble_command($2); + bx_dbg_disassemble_command(NULL, $2); free($1); } + | BX_TOKEN_DISASSEMBLE BX_TOKEN_DISFORMAT optional_numeric_range '\n' + { + bx_dbg_disassemble_command($2, $3); + free($1); free($2); + } ; instrument_command: @@ -748,41 +869,6 @@ crc_command: } ; -maths_command: - BX_TOKEN_MATHS BX_TOKEN_ADD BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n' - { - bx_dbg_maths_command($2, $3, $4); - free($1); free($2); - } - | BX_TOKEN_MATHS BX_TOKEN_SUB BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n' - { - bx_dbg_maths_command($2, $3, $4); - free($1); free($2); - } - | BX_TOKEN_MATHS BX_TOKEN_MUL BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n' - { - bx_dbg_maths_command($2, $3, $4); - free($1); free($2); - } - | BX_TOKEN_MATHS BX_TOKEN_DIV BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC '\n' - { - bx_dbg_maths_command($2, $3, $4); - free($1); free($2); - } - | BX_TOKEN_MATHS BX_TOKEN_STRING '\n' - { - bx_dbg_maths_expression_command($2); - free($1); free($2); - } - -v2l_command: - BX_TOKEN_V2L segment_register ':' BX_TOKEN_NUMERIC '\n' - { - bx_dbg_v2l_command($2, $4); - free($1); - } - ; - trace_reg_on_command: BX_TOKEN_TRACEREGON '\n' { @@ -812,4 +898,103 @@ help_command: } ; +calc_command: + BX_TOKEN_CALC expression '\n' + { + bx_dbg_calc_command($2); + free($1); + } +; + +BX_TOKEN_COMMON_REG: + BX_TOKEN_REG_AL + | BX_TOKEN_REG_BL + | BX_TOKEN_REG_CL + | BX_TOKEN_REG_DL + | BX_TOKEN_REG_AH + | BX_TOKEN_REG_BH + | BX_TOKEN_REG_CH + | BX_TOKEN_REG_DH + | BX_TOKEN_REG_AX + | BX_TOKEN_REG_BX + | BX_TOKEN_REG_CX + | BX_TOKEN_REG_DX + | BX_TOKEN_REG_EAX + | BX_TOKEN_REG_EBX + | BX_TOKEN_REG_ECX + | BX_TOKEN_REG_EDX + { $$=$1; } +; + +BX_TOKEN_INDEX_REG: + BX_TOKEN_REG_SI + | BX_TOKEN_REG_DI + | BX_TOKEN_REG_ESI + | BX_TOKEN_REG_EDI + { $$=$1; } +; + +BX_TOKEN_PTR_REG: + BX_TOKEN_REG_BP + | BX_TOKEN_REG_SP + | BX_TOKEN_REG_IP + | BX_TOKEN_REG_EBP + | BX_TOKEN_REG_ESP + | BX_TOKEN_REG_EIP + { $$=$1; } +; + +BX_TOKEN_NONSEG_REG: + BX_TOKEN_COMMON_REG + | BX_TOKEN_INDEX_REG + | BX_TOKEN_PTR_REG + { $$=$1; } +; + +/* Arithmetic expression for vbreak command */ +vexpression: + BX_TOKEN_NUMERIC { $$ = $1; } + | BX_TOKEN_LONG_NUMERIC { $$ = $1; } + | BX_TOKEN_NONSEG_REG { $$ = bx_dbg_get_reg_value($1); } + | segment_register { $$ = bx_dbg_get_selector_value($1); } + | vexpression '+' vexpression { $$ = $1 + $3; } + | vexpression '-' vexpression { $$ = $1 - $3; } + | vexpression '*' vexpression { $$ = $1 * $3; } + | vexpression '/' vexpression { $$ = $1 / $3; } + | vexpression BX_TOKEN_RSHIFT vexpression { $$ = $1 >> $3; } + | vexpression BX_TOKEN_LSHIFT vexpression { $$ = $1 << $3; } + | vexpression '|' vexpression { $$ = $1 | $3; } + | vexpression '^' vexpression { $$ = $1 ^ $3; } + | vexpression '&' vexpression { $$ = $1 & $3; } + | '!' vexpression %prec NOT { $$ = !$2; } + | '-' vexpression %prec NEG { $$ = -$2; } + | '(' vexpression ')' { $$ = $2; } +; + +/* Same as vexpression but includes the ':' operator - used in most commands */ +expression: + BX_TOKEN_NUMERIC { $$ = $1; } + | BX_TOKEN_LONG_NUMERIC { $$ = $1; } + | BX_TOKEN_STRING { $$ = bx_dbg_get_symbol_value($1); free($1);} + | BX_TOKEN_NONSEG_REG { $$ = bx_dbg_get_reg_value($1);} + | segment_register { $$ = bx_dbg_get_selector_value($1);} + | expression ':' expression { $$ = bx_dbg_get_laddr ($1, $3); } + | expression '+' expression { $$ = $1 + $3; } + | expression '-' expression { $$ = $1 - $3; } + | expression '*' expression { $$ = $1 * $3; } + | expression '/' expression { $$ = $1 / $3; } + | expression BX_TOKEN_RSHIFT expression { $$ = $1 >> $3; } + | expression BX_TOKEN_LSHIFT expression { $$ = $1 << $3; } + | expression '|' expression { $$ = $1 | $3; } + | expression '^' expression { $$ = $1 ^ $3; } + | expression '&' expression { $$ = $1 & $3; } + | '!' expression %prec NOT { $$ = !$2; } + | '-' expression %prec NEG { $$ = -$2; } + | '(' expression ')' { $$ = $2; } +; + +set_reg_command: + BX_TOKEN_REGISTERS BX_TOKEN_NONSEG_REG '=' expression '\n' + { bx_dbg_set_reg_value($2, $4); } +; %% diff --git a/bochs/disasm/dis_decode.cc b/bochs/disasm/dis_decode.cc index ce3a9c483..b277e72aa 100644 --- a/bochs/disasm/dis_decode.cc +++ b/bochs/disasm/dis_decode.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: dis_decode.cc,v 1.13 2003-01-21 13:23:47 cbothamy Exp $ +// $Id: dis_decode.cc,v 1.14 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -324,7 +324,7 @@ index_name32[7] = "EDI"; unsigned -bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) +bx_disassemble_c::disasm(bx_bool is_32, Bit32u base, Bit32u ip, Bit8u *instr, char *disbuf) { int byte_count; Bit8u next_byte; @@ -333,6 +333,7 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) db_32bit_opsize = is_32; db_32bit_addrsize = is_32; db_eip = ip; + db_base = base; // cs linear base (base for PM & cs<<4 for RM & VM) instruction_begin = instruction = instr; seg_override = NULL; @@ -396,7 +397,7 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x04: dis_sprintf("smsw "); Ew(); goto done; case 0x05: invalid_opcode(); goto done; case 0x06: dis_sprintf("lmsw "); Ew(); goto done; - case 0x07: invalid_opcode(); goto done; + case 0x07: dis_sprintf("invlpg "); Mb(); goto done; default: BX_PANIC(("debugger: invalid opcode")); goto done; } @@ -408,8 +409,8 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x07: invalid_opcode(); goto done; case 0x08: dis_sprintf("invd"); goto done; case 0x09: dis_sprintf("wbinvd"); goto done; - case 0x0A: - case 0x0B: + case 0x0A: invalid_opcode(); goto done; + case 0x0B: dis_sprintf("ud2"); goto done; case 0x0C: case 0x0D: case 0x0E: @@ -423,7 +424,25 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x15: case 0x16: case 0x17: - case 0x18: + case 0x18: /* Group 16 */ + mod_rm_byte = peek_byte(); + BX_DECODE_MODRM(mod_rm_byte, mod, opcode, rm); + if(mod&3!=3) { // only mem allowed + invalid_opcode(); goto done; + } + + switch (opcode) { + case 0x00: dis_sprintf("prefetchnta "); Mb(); goto done; + case 0x01: dis_sprintf("prefetcht0 "); Mb(); goto done; + case 0x02: dis_sprintf("prefetcht1 "); Mb(); goto done; + case 0x03: dis_sprintf("prefetcht2 "); Mb(); goto done; + case 0x04: + case 0x05: + case 0x06: + case 0x07: invalid_opcode(); goto done; + default: BX_PANIC(("debugger: invalid opcode")); goto done; + } + case 0x19: case 0x1A: case 0x1B: @@ -449,12 +468,13 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x2E: case 0x2F: invalid_opcode(); goto done; - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: + case 0x30: dis_sprintf("wrmsr"); goto done; + case 0x31: dis_sprintf("rdtsc"); goto done; + case 0x32: dis_sprintf("rdmsr"); goto done; + case 0x33: dis_sprintf("rdpmc"); goto done; + case 0x34: dis_sprintf("sysenter"); goto done; + case 0x35: dis_sprintf("sysexit"); goto done; + case 0x36: case 0x37: case 0x38: @@ -466,22 +486,22 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x3E: case 0x3F: invalid_opcode(); goto done; - case 0x40: - case 0x41: - case 0x42: - case 0x43: - case 0x44: - case 0x45: - case 0x46: - case 0x47: - case 0x48: - case 0x49: - case 0x4A: - case 0x4B: - case 0x4C: - case 0x4D: - case 0x4E: - case 0x4F: invalid_opcode(); goto done; + case 0x40: dis_sprintf("cmovo "); GvEv(); goto done; + case 0x41: dis_sprintf("cmovno "); GvEv(); goto done; + case 0x42: dis_sprintf("cmovc "); GvEv(); goto done; + case 0x43: dis_sprintf("cmovnc "); GvEv(); goto done; + case 0x44: dis_sprintf("cmovz "); GvEv(); goto done; + case 0x45: dis_sprintf("cmovnz "); GvEv(); goto done; + case 0x46: dis_sprintf("cmovna "); GvEv(); goto done; + case 0x47: dis_sprintf("cmova "); GvEv(); goto done; + case 0x48: dis_sprintf("cmovs "); GvEv(); goto done; + case 0x49: dis_sprintf("cmovns "); GvEv(); goto done; + case 0x4A: dis_sprintf("cmovp "); GvEv(); goto done; + case 0x4B: dis_sprintf("cmovnp "); GvEv(); goto done; + case 0x4C: dis_sprintf("cmovl "); GvEv(); goto done; + case 0x4D: dis_sprintf("cmovnl "); GvEv(); goto done; + case 0x4E: dis_sprintf("cmovng "); GvEv(); goto done; + case 0x4F: dis_sprintf("cmovg "); GvEv(); goto done; case 0x50: case 0x51: @@ -570,7 +590,7 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0xA0: dis_sprintf("push fs"); goto done; case 0xA1: dis_sprintf("pop fs"); goto done; - case 0xA2: invalid_opcode(); goto done; + case 0xA2: dis_sprintf("cpuid"); goto done; case 0xA3: dis_sprintf("bt "); EvGv(); goto done; case 0xA4: dis_sprintf("shld "); EvGv(); dis_sprintf(", "); Ib(); goto done; case 0xA5: dis_sprintf("shld "); EvGv(); dis_sprintf(", CL"); goto done; @@ -578,11 +598,40 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0xA7: dis_sprintf("cmpxchg "); IBTS(); goto done; case 0xA8: dis_sprintf("push gs"); goto done; case 0xA9: dis_sprintf("pop gs"); goto done; - case 0xAA: invalid_opcode(); goto done; + case 0xAA: dis_sprintf("rsm"); goto done; case 0xAB: dis_sprintf("bts "); EvGv(); goto done; case 0xAC: dis_sprintf("shrd "); EvGv(); dis_sprintf(", "); Ib(); goto done; case 0xAD: dis_sprintf("shrd "); EvGv(); dis_sprintf(", CL"); goto done; - case 0xAE: invalid_opcode(); goto done; + case 0xAE: /* Group 15 */ + mod_rm_byte = peek_byte(); + BX_DECODE_MODRM(mod_rm_byte, mod, opcode, rm); + if(mod&3==3) { + switch (opcode) { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: invalid_opcode(); goto done; + case 0x05: dis_sprintf("lfence"); goto done; + case 0x06: dis_sprintf("mfence"); goto done; + case 0x07: dis_sprintf("sfence"); goto done; + default: BX_PANIC(("debugger: invalid opcode")); goto done; + } + } + else { + switch (opcode) { + case 0x00: dis_sprintf("fxsave"); goto done; + case 0x01: dis_sprintf("fxstor"); goto done; + case 0x02: dis_sprintf("ldmxcsr"); goto done; + case 0x03: dis_sprintf("stmxcsr"); goto done; + case 0x04: + case 0x05: + case 0x06: invalid_opcode(); goto done; + case 0x07: dis_sprintf("clflush"); goto done; + default: BX_PANIC(("debugger: invalid opcode")); goto done; + } + } + case 0xAF: dis_sprintf("imul "); GvEv(); goto done; case 0xB0: dis_sprintf("cmpxchg "); EbGb(); goto done; @@ -609,7 +658,6 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x07: dis_sprintf("btc "); EvIb(); goto done; default: BX_PANIC(("debugger: invalid opcode")); goto done; } - case 0xBB: dis_sprintf("btc "); EvGv(); goto done; case 0xBC: dis_sprintf("bsf "); GvEv(); goto done; case 0xBD: dis_sprintf("bsr "); GvEv(); goto done; @@ -622,8 +670,25 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0xC3: case 0xC4: case 0xC5: - case 0xC6: - case 0xC7: invalid_opcode(); goto done; + case 0xC6: invalid_opcode(); goto done; + case 0xC7: /* Group 9 */ + mod_rm_byte = peek_byte(); + BX_DECODE_MODRM(mod_rm_byte, mod, opcode, rm); + if(mod&3==3) {// no regs allowed + invalid_opcode(); goto done; + } + + switch (opcode) { + case 0x00: invalid_opcode(); goto done; + case 0x01: dis_sprintf("cmpxchg8b "); Mq(); goto done; + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: invalid_opcode(); goto done; + default: BX_PANIC(("debugger: invalid opcode")); goto done; + } case 0xC8: dis_sprintf("bswap "); eAX(); goto done; case 0xC9: dis_sprintf("bswap "); eCX(); goto done; case 0xCA: dis_sprintf("bswap "); eDX(); goto done; @@ -938,8 +1003,20 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0x99: dis_sprintf("cwd"); goto done; case 0x9A: dis_sprintf("call "); Ap(); goto done; case 0x9B: dis_sprintf("wait"); goto done; - case 0x9C: dis_sprintf("pushf"); goto done; - case 0x9D: dis_sprintf("popf"); goto done; + case 0x9C: + if (db_32bit_opsize) + dis_sprintf("pushfd"); + else + dis_sprintf("pushf"); + goto done; + + case 0x9D: + if (db_32bit_opsize) + dis_sprintf("popfd"); + else + dis_sprintf("popf"); + goto done; + case 0x9E: dis_sprintf("sahf"); goto done; case 0x9F: dis_sprintf("lahf"); goto done; @@ -1056,21 +1133,26 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) default: BX_PANIC(("debugger: invalid opcode")); goto done; } - case 0xC2: dis_sprintf("ret_near "); Iw(); goto done; - case 0xC3: dis_sprintf("ret_near"); goto done; + case 0xC2: dis_sprintf("retn "); Iw(); goto done; + case 0xC3: dis_sprintf("retn"); goto done; case 0xC4: dis_sprintf("les "); GvMp(); goto done; case 0xC5: dis_sprintf("lds "); GvMp(); goto done; case 0xC6: dis_sprintf("mov "); EbIb(); goto done; case 0xC7: dis_sprintf("mov "); EvIv(); goto done; case 0xC8: dis_sprintf("enter "); Iw(); dis_sprintf(", "); Ib(); goto done; case 0xC9: dis_sprintf("leave"); goto done; - case 0xCA: dis_sprintf("ret_far "); Iw(); goto done; - case 0xCB: dis_sprintf("ret_far"); goto done; + case 0xCA: dis_sprintf("retf "); Iw(); goto done; + case 0xCB: dis_sprintf("retf"); goto done; case 0xCC: dis_sprintf("int3"); goto done; case 0xCD: dis_sprintf("int "); Ib(); goto done; case 0xCE: dis_sprintf("into"); goto done; - case 0xCF: dis_sprintf("iret"); goto done; - + case 0xCF: + if (db_32bit_opsize) { + dis_sprintf("iretd"); goto done; + } + else { + dis_sprintf("iret"); goto done; + } case 0xD0: /* Group 2 Eb,1 */ mod_rm_byte = peek_byte(); @@ -1442,7 +1524,7 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0xE5: dis_sprintf("in "); eAX(); dis_sprintf(", "); Ib(); goto done; case 0xE6: dis_sprintf("out "); Ib(); dis_sprintf(", AL"); goto done; case 0xE7: dis_sprintf("out "); Ib(); dis_sprintf(", "); eAX(); goto done; - case 0xE8: dis_sprintf("call "); Av(); goto done; + case 0xE8: dis_sprintf("call "); Jv(); goto done; case 0xE9: dis_sprintf("jmp "); Jv(); goto done; case 0xEA: dis_sprintf("jmp "); Ap(); goto done; case 0xEB: dis_sprintf("jmp "); Jb(); goto done; @@ -1454,7 +1536,7 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf) case 0xF0: /* LOCK */ dis_sprintf("LOCK: "); break; - case 0xF1: invalid_opcode(); goto done; + case 0xF1: dis_sprintf("int1"); goto done; case 0xF2: /* REPNE/REPNZ */ db_repne_prefix = 1; dis_sprintf("REPNE: "); diff --git a/bochs/disasm/dis_groups.cc b/bochs/disasm/dis_groups.cc index 2f482e6dd..f74b5ad5d 100644 --- a/bochs/disasm/dis_groups.cc +++ b/bochs/disasm/dis_groups.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: dis_groups.cc,v 1.9 2003-08-03 16:44:53 sshwarts Exp $ +// $Id: dis_groups.cc,v 1.10 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -156,6 +156,18 @@ bx_disassemble_c::Mp(void) GvMp(); } + void +bx_disassemble_c::Mq(void) +{ + Ms(); +} + +void +bx_disassemble_c::Mb(void) +{ + Ms(); +} + void bx_disassemble_c::GvMa(void) { @@ -412,22 +424,6 @@ bx_disassemble_c::GvEb(void) decode_gxex(BX_GENERAL_16BIT_REG, BX_GENERAL_8BIT_REG); } - - void -bx_disassemble_c::Av(void) -{ - if (db_32bit_opsize) { - Bit32s imm32; - imm32 = (Bit32s) fetch_dword(); - dis_sprintf("%08x", (unsigned) (imm32 + db_eip)); - } - else { - Bit16s imm16; - imm16 = (Bit16s) fetch_word(); - dis_sprintf("%04x", (unsigned) ((imm16 + db_eip) & 0xFFFF)); - } -} - void bx_disassemble_c::Eb(void) { @@ -525,6 +521,13 @@ bx_disassemble_c::Jv(void) Bit32s imm32; /* JMP rel32 is signed */ imm32 = (Bit32s) fetch_dword(); +#if BX_DEBUGGER + char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)(imm32 + db_eip), db_base); + if(Sym) { + dis_sprintf("%s", Sym); + } + else // Symbol not found +#endif dis_sprintf("%08x", (unsigned) (imm32 + db_eip)); } else @@ -533,6 +536,13 @@ bx_disassemble_c::Jv(void) Bit16s imm16; /* JMP rel16 is signed */ imm16 = (Bit16s) fetch_word(); +#if BX_DEBUGGER + char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)((imm16 + db_eip) & 0xFFFF), db_base); + if(Sym) { + dis_sprintf("%s", Sym); + } + else // Symbol not found +#endif dis_sprintf("%04x", (unsigned) ((imm16 + db_eip) & 0xFFFF)); } } @@ -596,11 +606,25 @@ bx_disassemble_c::Jb(void) imm8 = (Bit8s) fetch_byte(); #if BX_CPU_LEVEL > 2 if (db_32bit_opsize) { +#if BX_DEBUGGER + char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)(imm8 + db_eip), db_base); + if(Sym) { + dis_sprintf("%s", Sym); + } + else // Symbol not found +#endif dis_sprintf("%08x", (unsigned) (imm8 + db_eip)); } else #endif { +#if BX_DEBUGGER + char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)((imm8 + db_eip) & 0xFFFF), db_base); + if(Sym) { + dis_sprintf("%s", Sym); + } + else // Symbol not found + #endif dis_sprintf("%04x", (unsigned) ((imm8 + db_eip) & 0xFFFF)); } } diff --git a/bochs/disasm/disasm.h b/bochs/disasm/disasm.h index 52916d315..0316d7bbd 100644 --- a/bochs/disasm/disasm.h +++ b/bochs/disasm/disasm.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: disasm.h,v 1.8 2002-10-25 11:44:35 bdenney Exp $ +// $Id: disasm.h,v 1.9 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -40,7 +40,7 @@ class bx_disassemble_c : public logfunctions { public: bx_disassemble_c(void); - unsigned disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf); + unsigned disasm(bx_bool is_32, Bit32u base, Bit32u ip, Bit8u *instr, char *disbuf); private: bx_bool db_32bit_opsize; @@ -48,6 +48,7 @@ private: bx_bool db_rep_prefix; bx_bool db_repne_prefix; Bit32u db_eip; + Bit32u db_base; Bit8u *instruction_begin; // keep track of where instruction starts Bit8u *instruction; // for fetching of next byte of instruction @@ -133,6 +134,8 @@ private: void XBTS(void); void IBTS(void); void Mp(void); + void Mq(void); + void Mb(void); void EvIb(void); void GvEb(void); void GvMa(void); @@ -183,7 +186,6 @@ private: void El(void); void STi_ST(void); void Eq(void); - void Av(void); void eAXEv(void); void Ep(void); }; diff --git a/bochs/instrument/example0/instrument.cc b/bochs/instrument/example0/instrument.cc index 44f18f96f..e0d12239c 100644 --- a/bochs/instrument/example0/instrument.cc +++ b/bochs/instrument/example0/instrument.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: instrument.cc,v 1.10 2003-02-28 20:51:07 sshwarts Exp $ +// $Id: instrument.cc,v 1.11 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -84,7 +84,7 @@ void bx_instr_new_instruction(unsigned cpu) char disasm_tbuf[512]; // buffer for instruction disassembly unsigned length = i->opcode_size, n; - bx_disassemble.disasm(i->is32, 0, i->opcode, disasm_tbuf); + bx_disassemble.disasm(i->is32, 0, 0, i->opcode, disasm_tbuf); if(length != 0) { diff --git a/bochs/instrument/example1/instrument.cc b/bochs/instrument/example1/instrument.cc index 553a7f262..cfc18c1df 100644 --- a/bochs/instrument/example1/instrument.cc +++ b/bochs/instrument/example1/instrument.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: instrument.cc,v 1.6 2003-02-13 15:04:09 sshwarts Exp $ +// $Id: instrument.cc,v 1.7 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -48,7 +48,7 @@ void bxInstrumentation::bx_instr_new_instruction() { char disasm_tbuf[512]; // buffer for instruction disassembly unsigned length = opcode_size, n; - bx_disassemble.disasm(is32, 0, opcode, disasm_tbuf); + bx_disassemble.disasm(is32, 0, 0, opcode, disasm_tbuf); if(length != 0) { fprintf(stderr, "----------------------------------------------------------\n"); diff --git a/bochs/iodev/iodev.h b/bochs/iodev/iodev.h index 22b1ca5ad..a5dea45f5 100644 --- a/bochs/iodev/iodev.h +++ b/bochs/iodev/iodev.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: iodev.h,v 1.36 2003-07-31 15:29:34 vruppert Exp $ +// $Id: iodev.h,v 1.37 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -213,6 +213,9 @@ class BOCHSAPI bx_pic_stub_c : public bx_devmodel_c { virtual Bit8u IAC(void) { STUBFUNC(pic, IAC); return 0; } + virtual void show_pic_state(void) { + STUBFUNC(pic, show_pic_state); + } }; class BOCHSAPI bx_vga_stub_c : public bx_devmodel_c { diff --git a/bochs/iodev/pic.cc b/bochs/iodev/pic.cc index e02de1ee5..a630fd933 100644 --- a/bochs/iodev/pic.cc +++ b/bochs/iodev/pic.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pic.cc,v 1.31 2003-07-31 19:51:42 vruppert Exp $ +// $Id: pic.cc,v 1.32 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -167,7 +167,7 @@ bx_pic_c::read(Bit32u address, unsigned io_len) clear_highest_interrupt(& BX_PIC_THIS s.master_pic); BX_PIC_THIS s.master_pic.polled = 0; service_master_pic(); - return BX_PIC_THIS s.master_pic.irq; // Return the current irq requested + return io_len==1?BX_PIC_THIS s.master_pic.irq:(BX_PIC_THIS s.master_pic.irq)<<8|(BX_PIC_THIS s.master_pic.irq); // Return the current irq requested } if((address == 0xa0 || address == 0xa1) && BX_PIC_THIS s.slave_pic.polled) { @@ -175,7 +175,7 @@ bx_pic_c::read(Bit32u address, unsigned io_len) clear_highest_interrupt(& BX_PIC_THIS s.slave_pic); BX_PIC_THIS s.slave_pic.polled = 0; service_slave_pic(); - return BX_PIC_THIS s.slave_pic.irq; // Return the current irq requested + return io_len==1?BX_PIC_THIS s.slave_pic.irq:(BX_PIC_THIS s.slave_pic.irq)<<8|(BX_PIC_THIS s.slave_pic.irq); // Return the current irq requested } @@ -859,8 +859,12 @@ bx_pic_c::IAC(void) void bx_pic_c::show_pic_state(void) { -BX_INFO(("s.master_pic.imr = %02x", BX_PIC_THIS s.master_pic.imr)); -BX_INFO(("s.master_pic.isr = %02x", BX_PIC_THIS s.master_pic.isr)); -BX_INFO(("s.master_pic.irr = %02x", BX_PIC_THIS s.master_pic.irr)); -BX_INFO(("s.master_pic.irq = %02x", BX_PIC_THIS s.master_pic.irq)); +dbg_printf("s.master_pic.imr = %02x\n", BX_PIC_THIS s.master_pic.imr); +dbg_printf("s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr); +dbg_printf("s.master_pic.irr = %02x\n", BX_PIC_THIS s.master_pic.irr); +dbg_printf("s.master_pic.irq = %02x\n", BX_PIC_THIS s.master_pic.irq); +dbg_printf("s.slave_pic.imr = %02x\n", BX_PIC_THIS s.slave_pic.imr); +dbg_printf("s.slave_pic.isr = %02x\n", BX_PIC_THIS s.slave_pic.isr); +dbg_printf("s.slave_pic.irr = %02x\n", BX_PIC_THIS s.slave_pic.irr); +dbg_printf("s.slave_pic.irq = %02x\n", BX_PIC_THIS s.slave_pic.irq); } diff --git a/bochs/iodev/pic.h b/bochs/iodev/pic.h index 15eff7619..4fb821473 100644 --- a/bochs/iodev/pic.h +++ b/bochs/iodev/pic.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pic.h,v 1.10 2002-10-25 11:44:40 bdenney Exp $ +// $Id: pic.h,v 1.11 2003-08-04 16:03:09 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -76,6 +76,7 @@ public: virtual void lower_irq(unsigned irq_no); virtual void raise_irq(unsigned irq_no); virtual Bit8u IAC(void); + virtual void show_pic_state(void); private: struct { @@ -92,6 +93,5 @@ private: BX_PIC_SMF void service_master_pic(void); BX_PIC_SMF void service_slave_pic(void); - BX_PIC_SMF void show_pic_state(void); BX_PIC_SMF void clear_highest_interrupt(bx_pic_t *pic); }; diff --git a/bochs/main.cc b/bochs/main.cc index 0f1f1e32d..032190a71 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.231 2003-08-01 01:20:00 cbothamy Exp $ +// $Id: main.cc,v 1.232 2003-08-04 16:03:08 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -29,6 +29,10 @@ #include #include "state_file.h" +#ifdef HAVE_LOCALE_H +#include +#endif + #if BX_WITH_SDL // since SDL redefines main() to SDL_main(), we must include SDL.h so that the // C language prototype is found. Otherwise SDL_main() will get its name @@ -1525,6 +1529,10 @@ static void carbonFatalDialog(const char *error, const char *exposition) #endif int bxmain () { +#ifdef HAVE_LOCALE_H + // Initialize locale (for isprint() and other functions) + setlocale (LC_ALL, ""); +#endif bx_user_quit = 0; bx_init_siminterface (); // create the SIM object static jmp_buf context; @@ -1806,7 +1814,7 @@ bx_init_main (int argc, char *argv[]) // there is no stdin/stdout so disable the text-based config interface. SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START); char cwd[MAXPATHLEN]; - getwd (cwd); + getcwd (cwd); BX_INFO (("Now my working directory is %s", cwd)); // if it was started from command line, there could be some args still. for (int a=0; alower_irq(b)) #define DEV_pic_raise_irq(b) (bx_devices.pluginPicDevice->raise_irq(b)) #define DEV_pic_iac() (bx_devices.pluginPicDevice->IAC()) +#define DEV_pic_show_pic_state() (bx_devices.pluginPicDevice->show_pic_state()) ///////// VGA macros #define DEV_vga_mem_read(addr) (bx_devices.pluginVgaDevice->mem_read(addr))