was playing with SMP and debugger

This commit is contained in:
Stanislav Shwartsman 2011-07-09 22:17:16 +00:00
parent c00c404d4f
commit 432bf97197
6 changed files with 7 additions and 18 deletions

View File

@ -94,6 +94,7 @@ Bochs repository moved to the SVN version control !
[3190995] add eth backend based on Slirp by Heikki Lindholm [3190995] add eth backend based on Slirp by Heikki Lindholm
- these S.F. bugs were closed/fixed - these S.F. bugs were closed/fixed
[3324111] configure for VCPP.NET issues
[3190970] Installing linux causes a crash in pci_ide [3190970] Installing linux causes a crash in pci_ide
[3077616] Fedora 13 installation fails on Bochs 2.4.5 [3077616] Fedora 13 installation fails on Bochs 2.4.5
[3294671] ./configure --enable-pci --disable-cdrom [3294671] ./configure --enable-pci --disable-cdrom

View File

@ -197,15 +197,10 @@ void print_tree(bx_param_c *node, int level = 0);
# define A20ADDR(x) ((bx_phy_address)(x)) # define A20ADDR(x) ((bx_phy_address)(x))
#endif #endif
#if BX_SUPPORT_SMP #define BX_TICK1_IF_SINGLE_PROCESSOR() \
# define BX_TICK1_IF_SINGLE_PROCESSOR() \ if (BX_SMP_PROCESSORS == 1) BX_TICK1()
if (BX_SMP_PROCESSORS == 1) BX_TICK1() #define BX_TICKN_IF_SINGLE_PROCESSOR(n) \
# define BX_TICKN_IF_SINGLE_PROCESSOR(n) \ if (BX_SMP_PROCESSORS == 1) BX_TICKN(n)
if (BX_SMP_PROCESSORS == 1) BX_TICKN(n)
#else
# define BX_TICK1_IF_SINGLE_PROCESSOR() BX_TICK1()
# define BX_TICKN_IF_SINGLE_PROCESSOR(n) BX_TICKN(n)
#endif
// you can't use static member functions on the CPU, if there are going // you can't use static member functions on the CPU, if there are going
// to be 2 cpus. Check this early on. // to be 2 cpus. Check this early on.

View File

@ -1778,7 +1778,6 @@ one_more:
for (cpu=0; cpu < BX_SMP_PROCESSORS; cpu++) { for (cpu=0; cpu < BX_SMP_PROCESSORS; cpu++) {
BX_CPU(cpu)->guard_found.guard_found = 0; BX_CPU(cpu)->guard_found.guard_found = 0;
BX_CPU(cpu)->guard_found.icount = 0; BX_CPU(cpu)->guard_found.icount = 0;
BX_CPU(cpu)->guard_found.time_tick = bx_pc_system.time_ticks();
} }
// update gui (disable continue command, enable stop command, etc.) // update gui (disable continue command, enable stop command, etc.)
@ -1869,7 +1868,6 @@ void bx_dbg_stepN_command(int cpu, Bit32u count)
// reset guard counters for all CPUs // reset guard counters for all CPUs
for (unsigned n=0; n < BX_SMP_PROCESSORS; n++) { for (unsigned n=0; n < BX_SMP_PROCESSORS; n++) {
BX_CPU(n)->guard_found.icount = 0; BX_CPU(n)->guard_found.icount = 0;
BX_CPU(n)->guard_found.time_tick = bx_pc_system.time_ticks();
} }
if (cpu >= 0 || BX_SUPPORT_SMP==0) { if (cpu >= 0 || BX_SUPPORT_SMP==0) {

View File

@ -380,8 +380,6 @@ void bx_dbg_exit(int code);
BX_DBG_GUARD_IADDR_LIN | \ BX_DBG_GUARD_IADDR_LIN | \
BX_DBG_GUARD_IADDR_PHY) BX_DBG_GUARD_IADDR_PHY)
#define BX_DBG_GUARD_CTRL_C 0x0100
typedef struct { typedef struct {
unsigned guard_for; unsigned guard_for;
@ -462,8 +460,6 @@ typedef struct bx_guard_found_t {
bx_address laddr; bx_address laddr;
// 00 - 16 bit, 01 - 32 bit, 10 - 64-bit, 11 - illegal // 00 - 16 bit, 01 - 32 bit, 10 - 64-bit, 11 - illegal
unsigned code_32_64; // CS seg size at guard point unsigned code_32_64; // CS seg size at guard point
bx_bool ctrl_c; // simulator stopped due to Ctrl-C request
Bit64u time_tick; // time tick when guard reached
} bx_guard_found_t; } bx_guard_found_t;
struct bx_watchpoint { struct bx_watchpoint {

View File

@ -862,7 +862,6 @@ bx_bool BX_CPU_C::dbg_instruction_epilog(void)
{ {
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 = n; BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint return(1); // on a breakpoint
} }
} }
@ -876,7 +875,6 @@ bx_bool BX_CPU_C::dbg_instruction_epilog(void)
{ {
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 = n; BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint return(1); // on a breakpoint
} }
} }
@ -892,7 +890,6 @@ bx_bool BX_CPU_C::dbg_instruction_epilog(void)
{ {
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 = n; BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint return(1); // on a breakpoint
} }
} }

View File

@ -935,6 +935,7 @@ int bx_begin_simulation (int argc, char *argv[])
// for one processor, the only reason for cpu_loop to return is // for one processor, the only reason for cpu_loop to return is
// that kill_bochs_request was set by the GUI interface. // that kill_bochs_request was set by the GUI interface.
} }
#if BX_SUPPORT_SMP
else { else {
// SMP simulation: do a few instructions on each processor, then switch // SMP simulation: do a few instructions on each processor, then switch
// to another. Increasing quantum speeds up overall performance, but // to another. Increasing quantum speeds up overall performance, but
@ -951,6 +952,7 @@ int bx_begin_simulation (int argc, char *argv[])
BX_TICKN(quantum); BX_TICKN(quantum);
} }
} }
#endif /* BX_SUPPORT_SMP */
} }
#endif /* BX_DEBUGGER == 0 */ #endif /* BX_DEBUGGER == 0 */
BX_INFO(("cpu loop quit, shutting down simulator")); BX_INFO(("cpu loop quit, shutting down simulator"));