From a22160959bd5eabda529ecf1aafc94844dd6a7db Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 23 Mar 2008 21:39:01 +0000 Subject: [PATCH] HLT callback to Bochs internal debugger --- bochs/bx_debug/dbg_main.cc | 7 ++++++- bochs/bx_debug/debug.h | 3 ++- bochs/cpu/proc_ctrl.cc | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bochs/bx_debug/dbg_main.cc b/bochs/bx_debug/dbg_main.cc index 926cdebcc..43d328f23 100644 --- a/bochs/bx_debug/dbg_main.cc +++ b/bochs/bx_debug/dbg_main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: dbg_main.cc,v 1.116 2008-03-23 21:25:13 sshwarts Exp $ +// $Id: dbg_main.cc,v 1.117 2008-03-23 21:39:01 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -480,6 +480,11 @@ void bx_dbg_interrupt(unsigned cpu, Bit8u vector, Bit16u error_code) } } +void bx_dbg_halt(unsigned cpu) +{ + dbg_printf("CPU %d: HALTED\n"); +} + void bx_dbg_exit(int code) { BX_DEBUG(("dbg: before exit")); diff --git a/bochs/bx_debug/debug.h b/bochs/bx_debug/debug.h index 2a00efa00..aff6b1d0a 100644 --- a/bochs/bx_debug/debug.h +++ b/bochs/bx_debug/debug.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: debug.h,v 1.37 2008-02-05 22:33:33 sshwarts Exp $ +// $Id: debug.h,v 1.38 2008-03-23 21:39:01 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -293,6 +293,7 @@ void bx_dbg_calc_command(Bit64u value); void bx_dbg_dump_table(void); void bx_dbg_exception(unsigned cpu, Bit8u vector, Bit16u error_code); void bx_dbg_interrupt(unsigned cpu, Bit8u vector, Bit16u error_code); +void bx_dbg_halt(unsigned cpu); // commands that work with Bochs param tree void bx_dbg_restore_command(const char *param_name, const char *path); diff --git a/bochs/cpu/proc_ctrl.cc b/bochs/cpu/proc_ctrl.cc index ebf3cf200..2299395e9 100644 --- a/bochs/cpu/proc_ctrl.cc +++ b/bochs/cpu/proc_ctrl.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: proc_ctrl.cc,v 1.204 2008-03-22 21:29:41 sshwarts Exp $ +// $Id: proc_ctrl.cc,v 1.205 2008-03-23 21:39:01 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -124,6 +124,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HLT(bxInstruction_c *i) BX_INSTR_HLT(BX_CPU_ID); +#if BX_DEBUGGER + bx_dbg_halt(BX_CPU_ID); +#endif + #if BX_USE_IDLE_HACK bx_gui->sim_is_idle(); #endif