diff --git a/bochs/.conf.everything b/bochs/.conf.everything index 57269c2ee..e5e6be732 100644 --- a/bochs/.conf.everything +++ b/bochs/.conf.everything @@ -17,6 +17,7 @@ --enable-port-e9-hack \ --enable-debugger \ --enable-disasm \ + --enable-debugger-gui \ --enable-vbe \ --enable-mmx \ --enable-fpu \ diff --git a/bochs/CHANGES b/bochs/CHANGES index 8dedaddbf..adf0b1865 100644 --- a/bochs/CHANGES +++ b/bochs/CHANGES @@ -4,6 +4,7 @@ Brief summary : - Added graphical Bochs debugger under Win32 host ! - Thanks for Chourdakis Michael and Bruce Ewing. +- Added user plugin interface support - Many fixes in Bochs internal debugger and CPU instrumentation. - Bugfixes for CPU emulation correctness. @@ -33,11 +34,15 @@ Detailed change log : name from Bochs command line (using new -log and -dbglog options) - Removed --enable-guest2host-tlb configure option. The option will be always enabled for any Bochs configuration. + - Added configure option to compile in GUI frontend for Bochs internal + debugger, to enable configure with --enable-debugger-gui option. The GUI + debugger frontend is enabled by default with Bochs internal debugger. - BIOS - Added S3 (suspend to RAM) ACPI state to BIOS (patch by Gleb Natapov) - I/O Devices + - Added user plugin support - Hard drive / cdrom - PACKET-DMA feature now supported by all ATAPI commands - ATAPI command 0x1A added (based on the Qemu implementation) @@ -92,6 +97,8 @@ Detailed change log : [1981505] Init PIIX4 PCI to ISA bridge and IDE by Sebastian - these S.F. bugs were closed + [2426271] cannot get correcet symbol entry + [2471982] VGA character height glitches [1659659] wrong behaviour a20 at boot [1998027] minwg + --with-term + --with-out-win32 = link failure [1871936] bochs-2.3.6 make fails on wx.cc @@ -124,6 +131,7 @@ Detailed change log : [1874124] bx_Instruction_c::ilen() const - these S.F. feature requests were closed/implemented + [1429015] Support for user plugins [1488136] debugger access to floppy controller [1363136] Full debugger SMP and 64 bit support [2068304] Support for ACPI diff --git a/bochs/config.h.in b/bochs/config.h.in index 7de422677..30cabee6c 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -658,8 +658,9 @@ typedef #endif -#define BX_DEBUGGER 0 -#define BX_DISASM 0 +#define BX_DEBUGGER 0 +#define BX_DISASM 0 +#define BX_DEBUGGER_GUI 0 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0) #error Dissembler is required for BX_DEBUGGER ! diff --git a/bochs/configure b/bochs/configure index ce36e2cc1..4a6305b95 100755 --- a/bochs/configure +++ b/bochs/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in,v 1.378 2008/12/27 12:06:39 sshwarts Exp . +# From configure.in Id: configure.in,v 1.379 2008/12/28 20:30:48 sshwarts Exp . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -1581,6 +1581,7 @@ Optional Features: --enable-cpp use .cpp as C++ suffix --enable-debugger compile in support for Bochs internal debugger --enable-disasm compile in support for disassembler + --enable-debugger-gui compile in support for Bochs internal debugger GUI --enable-all-optimizations compile in all possible optimizations --enable-readline use readline library, if available --enable-instrumentation compile in support for instrumentation @@ -4375,7 +4376,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4378 "configure"' > conftest.$ac_ext + echo '#line 4379 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6577,11 +6578,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6580: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6581: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6584: \$? = $ac_status" >&5 + echo "$as_me:6585: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6810,11 +6811,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6813: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6814: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6817: \$? = $ac_status" >&5 + echo "$as_me:6818: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6877,11 +6878,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6880: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6881: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6884: \$? = $ac_status" >&5 + echo "$as_me:6885: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9006,7 +9007,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:11283: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11286: \$? = $ac_status" >&5 + echo "$as_me:11287: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11346,11 +11347,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11349: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11350: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11353: \$? = $ac_status" >&5 + echo "$as_me:11354: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12656,7 +12657,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13581: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13584: \$? = $ac_status" >&5 + echo "$as_me:13585: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13644,11 +13645,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13647: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13648: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13651: \$? = $ac_status" >&5 + echo "$as_me:13652: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15655,11 +15656,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15658: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15659: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15662: \$? = $ac_status" >&5 + echo "$as_me:15663: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15888,11 +15889,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15891: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15892: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15895: \$? = $ac_status" >&5 + echo "$as_me:15896: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15955,11 +15956,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15958: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15959: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15962: \$? = $ac_status" >&5 + echo "$as_me:15963: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18084,7 +18085,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking enable Bochs internal debugger GUI... $ECHO_C" >&6; } +# Check whether --enable-debugger-gui was given. +if test "${enable_debugger_gui+set}" = set; then + enableval=$enable_debugger_gui; if test "$enableval" = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + cat >>confdefs.h <<\_ACEOF +#define BX_DEBUGGER_GUI 1 +_ACEOF + + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + cat >>confdefs.h <<\_ACEOF +#define BX_DEBUGGER_GUI 0 +_ACEOF + + fi +else + + if test "$bx_debugger" = 1; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + cat >>confdefs.h <<\_ACEOF +#define BX_DEBUGGER_GUI 1 +_ACEOF + + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + cat >>confdefs.h <<\_ACEOF +#define BX_DEBUGGER_GUI 0 +_ACEOF + + fi + + +fi + + + { echo "$as_me:$LINENO: checking for ALL optimizations enabled" >&5 echo $ECHO_N "checking for ALL optimizations enabled... $ECHO_C" >&6; } # Check whether --enable-all-optimizations was given. diff --git a/bochs/configure.in b/bochs/configure.in index 263229bc6..622da1550 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(bochs.h) -AC_REVISION([[$Id: configure.in,v 1.379 2008-12-28 20:30:48 sshwarts Exp $]]) +AC_REVISION([[$Id: configure.in,v 1.380 2009-01-12 19:15:35 sshwarts Exp $]]) AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(ltdlconf.h) @@ -1234,6 +1234,28 @@ AC_ARG_ENABLE(disasm, ]) AC_SUBST(DISASM_VAR) +AC_MSG_CHECKING(enable Bochs internal debugger GUI) +AC_ARG_ENABLE(debugger-gui, + [ --enable-debugger-gui compile in support for Bochs internal debugger GUI], + [if test "$enableval" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE(BX_DEBUGGER_GUI, 1) + else + AC_MSG_RESULT(no) + AC_DEFINE(BX_DEBUGGER_GUI, 0) + fi], + [ + if test "$bx_debugger" = 1; then + AC_MSG_RESULT(yes) + AC_DEFINE(BX_DEBUGGER_GUI, 1) + else + AC_MSG_RESULT(no) + AC_DEFINE(BX_DEBUGGER_GUI, 0) + fi + ] + ) + + AC_MSG_CHECKING(for ALL optimizations enabled) AC_ARG_ENABLE(all-optimizations, [ --enable-all-optimizations compile in all possible optimizations], diff --git a/bochs/gui/enh_dbg.cc b/bochs/gui/enh_dbg.cc index 123a63a20..37337e9c4 100755 --- a/bochs/gui/enh_dbg.cc +++ b/bochs/gui/enh_dbg.cc @@ -7,7 +7,7 @@ #include "config.h" -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI #include @@ -25,10 +25,6 @@ #define NEGATE_CLASS #define OPTIMIZE_JUST_STAR -bx_bool debug_cmd_ready = FALSE; -char *debug_cmd = NULL; -bx_bool vgaw_refresh = 0; - // get a "class" to access the disassebler // Note; any instance has access to all the member functions -- that is enough! // -- i.e. No further initialization necessary. diff --git a/bochs/gui/enh_dbg.h b/bochs/gui/enh_dbg.h index 4284a090b..d8ca1a515 100755 --- a/bochs/gui/enh_dbg.h +++ b/bochs/gui/enh_dbg.h @@ -1,6 +1,8 @@ #ifndef BX_ENH_DBG_DEF_H #define BX_ENH_DBG_DEF_H +#if BX_DEBUGGER && BX_DEBUGGER_GUI + void MoveLists(); void SetStatusText(int column, char *buf); // should it be here ? void MakeListsGray(); @@ -37,6 +39,10 @@ int GetNextSelectedLI(int listnum, int StartPt); bx_bool OSInit(); void SpecialInit(); +extern char *debug_cmd; +extern bx_bool debug_cmd_ready; +extern bx_bool vgaw_refresh; + #define CHK_CMD_MODEB CMD_MODEB #define CHK_CMD_ONECPU CMD_ONECPU #define CHK_CMD_UCASE CMD_UCASE @@ -58,6 +64,33 @@ void SpecialInit(); #define TRUE 1 #endif +#ifndef WIN32 + +// Need to define my version of the win32 "virtual keys" + +#define VK_PRIOR 65365 +#define VK_NEXT 65366 +#define VK_F2 65471 +#define VK_F3 65472 +#define VK_F4 65473 +#define VK_F5 65474 +#define VK_F6 65475 +#define VK_F7 65476 +#define VK_F8 65477 +#define VK_F9 65478 +#define VK_F11 65480 +#define VK_UP 65362 +#define VK_DOWN 65364 +#define VK_RETURN 65293 +#define VK_LEFT 65361 +#define VK_RIGHT 65363 +#define VK_END 65367 +#define VK_HOME 65360 +#define VK_DELETE 65535 +#define VK_ESCAPE 65307 + +#endif + // User Customizable initial settings: extern bx_bool SeeReg[8]; @@ -300,3 +333,4 @@ extern bx_phy_address RWP_Snapshot[16]; #endif +#endif diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index cf71ec4e2..2b7065a9e 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: siminterface.cc,v 1.188 2009-01-10 11:30:20 vruppert Exp $ +// $Id: siminterface.cc,v 1.189 2009-01-12 19:15:35 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2009 The Bochs Project @@ -180,6 +180,13 @@ private: bx_bool save_sr_param(FILE *fp, bx_param_c *node, const char *sr_path, int level); }; +#if BX_DEBUGGER +// FIXME: you will probably want to put these into the SIM-> structure +char *debug_cmd = NULL; +bx_bool debug_cmd_ready = 0; +bx_bool vgaw_refresh = 0; +#endif + // recursive function to find parameters from the path static bx_param_c *find_param(const char *full_pname, const char *rest_of_pname, bx_param_c *base) { diff --git a/bochs/gui/win32.cc b/bochs/gui/win32.cc index 27164cd40..51fbf61c6 100644 --- a/bochs/gui/win32.cc +++ b/bochs/gui/win32.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32.cc,v 1.125 2009-01-09 17:16:03 sshwarts Exp $ +// $Id: win32.cc,v 1.126 2009-01-12 19:15:35 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -177,7 +177,7 @@ static unsigned stretch_factor=1; static BOOL BxTextMode = TRUE; static BOOL legacyF12 = FALSE; static BOOL fix_size = FALSE; -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI static BOOL gui_debug = FALSE; #endif static HWND hotKeyReceiver = NULL; @@ -654,7 +654,7 @@ void bx_win32_gui_c::specific_init(int argc, char **argv, unsigned BX_INFO(("option %d: %s", i, argv[i])); if (!strcmp(argv[i], "legacyF12")) { legacyF12 = TRUE; -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI } else if (!strcmp(argv[i], "gui_debug")) { gui_debug = TRUE; SIM->set_debug_gui(1); @@ -919,7 +919,7 @@ VOID CDECL UIThread(PVOID pvoid) if (MemoryBitmap && MemoryDC) { resize_main_window(); ShowWindow(stInfo.mainWnd, SW_SHOW); -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI if (gui_debug) { InitDebugDialog(); } diff --git a/bochs/gui/win32_enh_dbg_osdep.cc b/bochs/gui/win32_enh_dbg_osdep.cc index 0b7e152a7..a617e5d67 100755 --- a/bochs/gui/win32_enh_dbg_osdep.cc +++ b/bochs/gui/win32_enh_dbg_osdep.cc @@ -1,6 +1,6 @@ #include "config.h" -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI #include "bochs.h" #include "disasm/disasm.h" diff --git a/bochs/gui/win32dialog.cc b/bochs/gui/win32dialog.cc index f75fd1ec7..e43a3effa 100644 --- a/bochs/gui/win32dialog.cc +++ b/bochs/gui/win32dialog.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32dialog.cc,v 1.66 2009-01-09 14:53:38 sshwarts Exp $ +// $Id: win32dialog.cc,v 1.67 2009-01-12 19:15:35 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// #include "win32dialog.h" @@ -908,7 +908,7 @@ BxEvent* win32_notify_callback(void *unused, BxEvent *event) case BX_SYNC_EVT_LOG_ASK: LogAskDialog(event); return event; -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI case BX_SYNC_EVT_GET_DBG_COMMAND: { // sim is at a "break" -- internal debugger is ready for a command diff --git a/bochs/gui/win32dialog.h b/bochs/gui/win32dialog.h index ae75aa230..fbec69661 100644 --- a/bochs/gui/win32dialog.h +++ b/bochs/gui/win32dialog.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32dialog.h,v 1.14 2009-01-09 14:53:38 sshwarts Exp $ +// $Id: win32dialog.h,v 1.15 2009-01-12 19:15:35 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// #ifndef BX_WIN32_DIALOGS_H @@ -27,7 +27,7 @@ extern "C" { #if BX_USE_TEXTCONFIG && defined(WIN32) int RuntimeOptionsDialog(); -#if BX_DEBUGGER +#if BX_DEBUGGER && BX_DEBUGGER_GUI void InitDebugDialog(); void ParseIDText (char *p); void HitBreak();