mirror of https://github.com/bochs-emu/Bochs
Apply Vitaly's Vorobyov debugger patch
This commit is contained in:
parent
e42c4f6c8f
commit
45df735c30
|
@ -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.
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||||
|
@ -77,6 +77,7 @@ extern "C" {
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <limits.h>
|
||||||
#ifdef macintosh
|
#ifdef macintosh
|
||||||
# define SuperDrive "[fd:]"
|
# define SuperDrive "[fd:]"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -83,6 +83,9 @@
|
||||||
// adds support for the GNU readline library in the debugger command
|
// adds support for the GNU readline library in the debugger command
|
||||||
// prompt.
|
// prompt.
|
||||||
|
|
||||||
|
#define HAVE_LOCALE_H 0
|
||||||
|
// Define to 1 if you have <locale.h>
|
||||||
|
|
||||||
// I rebuilt the code which provides timers to IO devices.
|
// I rebuilt the code which provides timers to IO devices.
|
||||||
// Setting this to 1 will introduce a little code which
|
// Setting this to 1 will introduce a little code which
|
||||||
// will panic out if cases which shouldn't happen occur.
|
// 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
|
// set if your compiler does not allow label at the end of a {} block
|
||||||
#define BX_NO_BLANK_LABELS 0
|
#define BX_NO_BLANK_LABELS 0
|
||||||
|
|
||||||
// set if you don't have <hash_map.h>, used in debug/dbg_main.c
|
// set if you don't have <hash_map>, used in debug/dbg_main.c
|
||||||
#define BX_HAVE_HASH_MAP 0
|
#define BX_HAVE_HASH_MAP 0
|
||||||
|
|
||||||
|
// set if you don't have <hash_map.h>, used in debug/dbg_main.c
|
||||||
|
#define BX_HAVE_HASH_MAP_H 0
|
||||||
|
|
||||||
|
// set if you don't have <set>, used in debug/dbg_main.c
|
||||||
|
#define BX_HAVE_SET 0
|
||||||
|
|
||||||
|
// set if you don't have <set.h>, used in debug/dbg_main.c
|
||||||
|
#define BX_HAVE_SET_H 0
|
||||||
|
|
||||||
// Support x86 hardware debugger registers and facilites.
|
// Support x86 hardware debugger registers and facilites.
|
||||||
// These are the debug facilites offered by the x86 architecture,
|
// These are the debug facilites offered by the x86 architecture,
|
||||||
// not the optional built-in debugger.
|
// not the optional built-in debugger.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/sh
|
#! /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.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.53.
|
# 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
|
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
|
||||||
# absolute.
|
# absolute.
|
||||||
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
|
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_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
|
||||||
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_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_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||||
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
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 "$as_me:$LINENO: checking host system type" >&5
|
||||||
echo $ECHO_N "checking host system type... $ECHO_C" >&6
|
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_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||||
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
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 "$as_me:$LINENO: checking target system type" >&5
|
||||||
echo $ECHO_N "checking target system type... $ECHO_C" >&6
|
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" = \
|
test "$program_prefix$program_suffix$program_transform_name" = \
|
||||||
NONENONEs,x,x, &&
|
NONENONEs,x,x, &&
|
||||||
program_prefix=${target_alias}-
|
program_prefix=${target_alias}-
|
||||||
test -z "$target_alias" &&
|
|
||||||
target_alias=$ac_cv_target
|
|
||||||
|
|
||||||
|
|
||||||
if test "$with_win32_vcpp"; then
|
if test "$with_win32_vcpp"; then
|
||||||
echo "WARNING: The --with-win32-vcpp option will be treated as:"
|
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
|
case $host in
|
||||||
*-*-irix6*)
|
*-*-irix6*)
|
||||||
# Find out which ABI we are using.
|
# 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
|
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
(eval $ac_compile) 2>&5
|
(eval $ac_compile) 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
|
@ -4769,7 +4762,7 @@ chmod -w .
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
|
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
|
||||||
compiler_c_o=no
|
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
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings
|
# So say no if there are warnings
|
||||||
if test -s out/conftest.err; then
|
if test -s out/conftest.err; then
|
||||||
|
@ -6600,7 +6593,7 @@ else
|
||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6603 "configure"
|
#line 6596 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
|
@ -6698,7 +6691,7 @@ else
|
||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6701 "configure"
|
#line 6694 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
|
@ -8740,7 +8733,7 @@ else
|
||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 8743 "configure"
|
#line 8736 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
|
@ -15383,9 +15376,56 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking for hash_map" >&5
|
||||||
|
echo $ECHO_N "checking for hash_map... $ECHO_C" >&6
|
||||||
|
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
#line $LINENO "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
#include <hash_map>
|
||||||
|
#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 "$as_me:$LINENO: checking for hash_map.h" >&5
|
||||||
echo $ECHO_N "checking for hash_map.h... $ECHO_C" >&6
|
echo $ECHO_N "checking for hash_map.h... $ECHO_C" >&6
|
||||||
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
#line $LINENO "configure"
|
#line $LINENO "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
@ -15420,7 +15460,101 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
echo "$as_me:$LINENO: result: yes" >&5
|
echo "$as_me:$LINENO: result: yes" >&5
|
||||||
echo "${ECHO_T}yes" >&6
|
echo "${ECHO_T}yes" >&6
|
||||||
cat >>confdefs.h <<\_ACEOF
|
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 <set>
|
||||||
|
#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 <set.h>
|
||||||
|
#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
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
@ -24381,7 +24515,7 @@ esac
|
||||||
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
|
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
|
||||||
# absolute.
|
# absolute.
|
||||||
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
|
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_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
|
||||||
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
|
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ(2.50)
|
AC_PREREQ(2.50)
|
||||||
AC_INIT(bochs.h)
|
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(config.h)
|
||||||
AC_CONFIG_HEADER(ltdlconf.h)
|
AC_CONFIG_HEADER(ltdlconf.h)
|
||||||
|
|
||||||
|
@ -248,11 +248,29 @@ AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
|
||||||
|
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_MSG_CHECKING(for hash_map)
|
||||||
|
AC_TRY_COMPILE([#include <hash_map>], [],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(BX_HAVE_HASH_MAP)
|
||||||
|
], AC_MSG_RESULT(no))
|
||||||
AC_MSG_CHECKING(for hash_map.h)
|
AC_MSG_CHECKING(for hash_map.h)
|
||||||
AC_TRY_COMPILE([#include <hash_map.h>], [],
|
AC_TRY_COMPILE([#include <hash_map.h>], [],
|
||||||
[
|
[
|
||||||
AC_MSG_RESULT(yes)
|
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 <set>], [],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(BX_HAVE_SET)
|
||||||
|
], AC_MSG_RESULT(no))
|
||||||
|
AC_MSG_CHECKING(for set.h)
|
||||||
|
AC_TRY_COMPILE([#include <set.h>], [],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(BX_HAVE_SET_H)
|
||||||
], AC_MSG_RESULT(no))
|
], AC_MSG_RESULT(no))
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -672,8 +672,8 @@ BX_CPU_C::handleAsyncEvent(void)
|
||||||
if ( (dr6_bits = hwdebug_compare(iaddr, 1, BX_HWDebugInstruction,
|
if ( (dr6_bits = hwdebug_compare(iaddr, 1, BX_HWDebugInstruction,
|
||||||
BX_HWDebugInstruction)) ) {
|
BX_HWDebugInstruction)) ) {
|
||||||
// Add to the list of debug events thus far.
|
// 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 async_event = 1;
|
||||||
|
BX_CPU_THIS_PTR debug_trap |= dr6_bits;
|
||||||
// If debug events are not inhibited on this boundary,
|
// If debug events are not inhibited on this boundary,
|
||||||
// fire off a debug fault. Otherwise handle it on the next
|
// fire off a debug fault. Otherwise handle it on the next
|
||||||
// boundary. (becomes a trap)
|
// boundary. (becomes a trap)
|
||||||
|
@ -695,7 +695,11 @@ BX_CPU_C::handleAsyncEvent(void)
|
||||||
if ( !(BX_CPU_INTR ||
|
if ( !(BX_CPU_INTR ||
|
||||||
BX_CPU_THIS_PTR debug_trap ||
|
BX_CPU_THIS_PTR debug_trap ||
|
||||||
BX_HRQ ||
|
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;
|
BX_CPU_THIS_PTR async_event = 0;
|
||||||
|
|
||||||
return 0; // Continue executing cpu_loop.
|
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 eipPageBias = - eipPageOffset0;
|
||||||
BX_CPU_THIS_PTR eipPageWindowSize = 4096; // FIXME:
|
BX_CPU_THIS_PTR eipPageWindowSize = 4096; // FIXME:
|
||||||
BX_CPU_THIS_PTR pAddrA20Page = pAddr & 0xfffff000;
|
BX_CPU_THIS_PTR pAddrA20Page = pAddr & 0xfffff000;
|
||||||
BX_CPU_THIS_PTR eipFetchPtr =
|
BX_CPU_THIS_PTR eipFetchPtr=BX_CPU_THIS_PTR mem->getHostMemAddr(this, BX_CPU_THIS_PTR pAddrA20Page,
|
||||||
BX_CPU_THIS_PTR mem->getHostMemAddr(this, BX_CPU_THIS_PTR pAddrA20Page,
|
|
||||||
BX_READ);
|
BX_READ);
|
||||||
|
|
||||||
// Sanity checks
|
// 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_guard.guard_for & BX_DBG_GUARD_IADDR_VIR) {
|
||||||
if (BX_CPU_THIS_PTR guard_found.icount!=0) {
|
if (BX_CPU_THIS_PTR guard_found.icount!=0) {
|
||||||
for (unsigned i=0; i<bx_guard.iaddr.num_virtual; i++) {
|
for (unsigned i=0; i<bx_guard.iaddr.num_virtual; i++) {
|
||||||
if ( (bx_guard.iaddr.vir[i].cs == cs) &&
|
if ( bx_guard.iaddr.vir[i].enabled &&
|
||||||
|
(bx_guard.iaddr.vir[i].cs == cs) &&
|
||||||
(bx_guard.iaddr.vir[i].eip == eip) ) {
|
(bx_guard.iaddr.vir[i].eip == eip) ) {
|
||||||
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_VIR;
|
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_VIR;
|
||||||
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
||||||
|
@ -935,7 +939,8 @@ BX_CPU_C::dbg_is_begin_instr_bpoint(Bit32u cs, Bit32u eip, Bit32u laddr,
|
||||||
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_LIN) {
|
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_LIN) {
|
||||||
if (BX_CPU_THIS_PTR guard_found.icount!=0) {
|
if (BX_CPU_THIS_PTR guard_found.icount!=0) {
|
||||||
for (unsigned i=0; i<bx_guard.iaddr.num_linear; i++) {
|
for (unsigned i=0; i<bx_guard.iaddr.num_linear; i++) {
|
||||||
if ( bx_guard.iaddr.lin[i].addr == BX_CPU_THIS_PTR guard_found.laddr ) {
|
if (bx_guard.iaddr.lin[i].enabled &&
|
||||||
|
(bx_guard.iaddr.lin[i].addr == BX_CPU_THIS_PTR guard_found.laddr) ) {
|
||||||
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_LIN;
|
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_LIN;
|
||||||
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
||||||
return(1); // on a breakpoint
|
return(1); // on a breakpoint
|
||||||
|
@ -956,7 +961,8 @@ BX_CPU_C::dbg_is_begin_instr_bpoint(Bit32u cs, Bit32u eip, Bit32u laddr,
|
||||||
// Not pretty.
|
// Not pretty.
|
||||||
if (valid && (BX_CPU_THIS_PTR guard_found.icount!=0)) {
|
if (valid && (BX_CPU_THIS_PTR guard_found.icount!=0)) {
|
||||||
for (unsigned i=0; i<bx_guard.iaddr.num_physical; i++) {
|
for (unsigned i=0; i<bx_guard.iaddr.num_physical; i++) {
|
||||||
if ( bx_guard.iaddr.phy[i].addr == phy ) {
|
if ( bx_guard.iaddr.phy[i].enabled &&
|
||||||
|
(bx_guard.iaddr.phy[i].addr == phy) ) {
|
||||||
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_PHY;
|
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_PHY;
|
||||||
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
|
||||||
return(1); // on a breakpoint
|
return(1); // on a breakpoint
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: debugstuff.cc,v 1.28 2002-10-27 15:15:12 bdenney Exp $
|
// $Id: debugstuff.cc,v 1.29 2003-08-04 16:03:09 akrisak Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -147,17 +147,25 @@ BX_CPU_C::debug(Bit32u offset)
|
||||||
|
|
||||||
#if BX_DISASM
|
#if BX_DISASM
|
||||||
bx_bool valid;
|
bx_bool valid;
|
||||||
Bit32u phy_addr;
|
Bit32u phy_addr, Base;
|
||||||
Bit8u instr_buf[32];
|
Bit8u instr_buf[32];
|
||||||
char char_buf[256];
|
char char_buf[256];
|
||||||
unsigned isize;
|
unsigned isize;
|
||||||
|
|
||||||
|
if (BX_CPU(which_cpu)->protectedMode) { // 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,
|
dbg_xlate_linear2phy(BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.base + offset,
|
||||||
&phy_addr, &valid);
|
&phy_addr, &valid);
|
||||||
if (valid && BX_CPU_THIS_PTR mem!=NULL) {
|
if (valid && BX_CPU_THIS_PTR mem!=NULL) {
|
||||||
BX_CPU_THIS_PTR mem->dbg_fetch_mem(phy_addr, 16, instr_buf);
|
BX_CPU_THIS_PTR mem->dbg_fetch_mem(phy_addr, 16, instr_buf);
|
||||||
isize = bx_disassemble.disasm(
|
isize = bx_disassemble.disasm(
|
||||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b,
|
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b,
|
||||||
|
Base,
|
||||||
EIP, instr_buf, char_buf);
|
EIP, instr_buf, char_buf);
|
||||||
for (unsigned j=0; j<isize; j++)
|
for (unsigned j=0; j<isize; j++)
|
||||||
BX_INFO((">> %02x", (unsigned) instr_buf[j]));
|
BX_INFO((">> %02x", (unsigned) instr_buf[j]));
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -56,6 +56,24 @@ unsigned long crc32(unsigned char *buf, int len);
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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
|
// Flex defs
|
||||||
extern int bxlex(void);
|
extern int bxlex(void);
|
||||||
extern char *bxtext; // Using the pointer option rather than array
|
extern char *bxtext; // Using the pointer option rather than array
|
||||||
|
@ -72,8 +90,15 @@ typedef struct {
|
||||||
} bx_num_range;
|
} bx_num_range;
|
||||||
#define EMPTY_ARG (-1)
|
#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);
|
bx_num_range make_num_range (Bit64s from, Bit64s to);
|
||||||
char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base);
|
char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base);
|
||||||
|
char* bx_dbg_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_symbol_command(char* filename, bx_bool global, Bit32u offset);
|
||||||
void bx_dbg_trace_on_command(void);
|
void bx_dbg_trace_on_command(void);
|
||||||
void bx_dbg_trace_off_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_where_command(void);
|
||||||
void bx_dbg_print_string_command(Bit32u addr);
|
void bx_dbg_print_string_command(Bit32u addr);
|
||||||
void bx_dbg_show_command(char*); /* BW */
|
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_print_stack_command(int nwords);
|
||||||
void bx_dbg_watch(int read, Bit32u address);
|
void bx_dbg_watch(int read, Bit32u address);
|
||||||
void bx_dbg_unwatch(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_stepN_command(bx_dbg_icount_t count);
|
||||||
void bx_dbg_set_command(char *p1, char *p2, char *p3);
|
void bx_dbg_set_command(char *p1, char *p2, char *p3);
|
||||||
void bx_dbg_del_breakpoint_command(unsigned handle);
|
void bx_dbg_del_breakpoint_command(unsigned handle);
|
||||||
void bx_dbg_vbreakpoint_command(bx_bool specific, Bit32u cs, Bit32u eip);
|
void bx_dbg_en_dis_breakpoint_command(unsigned handle, bx_bool enable);
|
||||||
void bx_dbg_lbreakpoint_command(bx_bool specific, Bit32u laddress);
|
bx_bool bx_dbg_en_dis_pbreak (unsigned handle, bx_bool enable);
|
||||||
void bx_dbg_pbreakpoint_command(bx_bool specific, Bit32u paddress);
|
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_info_bpoints_command(void);
|
||||||
void bx_dbg_quit_command(void);
|
void bx_dbg_quit_command(void);
|
||||||
void bx_dbg_info_program_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_ldt_command(bx_num_range);
|
||||||
void bx_dbg_info_tss_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_control_regs_command(void);
|
||||||
|
void bx_dbg_info_flags(void);
|
||||||
void bx_dbg_info_linux_command(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,
|
void bx_dbg_examine_command(char *command, char *format, bx_bool format_passed,
|
||||||
Bit32u addr, bx_bool addr_passed, int simulator);
|
Bit32u addr, bx_bool addr_passed, int simulator);
|
||||||
void bx_dbg_setpmem_command(Bit32u addr, unsigned len, Bit32u val);
|
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_take_command(char *, unsigned n);
|
||||||
void bx_dbg_dump_cpu_command(void);
|
void bx_dbg_dump_cpu_command(void);
|
||||||
void bx_dbg_set_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_instrument_command(char *);
|
||||||
void bx_dbg_loader_command(char *);
|
void bx_dbg_loader_command(char *);
|
||||||
void bx_dbg_doit_command(unsigned);
|
void bx_dbg_doit_command(unsigned);
|
||||||
void bx_dbg_crc_command(Bit32u addr1, Bit32u addr2);
|
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;
|
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_ne2k(int page, int reg);
|
||||||
|
void bx_dbg_info_pic(void);
|
||||||
void bx_dbg_help_command(char* command);
|
void bx_dbg_help_command(char* command);
|
||||||
|
void bx_dbg_calc_command(Bit64u value);
|
||||||
void bx_dbg_info_ivt_command(bx_num_range);
|
void bx_dbg_info_ivt_command(bx_num_range);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -235,6 +269,7 @@ typedef struct {
|
||||||
Bit32u cs; // only use 16 bits
|
Bit32u cs; // only use 16 bits
|
||||||
Bit32u eip;
|
Bit32u eip;
|
||||||
unsigned bpoint_id;
|
unsigned bpoint_id;
|
||||||
|
bx_bool enabled;
|
||||||
} vir[BX_DBG_MAX_VIR_BPOINTS];
|
} vir[BX_DBG_MAX_VIR_BPOINTS];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -243,6 +278,7 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
Bit32u addr;
|
Bit32u addr;
|
||||||
unsigned bpoint_id;
|
unsigned bpoint_id;
|
||||||
|
bx_bool enabled;
|
||||||
} lin[BX_DBG_MAX_LIN_BPOINTS];
|
} lin[BX_DBG_MAX_LIN_BPOINTS];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -251,6 +287,7 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
Bit32u addr;
|
Bit32u addr;
|
||||||
unsigned bpoint_id;
|
unsigned bpoint_id;
|
||||||
|
bx_bool enabled;
|
||||||
} phy[BX_DBG_MAX_PHY_BPOINTS];
|
} phy[BX_DBG_MAX_PHY_BPOINTS];
|
||||||
#endif
|
#endif
|
||||||
} iaddr;
|
} iaddr;
|
||||||
|
|
1232
bochs/debug/lexer.c
1232
bochs/debug/lexer.c
File diff suppressed because it is too large
Load Diff
|
@ -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 <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -19,28 +19,34 @@ static char *lex_input_ptr = NULL;
|
||||||
static unsigned lex_input_size = 0;
|
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); }
|
set { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET); }
|
||||||
dis { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIS); }
|
dis { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIS); }
|
||||||
on { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ON); }
|
on { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ON); }
|
||||||
off { bxlval.sval = strdup(bxtext); return(BX_TOKEN_OFF); }
|
off { bxlval.sval = strdup(bxtext); return(BX_TOKEN_OFF); }
|
||||||
crc { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CRC); }
|
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 |
|
stepi |
|
||||||
step |
|
step |
|
||||||
si |
|
|
||||||
s { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STEPN); }
|
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); }
|
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); }
|
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); }
|
pbreak { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PBREAKPOINT); }
|
||||||
info { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INFO); }
|
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); }
|
program { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PROGRAM); }
|
||||||
cr |
|
cr |
|
||||||
creg |
|
creg |
|
||||||
|
@ -49,6 +55,7 @@ r |
|
||||||
reg |
|
reg |
|
||||||
registers { bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGISTERS); }
|
registers { bxlval.sval = strdup(bxtext); return(BX_TOKEN_REGISTERS); }
|
||||||
fpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FPU); }
|
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); }
|
all { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ALL); }
|
||||||
idt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); }
|
idt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IDT); }
|
||||||
ivt { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IVT); }
|
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); }
|
dirty { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DIRTY); }
|
||||||
linux { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LINUX); }
|
linux { bxlval.sval = strdup(bxtext); return(BX_TOKEN_LINUX); }
|
||||||
dump_cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DUMP_CPU); }
|
dump_cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DUMP_CPU); }
|
||||||
delete { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); }
|
delete |
|
||||||
del { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); }
|
del |
|
||||||
d { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DEL_BREAKPOINT); }
|
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); }
|
q { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUIT); }
|
||||||
x { bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); }
|
x |
|
||||||
xp { bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); }
|
xp { BEGIN(EXAMINE); bxlval.sval = strdup(bxtext); return(BX_TOKEN_EXAMINE); }
|
||||||
setpmem { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SETPMEM); }
|
setpmem { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SETPMEM); }
|
||||||
query { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUERY); }
|
query { bxlval.sval = strdup(bxtext); return(BX_TOKEN_QUERY); }
|
||||||
pending { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PENDING); }
|
pending { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PENDING); }
|
||||||
take { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TAKE); }
|
take { bxlval.sval = strdup(bxtext); return(BX_TOKEN_TAKE); }
|
||||||
dma { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DMA); }
|
dma { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DMA); }
|
||||||
irq { bxlval.sval = strdup(bxtext); return(BX_TOKEN_IRQ); }
|
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); }
|
set_cpu { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SET_CPU); }
|
||||||
|
u |
|
||||||
disas |
|
disas |
|
||||||
disassemble { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DISASSEMBLE); }
|
disassemble { BEGIN(DISASM); 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); }
|
|
||||||
instrument { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INSTRUMENT); }
|
instrument { bxlval.sval = strdup(bxtext); return(BX_TOKEN_INSTRUMENT); }
|
||||||
start { bxlval.sval = strdup(bxtext); return(BX_TOKEN_START); }
|
start { bxlval.sval = strdup(bxtext); return(BX_TOKEN_START); }
|
||||||
stop { bxlval.sval = strdup(bxtext); return(BX_TOKEN_STOP); }
|
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); }
|
continue { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CONTINUE); }
|
||||||
show { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SHOW); }
|
show { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SHOW); }
|
||||||
load-symbols { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SYMBOL); }
|
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); }
|
global { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GLOBAL); }
|
||||||
where { bxlval.sval = strdup(bxtext); return(BX_TOKEN_WHERE); }
|
where { bxlval.sval = strdup(bxtext); return(BX_TOKEN_WHERE); }
|
||||||
print-string { bxlval.sval = strdup(bxtext); return(BX_TOKEN_PRINT_STRING); }
|
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); }
|
ne2k { bxlval.sval = strdup(bxtext); return(BX_TOKEN_NE2000); }
|
||||||
ne2000 { 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); }
|
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); }
|
cs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CS); }
|
||||||
es { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ES); }
|
es { bxlval.sval = strdup(bxtext); return(BX_TOKEN_ES); }
|
||||||
ss { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SS); }
|
ss { bxlval.sval = strdup(bxtext); return(BX_TOKEN_SS); }
|
||||||
ds { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DS); }
|
ds { bxlval.sval = strdup(bxtext); return(BX_TOKEN_DS); }
|
||||||
fs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); }
|
fs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_FS); }
|
||||||
gs { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GS); }
|
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); }
|
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); }
|
help { bxlval.sval = strdup(bxtext); return(BX_TOKEN_HELP); }
|
||||||
|
\? |
|
||||||
|
calc { bxlval.sval = strdup(bxtext); return(BX_TOKEN_CALC); }
|
||||||
|
<EXAMINE>\/[0-9]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); }
|
||||||
|
<EXAMINE>\/[0-9]*[mxduotcsibhwg]+ { BEGIN(INITIAL); bxlval.sval = strdup(bxtext); return(BX_TOKEN_XFORMAT); }
|
||||||
|
<DISASM>\/[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); }
|
\"[^\"\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); }
|
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[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]+L { bxlval.ulval = strtoull(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); }
|
||||||
[0-9]+ { bxlval.uval = strtoul(bxtext, NULL, 10); return(BX_TOKEN_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); }
|
$[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 '//'
|
[#][^\n]* ; // eat up comments '//'
|
||||||
. { return(bxtext[0]); }
|
. { return(bxtext[0]); }
|
||||||
|
<EXAMINE,DISASM>. { BEGIN(INITIAL); unput(*bxtext); }
|
||||||
%%
|
%%
|
||||||
|
|
||||||
// [A-Za-z_][A-Za-z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GENERIC); }
|
// [A-Za-z_][A-Za-z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GENERIC); }
|
||||||
|
|
2035
bochs/debug/parser.c
2035
bochs/debug/parser.c
File diff suppressed because it is too large
Load Diff
|
@ -2,101 +2,137 @@
|
||||||
#define YYERRCODE 256
|
#define YYERRCODE 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BX_TOKEN_CONTINUE 257
|
#define BX_TOKEN_REG_AL 257
|
||||||
#define BX_TOKEN_STEPN 258
|
#define BX_TOKEN_REG_BL 258
|
||||||
#define BX_TOKEN_NEXT_STEP 259
|
#define BX_TOKEN_REG_CL 259
|
||||||
#define BX_TOKEN_SET 260
|
#define BX_TOKEN_REG_DL 260
|
||||||
#define BX_TOKEN_DEBUGGER 261
|
#define BX_TOKEN_REG_AH 261
|
||||||
#define BX_TOKEN_VBREAKPOINT 262
|
#define BX_TOKEN_REG_BH 262
|
||||||
#define BX_TOKEN_LBREAKPOINT 263
|
#define BX_TOKEN_REG_CH 263
|
||||||
#define BX_TOKEN_PBREAKPOINT 264
|
#define BX_TOKEN_REG_DH 264
|
||||||
#define BX_TOKEN_DEL_BREAKPOINT 265
|
#define BX_TOKEN_REG_AX 265
|
||||||
#define BX_TOKEN_INFO 266
|
#define BX_TOKEN_REG_BX 266
|
||||||
#define BX_TOKEN_QUIT 267
|
#define BX_TOKEN_REG_CX 267
|
||||||
#define BX_TOKEN_PROGRAM 268
|
#define BX_TOKEN_REG_DX 268
|
||||||
#define BX_TOKEN_REGISTERS 269
|
#define BX_TOKEN_REG_EAX 269
|
||||||
#define BX_TOKEN_FPU 270
|
#define BX_TOKEN_REG_EBX 270
|
||||||
#define BX_TOKEN_ALL 271
|
#define BX_TOKEN_REG_ECX 271
|
||||||
#define BX_TOKEN_IDT 272
|
#define BX_TOKEN_REG_EDX 272
|
||||||
#define BX_TOKEN_GDT 273
|
#define BX_TOKEN_REG_SI 273
|
||||||
#define BX_TOKEN_LDT 274
|
#define BX_TOKEN_REG_DI 274
|
||||||
#define BX_TOKEN_TSS 275
|
#define BX_TOKEN_REG_BP 275
|
||||||
#define BX_TOKEN_DIRTY 276
|
#define BX_TOKEN_REG_SP 276
|
||||||
#define BX_TOKEN_LINUX 277
|
#define BX_TOKEN_REG_IP 277
|
||||||
#define BX_TOKEN_CONTROL_REGS 278
|
#define BX_TOKEN_REG_ESI 278
|
||||||
#define BX_TOKEN_EXAMINE 279
|
#define BX_TOKEN_REG_EDI 279
|
||||||
#define BX_TOKEN_XFORMAT 280
|
#define BX_TOKEN_REG_EBP 280
|
||||||
#define BX_TOKEN_SETPMEM 281
|
#define BX_TOKEN_REG_ESP 281
|
||||||
#define BX_TOKEN_SYMBOLNAME 282
|
#define BX_TOKEN_REG_EIP 282
|
||||||
#define BX_TOKEN_QUERY 283
|
#define BX_TOKEN_CONTINUE 283
|
||||||
#define BX_TOKEN_PENDING 284
|
#define BX_TOKEN_STEPN 284
|
||||||
#define BX_TOKEN_TAKE 285
|
#define BX_TOKEN_STEP_OVER 285
|
||||||
#define BX_TOKEN_DMA 286
|
#define BX_TOKEN_NEXT_STEP 286
|
||||||
#define BX_TOKEN_IRQ 287
|
#define BX_TOKEN_SET 287
|
||||||
#define BX_TOKEN_DUMP_CPU 288
|
#define BX_TOKEN_DEBUGGER 288
|
||||||
#define BX_TOKEN_SET_CPU 289
|
#define BX_TOKEN_LIST_BREAK 289
|
||||||
#define BX_TOKEN_DIS 290
|
#define BX_TOKEN_VBREAKPOINT 290
|
||||||
#define BX_TOKEN_ON 291
|
#define BX_TOKEN_LBREAKPOINT 291
|
||||||
#define BX_TOKEN_OFF 292
|
#define BX_TOKEN_PBREAKPOINT 292
|
||||||
#define BX_TOKEN_DISASSEMBLE 293
|
#define BX_TOKEN_DEL_BREAKPOINT 293
|
||||||
#define BX_TOKEN_INSTRUMENT 294
|
#define BX_TOKEN_ENABLE_BREAKPOINT 294
|
||||||
#define BX_TOKEN_START 295
|
#define BX_TOKEN_DISABLE_BREAKPOINT 295
|
||||||
#define BX_TOKEN_STOP 296
|
#define BX_TOKEN_INFO 296
|
||||||
#define BX_TOKEN_RESET 297
|
#define BX_TOKEN_QUIT 297
|
||||||
#define BX_TOKEN_PRINT 298
|
#define BX_TOKEN_PROGRAM 298
|
||||||
#define BX_TOKEN_LOADER 299
|
#define BX_TOKEN_REGISTERS 299
|
||||||
#define BX_TOKEN_STRING 300
|
#define BX_TOKEN_CPU 300
|
||||||
#define BX_TOKEN_DOIT 301
|
#define BX_TOKEN_FPU 301
|
||||||
#define BX_TOKEN_CRC 302
|
#define BX_TOKEN_ALL 302
|
||||||
#define BX_TOKEN_TRACEON 303
|
#define BX_TOKEN_IDT 303
|
||||||
#define BX_TOKEN_TRACEOFF 304
|
#define BX_TOKEN_GDT 304
|
||||||
#define BX_TOKEN_PTIME 305
|
#define BX_TOKEN_LDT 305
|
||||||
#define BX_TOKEN_TIMEBP_ABSOLUTE 306
|
#define BX_TOKEN_TSS 306
|
||||||
#define BX_TOKEN_TIMEBP 307
|
#define BX_TOKEN_DIRTY 307
|
||||||
#define BX_TOKEN_RECORD 308
|
#define BX_TOKEN_LINUX 308
|
||||||
#define BX_TOKEN_PLAYBACK 309
|
#define BX_TOKEN_CONTROL_REGS 309
|
||||||
#define BX_TOKEN_MODEBP 310
|
#define BX_TOKEN_EXAMINE 310
|
||||||
#define BX_TOKEN_PRINT_STACK 311
|
#define BX_TOKEN_XFORMAT 311
|
||||||
#define BX_TOKEN_WATCH 312
|
#define BX_TOKEN_DISFORMAT 312
|
||||||
#define BX_TOKEN_UNWATCH 313
|
#define BX_TOKEN_SETPMEM 313
|
||||||
#define BX_TOKEN_READ 314
|
#define BX_TOKEN_SYMBOLNAME 314
|
||||||
#define BX_TOKEN_WRITE 315
|
#define BX_TOKEN_QUERY 315
|
||||||
#define BX_TOKEN_SHOW 316
|
#define BX_TOKEN_PENDING 316
|
||||||
#define BX_TOKEN_SYMBOL 317
|
#define BX_TOKEN_TAKE 317
|
||||||
#define BX_TOKEN_GLOBAL 318
|
#define BX_TOKEN_DMA 318
|
||||||
#define BX_TOKEN_WHERE 319
|
#define BX_TOKEN_IRQ 319
|
||||||
#define BX_TOKEN_PRINT_STRING 320
|
#define BX_TOKEN_DUMP_CPU 320
|
||||||
#define BX_TOKEN_DIFF_MEMORY 321
|
#define BX_TOKEN_SET_CPU 321
|
||||||
#define BX_TOKEN_SYNC_MEMORY 322
|
#define BX_TOKEN_DIS 322
|
||||||
#define BX_TOKEN_SYNC_CPU 323
|
#define BX_TOKEN_ON 323
|
||||||
#define BX_TOKEN_FAST_FORWARD 324
|
#define BX_TOKEN_OFF 324
|
||||||
#define BX_TOKEN_PHY_2_LOG 325
|
#define BX_TOKEN_DISASSEMBLE 325
|
||||||
#define BX_TOKEN_NUMERIC 326
|
#define BX_TOKEN_INSTRUMENT 326
|
||||||
#define BX_TOKEN_LONG_NUMERIC 327
|
#define BX_TOKEN_START 327
|
||||||
#define BX_TOKEN_INFO_ADDRESS 328
|
#define BX_TOKEN_STOP 328
|
||||||
#define BX_TOKEN_NE2000 329
|
#define BX_TOKEN_RESET 329
|
||||||
#define BX_TOKEN_PAGE 330
|
#define BX_TOKEN_PRINT 330
|
||||||
#define BX_TOKEN_CS 331
|
#define BX_TOKEN_LOADER 331
|
||||||
#define BX_TOKEN_ES 332
|
#define BX_TOKEN_STRING 332
|
||||||
#define BX_TOKEN_SS 333
|
#define BX_TOKEN_DOIT 333
|
||||||
#define BX_TOKEN_DS 334
|
#define BX_TOKEN_CRC 334
|
||||||
#define BX_TOKEN_FS 335
|
#define BX_TOKEN_TRACEON 335
|
||||||
#define BX_TOKEN_GS 336
|
#define BX_TOKEN_TRACEOFF 336
|
||||||
#define BX_TOKEN_ALWAYS_CHECK 337
|
#define BX_TOKEN_PTIME 337
|
||||||
#define BX_TOKEN_MATHS 338
|
#define BX_TOKEN_TIMEBP_ABSOLUTE 338
|
||||||
#define BX_TOKEN_ADD 339
|
#define BX_TOKEN_TIMEBP 339
|
||||||
#define BX_TOKEN_SUB 340
|
#define BX_TOKEN_RECORD 340
|
||||||
#define BX_TOKEN_MUL 341
|
#define BX_TOKEN_PLAYBACK 341
|
||||||
#define BX_TOKEN_DIV 342
|
#define BX_TOKEN_MODEBP 342
|
||||||
#define BX_TOKEN_V2L 343
|
#define BX_TOKEN_PRINT_STACK 343
|
||||||
#define BX_TOKEN_TRACEREGON 344
|
#define BX_TOKEN_WATCH 344
|
||||||
#define BX_TOKEN_TRACEREGOFF 345
|
#define BX_TOKEN_UNWATCH 345
|
||||||
#define BX_TOKEN_HELP 346
|
#define BX_TOKEN_READ 346
|
||||||
#define BX_TOKEN_IVT 347
|
#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 {
|
typedef union {
|
||||||
char *sval;
|
char *sval;
|
||||||
Bit32u uval;
|
Bit32u uval;
|
||||||
Bit64u ulval;
|
Bit64u ulval;
|
||||||
bx_num_range uval_range;
|
bx_num_range uval_range;
|
||||||
|
Regs reg;
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
extern YYSTYPE bxlval;
|
extern YYSTYPE bxlval;
|
||||||
|
|
|
@ -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"
|
#include "debug.h"
|
||||||
|
|
||||||
#if BX_DEBUGGER
|
#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 '-' '+'
|
||||||
// %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;
|
Bit32u uval;
|
||||||
Bit64u ulval;
|
Bit64u ulval;
|
||||||
bx_num_range uval_range;
|
bx_num_range uval_range;
|
||||||
|
Regs reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Common registers
|
||||||
|
%type<reg> BX_TOKEN_COMMON_REG
|
||||||
|
%type<reg> BX_TOKEN_INDEX_REG
|
||||||
|
%type<reg> BX_TOKEN_PTR_REG
|
||||||
|
%type<reg> BX_TOKEN_NONSEG_REG
|
||||||
|
%token<reg> BX_TOKEN_REG_AL
|
||||||
|
%token<reg> BX_TOKEN_REG_BL
|
||||||
|
%token<reg> BX_TOKEN_REG_CL
|
||||||
|
%token<reg> BX_TOKEN_REG_DL
|
||||||
|
%token<reg> BX_TOKEN_REG_AH
|
||||||
|
%token<reg> BX_TOKEN_REG_BH
|
||||||
|
%token<reg> BX_TOKEN_REG_CH
|
||||||
|
%token<reg> BX_TOKEN_REG_DH
|
||||||
|
%token<reg> BX_TOKEN_REG_AX
|
||||||
|
%token<reg> BX_TOKEN_REG_BX
|
||||||
|
%token<reg> BX_TOKEN_REG_CX
|
||||||
|
%token<reg> BX_TOKEN_REG_DX
|
||||||
|
%token<reg> BX_TOKEN_REG_EAX
|
||||||
|
%token<reg> BX_TOKEN_REG_EBX
|
||||||
|
%token<reg> BX_TOKEN_REG_ECX
|
||||||
|
%token<reg> BX_TOKEN_REG_EDX
|
||||||
|
%token<reg> BX_TOKEN_REG_SI
|
||||||
|
%token<reg> BX_TOKEN_REG_DI
|
||||||
|
%token<reg> BX_TOKEN_REG_BP
|
||||||
|
%token<reg> BX_TOKEN_REG_SP
|
||||||
|
%token<reg> BX_TOKEN_REG_IP
|
||||||
|
%token<reg> BX_TOKEN_REG_ESI
|
||||||
|
%token<reg> BX_TOKEN_REG_EDI
|
||||||
|
%token<reg> BX_TOKEN_REG_EBP
|
||||||
|
%token<reg> BX_TOKEN_REG_ESP
|
||||||
|
%token<reg> BX_TOKEN_REG_EIP
|
||||||
|
|
||||||
%token <sval> BX_TOKEN_CONTINUE
|
%token <sval> BX_TOKEN_CONTINUE
|
||||||
%token <sval> BX_TOKEN_STEPN
|
%token <sval> BX_TOKEN_STEPN
|
||||||
|
%token <sval> BX_TOKEN_STEP_OVER
|
||||||
%token <sval> BX_TOKEN_NEXT_STEP
|
%token <sval> BX_TOKEN_NEXT_STEP
|
||||||
%token <sval> BX_TOKEN_SET
|
%token <sval> BX_TOKEN_SET
|
||||||
%token <sval> BX_TOKEN_DEBUGGER
|
%token <sval> BX_TOKEN_DEBUGGER
|
||||||
|
%token <sval> BX_TOKEN_LIST_BREAK
|
||||||
%token <sval> BX_TOKEN_VBREAKPOINT
|
%token <sval> BX_TOKEN_VBREAKPOINT
|
||||||
%token <sval> BX_TOKEN_LBREAKPOINT
|
%token <sval> BX_TOKEN_LBREAKPOINT
|
||||||
%token <sval> BX_TOKEN_PBREAKPOINT
|
%token <sval> BX_TOKEN_PBREAKPOINT
|
||||||
%token <sval> BX_TOKEN_DEL_BREAKPOINT
|
%token <sval> BX_TOKEN_DEL_BREAKPOINT
|
||||||
|
%token <sval> BX_TOKEN_ENABLE_BREAKPOINT
|
||||||
|
%token <sval> BX_TOKEN_DISABLE_BREAKPOINT
|
||||||
%token <sval> BX_TOKEN_INFO
|
%token <sval> BX_TOKEN_INFO
|
||||||
%token <sval> BX_TOKEN_QUIT
|
%token <sval> BX_TOKEN_QUIT
|
||||||
%token <sval> BX_TOKEN_PROGRAM
|
%token <sval> BX_TOKEN_PROGRAM
|
||||||
%token <sval> BX_TOKEN_REGISTERS
|
%token <sval> BX_TOKEN_REGISTERS
|
||||||
|
%token <sval> BX_TOKEN_CPU
|
||||||
%token <sval> BX_TOKEN_FPU
|
%token <sval> BX_TOKEN_FPU
|
||||||
%token <sval> BX_TOKEN_ALL
|
%token <sval> BX_TOKEN_ALL
|
||||||
%token <sval> BX_TOKEN_IDT
|
%token <sval> 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 <sval> BX_TOKEN_CONTROL_REGS
|
%token <sval> BX_TOKEN_CONTROL_REGS
|
||||||
%token <sval> BX_TOKEN_EXAMINE
|
%token <sval> BX_TOKEN_EXAMINE
|
||||||
%token <sval> BX_TOKEN_XFORMAT
|
%token <sval> BX_TOKEN_XFORMAT
|
||||||
|
%token <sval> BX_TOKEN_DISFORMAT
|
||||||
%token <sval> BX_TOKEN_SETPMEM
|
%token <sval> BX_TOKEN_SETPMEM
|
||||||
%token <sval> BX_TOKEN_SYMBOLNAME
|
%token <sval> BX_TOKEN_SYMBOLNAME
|
||||||
%token <sval> BX_TOKEN_QUERY
|
%token <sval> 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 <sval> BX_TOKEN_WRITE
|
%token <sval> BX_TOKEN_WRITE
|
||||||
%token <sval> BX_TOKEN_SHOW
|
%token <sval> BX_TOKEN_SHOW
|
||||||
%token <sval> BX_TOKEN_SYMBOL
|
%token <sval> BX_TOKEN_SYMBOL
|
||||||
|
%token <sval> BX_TOKEN_SYMBOLS
|
||||||
|
%token <sval> BX_TOKEN_LIST_SYMBOLS
|
||||||
%token <sval> BX_TOKEN_GLOBAL
|
%token <sval> BX_TOKEN_GLOBAL
|
||||||
%token <sval> BX_TOKEN_WHERE
|
%token <sval> BX_TOKEN_WHERE
|
||||||
%token <sval> BX_TOKEN_PRINT_STRING
|
%token <sval> 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 <ulval> BX_TOKEN_LONG_NUMERIC
|
%token <ulval> BX_TOKEN_LONG_NUMERIC
|
||||||
%token <sval> BX_TOKEN_INFO_ADDRESS
|
%token <sval> BX_TOKEN_INFO_ADDRESS
|
||||||
%token <sval> BX_TOKEN_NE2000
|
%token <sval> BX_TOKEN_NE2000
|
||||||
|
%token <sval> BX_TOKEN_PIC
|
||||||
%token <sval> BX_TOKEN_PAGE
|
%token <sval> BX_TOKEN_PAGE
|
||||||
%token <sval> BX_TOKEN_CS
|
%token <sval> BX_TOKEN_CS
|
||||||
%token <sval> BX_TOKEN_ES
|
%token <sval> 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 <sval> BX_TOKEN_DS
|
%token <sval> BX_TOKEN_DS
|
||||||
%token <sval> BX_TOKEN_FS
|
%token <sval> BX_TOKEN_FS
|
||||||
%token <sval> BX_TOKEN_GS
|
%token <sval> BX_TOKEN_GS
|
||||||
|
%token <sval> BX_TOKEN_FLAGS
|
||||||
%token <sval> BX_TOKEN_ALWAYS_CHECK
|
%token <sval> BX_TOKEN_ALWAYS_CHECK
|
||||||
%token <sval> BX_TOKEN_MATHS
|
|
||||||
%token <sval> BX_TOKEN_ADD
|
|
||||||
%token <sval> BX_TOKEN_SUB
|
|
||||||
%token <sval> BX_TOKEN_MUL
|
|
||||||
%token <sval> BX_TOKEN_DIV
|
|
||||||
%token <sval> BX_TOKEN_V2L
|
|
||||||
%token <sval> BX_TOKEN_TRACEREGON
|
%token <sval> BX_TOKEN_TRACEREGON
|
||||||
%token <sval> BX_TOKEN_TRACEREGOFF
|
%token <sval> BX_TOKEN_TRACEREGOFF
|
||||||
%token <sval> BX_TOKEN_HELP
|
%token <sval> BX_TOKEN_HELP
|
||||||
|
%token <sval> BX_TOKEN_CALC
|
||||||
|
%token BX_TOKEN_RSHIFT
|
||||||
|
%token BX_TOKEN_LSHIFT
|
||||||
%token <sval> BX_TOKEN_IVT
|
%token <sval> BX_TOKEN_IVT
|
||||||
%type <uval> segment_register
|
%type <uval> segment_register
|
||||||
%type <uval> optional_numeric
|
%type <uval> optional_numeric
|
||||||
%type <uval_range> numeric_range optional_numeric_range
|
%type <uval_range> numeric_range optional_numeric_range
|
||||||
|
%type <ulval> vexpression
|
||||||
|
%type <ulval> expression
|
||||||
|
|
||||||
|
%left '+' '-' '|' '^'
|
||||||
|
%left '*' '/' '&' BX_TOKEN_LSHIFT BX_TOKEN_RSHIFT
|
||||||
|
%left NOT NEG
|
||||||
|
|
||||||
%start command
|
%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:
|
command:
|
||||||
continue_command
|
continue_command
|
||||||
| stepN_command
|
| stepN_command
|
||||||
|
| step_over_command
|
||||||
| set_command
|
| set_command
|
||||||
|
| set_reg_command
|
||||||
| breakpoint_command
|
| breakpoint_command
|
||||||
| info_command
|
| info_command
|
||||||
|
| blist_command
|
||||||
|
| slist_command
|
||||||
| dump_cpu_command
|
| dump_cpu_command
|
||||||
| delete_command
|
| delete_command
|
||||||
|
| bpe_command
|
||||||
|
| bpd_command
|
||||||
| quit_command
|
| quit_command
|
||||||
| examine_command
|
| examine_command
|
||||||
| setpmem_command
|
| setpmem_command
|
||||||
|
@ -144,7 +192,6 @@ command:
|
||||||
| loader_command
|
| loader_command
|
||||||
| doit_command
|
| doit_command
|
||||||
| crc_command
|
| crc_command
|
||||||
| maths_command
|
|
||||||
| trace_on_command
|
| trace_on_command
|
||||||
| trace_off_command
|
| trace_off_command
|
||||||
| ptime_command
|
| ptime_command
|
||||||
|
@ -159,10 +206,10 @@ command:
|
||||||
| where_command
|
| where_command
|
||||||
| print_string_command
|
| print_string_command
|
||||||
| cosim_commands
|
| cosim_commands
|
||||||
| v2l_command
|
|
||||||
| trace_reg_on_command
|
| trace_reg_on_command
|
||||||
| trace_reg_off_command
|
| trace_reg_off_command
|
||||||
| help_command
|
| help_command
|
||||||
|
| calc_command
|
||||||
|
|
|
|
||||||
| '\n'
|
| '\n'
|
||||||
{
|
{
|
||||||
|
@ -417,6 +464,14 @@ stepN_command:
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
step_over_command:
|
||||||
|
BX_TOKEN_STEP_OVER '\n'
|
||||||
|
{
|
||||||
|
bx_dbg_step_over_command();
|
||||||
|
free($1);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
set_command:
|
set_command:
|
||||||
BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_ON '\n'
|
BX_TOKEN_SET BX_TOKEN_DIS BX_TOKEN_ON '\n'
|
||||||
{
|
{
|
||||||
|
@ -438,47 +493,78 @@ set_command:
|
||||||
breakpoint_command:
|
breakpoint_command:
|
||||||
BX_TOKEN_VBREAKPOINT '\n'
|
BX_TOKEN_VBREAKPOINT '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_vbreakpoint_command(0, 0, 0);
|
bx_dbg_vbreakpoint_command(bkAtIP, 0, 0);
|
||||||
free($1);
|
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);
|
free($1);
|
||||||
}
|
}
|
||||||
| BX_TOKEN_LBREAKPOINT '\n'
|
| BX_TOKEN_LBREAKPOINT '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_lbreakpoint_command(0, 0);
|
bx_dbg_lbreakpoint_command(bkAtIP, 0);
|
||||||
free($1);
|
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);
|
free($1);
|
||||||
}
|
}
|
||||||
|
| BX_TOKEN_LBREAKPOINT BX_TOKEN_STRING '\n'
|
||||||
|
{
|
||||||
|
bx_dbg_lbreakpoint_symbol_command($2);
|
||||||
|
free($1);free($2);
|
||||||
|
}
|
||||||
| BX_TOKEN_PBREAKPOINT '\n'
|
| BX_TOKEN_PBREAKPOINT '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_pbreakpoint_command(0, 0);
|
bx_dbg_pbreakpoint_command(bkAtIP, 0);
|
||||||
free($1);
|
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);
|
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);
|
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:
|
info_command:
|
||||||
BX_TOKEN_INFO BX_TOKEN_PBREAKPOINT '\n'
|
BX_TOKEN_INFO BX_TOKEN_PBREAKPOINT '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_info_bpoints_command();
|
bx_dbg_info_bpoints_command();
|
||||||
free($1); free($2);
|
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_TOKEN_INFO BX_TOKEN_PROGRAM '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_info_program_command();
|
bx_dbg_info_program_command();
|
||||||
|
@ -529,11 +615,26 @@ info_command:
|
||||||
bx_dbg_info_tss_command($3);
|
bx_dbg_info_tss_command($3);
|
||||||
free($1); free($2);
|
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_TOKEN_INFO BX_TOKEN_LINUX '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_info_linux_command();
|
bx_dbg_info_linux_command();
|
||||||
free($1); free($2);
|
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_TOKEN_INFO BX_TOKEN_CONTROL_REGS '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_info_control_regs_command();
|
bx_dbg_info_control_regs_command();
|
||||||
|
@ -554,6 +655,11 @@ info_command:
|
||||||
free($1); free($2); free($3); free($5);
|
free($1); free($2); free($3); free($5);
|
||||||
bx_dbg_info_ne2k($4, $6);
|
bx_dbg_info_ne2k($4, $6);
|
||||||
}
|
}
|
||||||
|
| BX_TOKEN_INFO BX_TOKEN_PIC '\n'
|
||||||
|
{
|
||||||
|
bx_dbg_info_pic();
|
||||||
|
free($1); free($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
optional_numeric :
|
optional_numeric :
|
||||||
|
@ -565,19 +671,14 @@ optional_numeric_range:
|
||||||
| numeric_range;
|
| numeric_range;
|
||||||
|
|
||||||
numeric_range :
|
numeric_range :
|
||||||
BX_TOKEN_NUMERIC
|
expression
|
||||||
{
|
{
|
||||||
$$ = make_num_range ($1, $1);
|
$$ = make_num_range ($1, $1);
|
||||||
}
|
}
|
||||||
|
|
|
|
||||||
BX_TOKEN_NUMERIC BX_TOKEN_NUMERIC
|
expression expression
|
||||||
{
|
{
|
||||||
$$ = make_num_range ($1, $2);
|
$$ = 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:
|
quit_command:
|
||||||
BX_TOKEN_QUIT '\n'
|
BX_TOKEN_QUIT '\n'
|
||||||
{
|
{
|
||||||
|
@ -607,7 +723,7 @@ quit_command:
|
||||||
|
|
||||||
|
|
||||||
examine_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);
|
bx_dbg_examine_command($1, $2,1, $3,1, 0);
|
||||||
#if BX_NUM_SIMULATORS >= 2
|
#if BX_NUM_SIMULATORS >= 2
|
||||||
|
@ -623,7 +739,7 @@ examine_command:
|
||||||
#endif
|
#endif
|
||||||
free($1); free($2);
|
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
|
//FIXME HanishKVC This method of hunting thro all the
|
||||||
// simulators may be better than using 2 calls if
|
// simulators may be better than using 2 calls if
|
||||||
|
@ -696,9 +812,14 @@ set_cpu_command:
|
||||||
disassemble_command:
|
disassemble_command:
|
||||||
BX_TOKEN_DISASSEMBLE optional_numeric_range '\n'
|
BX_TOKEN_DISASSEMBLE optional_numeric_range '\n'
|
||||||
{
|
{
|
||||||
bx_dbg_disassemble_command($2);
|
bx_dbg_disassemble_command(NULL, $2);
|
||||||
free($1);
|
free($1);
|
||||||
}
|
}
|
||||||
|
| BX_TOKEN_DISASSEMBLE BX_TOKEN_DISFORMAT optional_numeric_range '\n'
|
||||||
|
{
|
||||||
|
bx_dbg_disassemble_command($2, $3);
|
||||||
|
free($1); free($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
instrument_command:
|
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:
|
trace_reg_on_command:
|
||||||
BX_TOKEN_TRACEREGON '\n'
|
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); }
|
||||||
|
;
|
||||||
%%
|
%%
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -324,7 +324,7 @@ index_name32[7] = "EDI";
|
||||||
|
|
||||||
|
|
||||||
unsigned
|
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;
|
int byte_count;
|
||||||
Bit8u next_byte;
|
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_opsize = is_32;
|
||||||
db_32bit_addrsize = is_32;
|
db_32bit_addrsize = is_32;
|
||||||
db_eip = ip;
|
db_eip = ip;
|
||||||
|
db_base = base; // cs linear base (base for PM & cs<<4 for RM & VM)
|
||||||
instruction_begin = instruction = instr;
|
instruction_begin = instruction = instr;
|
||||||
|
|
||||||
seg_override = NULL;
|
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 0x04: dis_sprintf("smsw "); Ew(); goto done;
|
||||||
case 0x05: invalid_opcode(); goto done;
|
case 0x05: invalid_opcode(); goto done;
|
||||||
case 0x06: dis_sprintf("lmsw "); Ew(); 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;
|
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 0x07: invalid_opcode(); goto done;
|
||||||
case 0x08: dis_sprintf("invd"); goto done;
|
case 0x08: dis_sprintf("invd"); goto done;
|
||||||
case 0x09: dis_sprintf("wbinvd"); goto done;
|
case 0x09: dis_sprintf("wbinvd"); goto done;
|
||||||
case 0x0A:
|
case 0x0A: invalid_opcode(); goto done;
|
||||||
case 0x0B:
|
case 0x0B: dis_sprintf("ud2"); goto done;
|
||||||
case 0x0C:
|
case 0x0C:
|
||||||
case 0x0D:
|
case 0x0D:
|
||||||
case 0x0E:
|
case 0x0E:
|
||||||
|
@ -423,7 +424,25 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf)
|
||||||
case 0x15:
|
case 0x15:
|
||||||
case 0x16:
|
case 0x16:
|
||||||
case 0x17:
|
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 0x19:
|
||||||
case 0x1A:
|
case 0x1A:
|
||||||
case 0x1B:
|
case 0x1B:
|
||||||
|
@ -449,12 +468,13 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf)
|
||||||
case 0x2E:
|
case 0x2E:
|
||||||
case 0x2F: invalid_opcode(); goto done;
|
case 0x2F: invalid_opcode(); goto done;
|
||||||
|
|
||||||
case 0x30:
|
case 0x30: dis_sprintf("wrmsr"); goto done;
|
||||||
case 0x31:
|
case 0x31: dis_sprintf("rdtsc"); goto done;
|
||||||
case 0x32:
|
case 0x32: dis_sprintf("rdmsr"); goto done;
|
||||||
case 0x33:
|
case 0x33: dis_sprintf("rdpmc"); goto done;
|
||||||
case 0x34:
|
case 0x34: dis_sprintf("sysenter"); goto done;
|
||||||
case 0x35:
|
case 0x35: dis_sprintf("sysexit"); goto done;
|
||||||
|
|
||||||
case 0x36:
|
case 0x36:
|
||||||
case 0x37:
|
case 0x37:
|
||||||
case 0x38:
|
case 0x38:
|
||||||
|
@ -466,22 +486,22 @@ bx_disassemble_c::disasm(bx_bool is_32, Bit32u ip, Bit8u *instr, char *disbuf)
|
||||||
case 0x3E:
|
case 0x3E:
|
||||||
case 0x3F: invalid_opcode(); goto done;
|
case 0x3F: invalid_opcode(); goto done;
|
||||||
|
|
||||||
case 0x40:
|
case 0x40: dis_sprintf("cmovo "); GvEv(); goto done;
|
||||||
case 0x41:
|
case 0x41: dis_sprintf("cmovno "); GvEv(); goto done;
|
||||||
case 0x42:
|
case 0x42: dis_sprintf("cmovc "); GvEv(); goto done;
|
||||||
case 0x43:
|
case 0x43: dis_sprintf("cmovnc "); GvEv(); goto done;
|
||||||
case 0x44:
|
case 0x44: dis_sprintf("cmovz "); GvEv(); goto done;
|
||||||
case 0x45:
|
case 0x45: dis_sprintf("cmovnz "); GvEv(); goto done;
|
||||||
case 0x46:
|
case 0x46: dis_sprintf("cmovna "); GvEv(); goto done;
|
||||||
case 0x47:
|
case 0x47: dis_sprintf("cmova "); GvEv(); goto done;
|
||||||
case 0x48:
|
case 0x48: dis_sprintf("cmovs "); GvEv(); goto done;
|
||||||
case 0x49:
|
case 0x49: dis_sprintf("cmovns "); GvEv(); goto done;
|
||||||
case 0x4A:
|
case 0x4A: dis_sprintf("cmovp "); GvEv(); goto done;
|
||||||
case 0x4B:
|
case 0x4B: dis_sprintf("cmovnp "); GvEv(); goto done;
|
||||||
case 0x4C:
|
case 0x4C: dis_sprintf("cmovl "); GvEv(); goto done;
|
||||||
case 0x4D:
|
case 0x4D: dis_sprintf("cmovnl "); GvEv(); goto done;
|
||||||
case 0x4E:
|
case 0x4E: dis_sprintf("cmovng "); GvEv(); goto done;
|
||||||
case 0x4F: invalid_opcode(); goto done;
|
case 0x4F: dis_sprintf("cmovg "); GvEv(); goto done;
|
||||||
|
|
||||||
case 0x50:
|
case 0x50:
|
||||||
case 0x51:
|
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 0xA0: dis_sprintf("push fs"); goto done;
|
||||||
case 0xA1: dis_sprintf("pop 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 0xA3: dis_sprintf("bt "); EvGv(); goto done;
|
||||||
case 0xA4: dis_sprintf("shld "); EvGv(); dis_sprintf(", "); Ib(); goto done;
|
case 0xA4: dis_sprintf("shld "); EvGv(); dis_sprintf(", "); Ib(); goto done;
|
||||||
case 0xA5: dis_sprintf("shld "); EvGv(); dis_sprintf(", CL"); 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 0xA7: dis_sprintf("cmpxchg "); IBTS(); goto done;
|
||||||
case 0xA8: dis_sprintf("push gs"); goto done;
|
case 0xA8: dis_sprintf("push gs"); goto done;
|
||||||
case 0xA9: dis_sprintf("pop 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 0xAB: dis_sprintf("bts "); EvGv(); goto done;
|
||||||
case 0xAC: dis_sprintf("shrd "); EvGv(); dis_sprintf(", "); Ib(); 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 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 0xAF: dis_sprintf("imul "); GvEv(); goto done;
|
||||||
|
|
||||||
case 0xB0: dis_sprintf("cmpxchg "); EbGb(); 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;
|
case 0x07: dis_sprintf("btc "); EvIb(); goto done;
|
||||||
default: BX_PANIC(("debugger: invalid opcode")); goto done;
|
default: BX_PANIC(("debugger: invalid opcode")); goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0xBB: dis_sprintf("btc "); EvGv(); goto done;
|
case 0xBB: dis_sprintf("btc "); EvGv(); goto done;
|
||||||
case 0xBC: dis_sprintf("bsf "); GvEv(); goto done;
|
case 0xBC: dis_sprintf("bsf "); GvEv(); goto done;
|
||||||
case 0xBD: dis_sprintf("bsr "); 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 0xC3:
|
||||||
case 0xC4:
|
case 0xC4:
|
||||||
case 0xC5:
|
case 0xC5:
|
||||||
case 0xC6:
|
case 0xC6: invalid_opcode(); goto done;
|
||||||
case 0xC7: 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 0xC8: dis_sprintf("bswap "); eAX(); goto done;
|
||||||
case 0xC9: dis_sprintf("bswap "); eCX(); goto done;
|
case 0xC9: dis_sprintf("bswap "); eCX(); goto done;
|
||||||
case 0xCA: dis_sprintf("bswap "); eDX(); 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 0x99: dis_sprintf("cwd"); goto done;
|
||||||
case 0x9A: dis_sprintf("call "); Ap(); goto done;
|
case 0x9A: dis_sprintf("call "); Ap(); goto done;
|
||||||
case 0x9B: dis_sprintf("wait"); goto done;
|
case 0x9B: dis_sprintf("wait"); goto done;
|
||||||
case 0x9C: dis_sprintf("pushf"); goto done;
|
case 0x9C:
|
||||||
case 0x9D: dis_sprintf("popf"); goto done;
|
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 0x9E: dis_sprintf("sahf"); goto done;
|
||||||
case 0x9F: dis_sprintf("lahf"); 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;
|
default: BX_PANIC(("debugger: invalid opcode")); goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0xC2: dis_sprintf("ret_near "); Iw(); goto done;
|
case 0xC2: dis_sprintf("retn "); Iw(); goto done;
|
||||||
case 0xC3: dis_sprintf("ret_near"); goto done;
|
case 0xC3: dis_sprintf("retn"); goto done;
|
||||||
case 0xC4: dis_sprintf("les "); GvMp(); goto done;
|
case 0xC4: dis_sprintf("les "); GvMp(); goto done;
|
||||||
case 0xC5: dis_sprintf("lds "); GvMp(); goto done;
|
case 0xC5: dis_sprintf("lds "); GvMp(); goto done;
|
||||||
case 0xC6: dis_sprintf("mov "); EbIb(); goto done;
|
case 0xC6: dis_sprintf("mov "); EbIb(); goto done;
|
||||||
case 0xC7: dis_sprintf("mov "); EvIv(); goto done;
|
case 0xC7: dis_sprintf("mov "); EvIv(); goto done;
|
||||||
case 0xC8: dis_sprintf("enter "); Iw(); dis_sprintf(", "); Ib(); goto done;
|
case 0xC8: dis_sprintf("enter "); Iw(); dis_sprintf(", "); Ib(); goto done;
|
||||||
case 0xC9: dis_sprintf("leave"); goto done;
|
case 0xC9: dis_sprintf("leave"); goto done;
|
||||||
case 0xCA: dis_sprintf("ret_far "); Iw(); goto done;
|
case 0xCA: dis_sprintf("retf "); Iw(); goto done;
|
||||||
case 0xCB: dis_sprintf("ret_far"); goto done;
|
case 0xCB: dis_sprintf("retf"); goto done;
|
||||||
case 0xCC: dis_sprintf("int3"); goto done;
|
case 0xCC: dis_sprintf("int3"); goto done;
|
||||||
case 0xCD: dis_sprintf("int "); Ib(); goto done;
|
case 0xCD: dis_sprintf("int "); Ib(); goto done;
|
||||||
case 0xCE: dis_sprintf("into"); 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 */
|
case 0xD0: /* Group 2 Eb,1 */
|
||||||
mod_rm_byte = peek_byte();
|
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 0xE5: dis_sprintf("in "); eAX(); dis_sprintf(", "); Ib(); goto done;
|
||||||
case 0xE6: dis_sprintf("out "); Ib(); dis_sprintf(", AL"); 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 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 0xE9: dis_sprintf("jmp "); Jv(); goto done;
|
||||||
case 0xEA: dis_sprintf("jmp "); Ap(); goto done;
|
case 0xEA: dis_sprintf("jmp "); Ap(); goto done;
|
||||||
case 0xEB: dis_sprintf("jmp "); Jb(); 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 */
|
case 0xF0: /* LOCK */
|
||||||
dis_sprintf("LOCK: ");
|
dis_sprintf("LOCK: ");
|
||||||
break;
|
break;
|
||||||
case 0xF1: invalid_opcode(); goto done;
|
case 0xF1: dis_sprintf("int1"); goto done;
|
||||||
case 0xF2: /* REPNE/REPNZ */
|
case 0xF2: /* REPNE/REPNZ */
|
||||||
db_repne_prefix = 1;
|
db_repne_prefix = 1;
|
||||||
dis_sprintf("REPNE: ");
|
dis_sprintf("REPNE: ");
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -156,6 +156,18 @@ bx_disassemble_c::Mp(void)
|
||||||
GvMp();
|
GvMp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bx_disassemble_c::Mq(void)
|
||||||
|
{
|
||||||
|
Ms();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bx_disassemble_c::Mb(void)
|
||||||
|
{
|
||||||
|
Ms();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
bx_disassemble_c::GvMa(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);
|
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
|
void
|
||||||
bx_disassemble_c::Eb(void)
|
bx_disassemble_c::Eb(void)
|
||||||
{
|
{
|
||||||
|
@ -525,6 +521,13 @@ bx_disassemble_c::Jv(void)
|
||||||
Bit32s imm32; /* JMP rel32 is signed */
|
Bit32s imm32; /* JMP rel32 is signed */
|
||||||
|
|
||||||
imm32 = (Bit32s) fetch_dword();
|
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));
|
dis_sprintf("%08x", (unsigned) (imm32 + db_eip));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -533,6 +536,13 @@ bx_disassemble_c::Jv(void)
|
||||||
Bit16s imm16; /* JMP rel16 is signed */
|
Bit16s imm16; /* JMP rel16 is signed */
|
||||||
|
|
||||||
imm16 = (Bit16s) fetch_word();
|
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));
|
dis_sprintf("%04x", (unsigned) ((imm16 + db_eip) & 0xFFFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,11 +606,25 @@ bx_disassemble_c::Jb(void)
|
||||||
imm8 = (Bit8s) fetch_byte();
|
imm8 = (Bit8s) fetch_byte();
|
||||||
#if BX_CPU_LEVEL > 2
|
#if BX_CPU_LEVEL > 2
|
||||||
if (db_32bit_opsize) {
|
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));
|
dis_sprintf("%08x", (unsigned) (imm8 + db_eip));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#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));
|
dis_sprintf("%04x", (unsigned) ((imm8 + db_eip) & 0xFFFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
class bx_disassemble_c : public logfunctions {
|
class bx_disassemble_c : public logfunctions {
|
||||||
public:
|
public:
|
||||||
bx_disassemble_c(void);
|
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:
|
private:
|
||||||
bx_bool db_32bit_opsize;
|
bx_bool db_32bit_opsize;
|
||||||
|
@ -48,6 +48,7 @@ private:
|
||||||
bx_bool db_rep_prefix;
|
bx_bool db_rep_prefix;
|
||||||
bx_bool db_repne_prefix;
|
bx_bool db_repne_prefix;
|
||||||
Bit32u db_eip;
|
Bit32u db_eip;
|
||||||
|
Bit32u db_base;
|
||||||
Bit8u *instruction_begin; // keep track of where instruction starts
|
Bit8u *instruction_begin; // keep track of where instruction starts
|
||||||
Bit8u *instruction; // for fetching of next byte of instruction
|
Bit8u *instruction; // for fetching of next byte of instruction
|
||||||
|
|
||||||
|
@ -133,6 +134,8 @@ private:
|
||||||
void XBTS(void);
|
void XBTS(void);
|
||||||
void IBTS(void);
|
void IBTS(void);
|
||||||
void Mp(void);
|
void Mp(void);
|
||||||
|
void Mq(void);
|
||||||
|
void Mb(void);
|
||||||
void EvIb(void);
|
void EvIb(void);
|
||||||
void GvEb(void);
|
void GvEb(void);
|
||||||
void GvMa(void);
|
void GvMa(void);
|
||||||
|
@ -183,7 +186,6 @@ private:
|
||||||
void El(void);
|
void El(void);
|
||||||
void STi_ST(void);
|
void STi_ST(void);
|
||||||
void Eq(void);
|
void Eq(void);
|
||||||
void Av(void);
|
|
||||||
void eAXEv(void);
|
void eAXEv(void);
|
||||||
void Ep(void);
|
void Ep(void);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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.
|
// 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
|
char disasm_tbuf[512]; // buffer for instruction disassembly
|
||||||
unsigned length = i->opcode_size, n;
|
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)
|
if(length != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||||
|
@ -48,7 +48,7 @@ void bxInstrumentation::bx_instr_new_instruction()
|
||||||
{
|
{
|
||||||
char disasm_tbuf[512]; // buffer for instruction disassembly
|
char disasm_tbuf[512]; // buffer for instruction disassembly
|
||||||
unsigned length = opcode_size, n;
|
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)
|
if(length != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "----------------------------------------------------------\n");
|
fprintf(stderr, "----------------------------------------------------------\n");
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||||
|
@ -213,6 +213,9 @@ class BOCHSAPI bx_pic_stub_c : public bx_devmodel_c {
|
||||||
virtual Bit8u IAC(void) {
|
virtual Bit8u IAC(void) {
|
||||||
STUBFUNC(pic, IAC); return 0;
|
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 {
|
class BOCHSAPI bx_vga_stub_c : public bx_devmodel_c {
|
||||||
|
|
|
@ -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.
|
// 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);
|
clear_highest_interrupt(& BX_PIC_THIS s.master_pic);
|
||||||
BX_PIC_THIS s.master_pic.polled = 0;
|
BX_PIC_THIS s.master_pic.polled = 0;
|
||||||
service_master_pic();
|
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) {
|
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);
|
clear_highest_interrupt(& BX_PIC_THIS s.slave_pic);
|
||||||
BX_PIC_THIS s.slave_pic.polled = 0;
|
BX_PIC_THIS s.slave_pic.polled = 0;
|
||||||
service_slave_pic();
|
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
|
void
|
||||||
bx_pic_c::show_pic_state(void)
|
bx_pic_c::show_pic_state(void)
|
||||||
{
|
{
|
||||||
BX_INFO(("s.master_pic.imr = %02x", BX_PIC_THIS s.master_pic.imr));
|
dbg_printf("s.master_pic.imr = %02x\n", BX_PIC_THIS s.master_pic.imr);
|
||||||
BX_INFO(("s.master_pic.isr = %02x", BX_PIC_THIS s.master_pic.isr));
|
dbg_printf("s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr);
|
||||||
BX_INFO(("s.master_pic.irr = %02x", BX_PIC_THIS s.master_pic.irr));
|
dbg_printf("s.master_pic.irr = %02x\n", 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.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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||||
|
@ -76,6 +76,7 @@ public:
|
||||||
virtual void lower_irq(unsigned irq_no);
|
virtual void lower_irq(unsigned irq_no);
|
||||||
virtual void raise_irq(unsigned irq_no);
|
virtual void raise_irq(unsigned irq_no);
|
||||||
virtual Bit8u IAC(void);
|
virtual Bit8u IAC(void);
|
||||||
|
virtual void show_pic_state(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct {
|
struct {
|
||||||
|
@ -92,6 +93,5 @@ private:
|
||||||
|
|
||||||
BX_PIC_SMF void service_master_pic(void);
|
BX_PIC_SMF void service_master_pic(void);
|
||||||
BX_PIC_SMF void service_slave_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);
|
BX_PIC_SMF void clear_highest_interrupt(bx_pic_t *pic);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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.
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||||
|
@ -29,6 +29,10 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "state_file.h"
|
#include "state_file.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LOCALE_H
|
||||||
|
#include <locale.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if BX_WITH_SDL
|
#if BX_WITH_SDL
|
||||||
// since SDL redefines main() to SDL_main(), we must include SDL.h so that the
|
// 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
|
// 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
|
#endif
|
||||||
|
|
||||||
int bxmain () {
|
int bxmain () {
|
||||||
|
#ifdef HAVE_LOCALE_H
|
||||||
|
// Initialize locale (for isprint() and other functions)
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
#endif
|
||||||
bx_user_quit = 0;
|
bx_user_quit = 0;
|
||||||
bx_init_siminterface (); // create the SIM object
|
bx_init_siminterface (); // create the SIM object
|
||||||
static jmp_buf context;
|
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.
|
// there is no stdin/stdout so disable the text-based config interface.
|
||||||
SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START);
|
SIM->get_param_enum(BXP_BOCHS_START)->set (BX_QUICK_START);
|
||||||
char cwd[MAXPATHLEN];
|
char cwd[MAXPATHLEN];
|
||||||
getwd (cwd);
|
getcwd (cwd);
|
||||||
BX_INFO (("Now my working directory is %s", cwd));
|
BX_INFO (("Now my working directory is %s", cwd));
|
||||||
// if it was started from command line, there could be some args still.
|
// if it was started from command line, there could be some args still.
|
||||||
for (int a=0; a<argc; a++) {
|
for (int a=0; a<argc; a++) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: plugin.h,v 1.19 2003-07-31 12:04:47 vruppert Exp $
|
// $Id: plugin.h,v 1.20 2003-08-04 16:03:08 akrisak Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// This file provides macros and types needed for plugins. It is based on
|
// This file provides macros and types needed for plugins. It is based on
|
||||||
|
@ -140,6 +140,7 @@ extern "C" {
|
||||||
#define DEV_pic_lower_irq(b) (bx_devices.pluginPicDevice->lower_irq(b))
|
#define DEV_pic_lower_irq(b) (bx_devices.pluginPicDevice->lower_irq(b))
|
||||||
#define DEV_pic_raise_irq(b) (bx_devices.pluginPicDevice->raise_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_iac() (bx_devices.pluginPicDevice->IAC())
|
||||||
|
#define DEV_pic_show_pic_state() (bx_devices.pluginPicDevice->show_pic_state())
|
||||||
|
|
||||||
///////// VGA macros
|
///////// VGA macros
|
||||||
#define DEV_vga_mem_read(addr) (bx_devices.pluginVgaDevice->mem_read(addr))
|
#define DEV_vga_mem_read(addr) (bx_devices.pluginVgaDevice->mem_read(addr))
|
||||||
|
|
Loading…
Reference in New Issue