Changes breakpoints configure time enable macroses - reduce amount of compile-time parameters

This commit is contained in:
Stanislav Shwartsman 2007-10-12 22:11:25 +00:00
parent 2a1bcb3e21
commit ac272e9383
5 changed files with 44 additions and 50 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.209 2007-10-09 19:49:23 sshwarts Exp $
// $Id: bochs.h,v 1.210 2007-10-12 22:11:24 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -451,7 +451,7 @@ typedef struct {
bx_bool cdrom;
#if BX_MAGIC_BREAKPOINT
bx_bool magic_break_enabled;
#endif /* BX_MAGIC_BREAKPOINT */
#endif
#if BX_GDBSTUB
bx_bool gdbstub_enabled;
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.99 2007-10-11 18:11:58 sshwarts Exp $
// $Id: dbg_main.cc,v 1.100 2007-10-12 22:11:25 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1434,7 +1434,7 @@ void bx_dbg_print_guard_results(void)
for (cpu=0; cpu<BX_SMP_PROCESSORS; cpu++) {
unsigned long found = BX_CPU(cpu)->guard_found.guard_found;
if (found & BX_DBG_GUARD_CTRL_C) { /* ... */ }
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
else if (found & BX_DBG_GUARD_IADDR_VIR) {
i = BX_CPU(cpu)->guard_found.iaddr_index;
dbg_printf("(%u) Breakpoint %u, in ");
@ -1444,7 +1444,7 @@ void bx_dbg_print_guard_results(void)
dbg_printf("\n");
}
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
else if (found & BX_DBG_GUARD_IADDR_LIN) {
i = BX_CPU(cpu)->guard_found.iaddr_index;
if (bx_guard.iaddr.lin[i].bpoint_id != 0)
@ -1454,7 +1454,7 @@ void bx_dbg_print_guard_results(void)
BX_CPU(cpu)->guard_found.laddr);
}
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
else if (found & BX_DBG_GUARD_IADDR_PHY) {
i = BX_CPU(cpu)->guard_found.iaddr_index;
dbg_printf("(%u) Breakpoint %u, 0x" FMT_ADDRX " in ?? ()\n",
@ -1506,21 +1506,21 @@ void bx_dbg_print_guard_results(void)
void bx_dbg_breakpoint_changed(void)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
if (bx_guard.iaddr.num_virtual)
bx_guard.guard_for |= BX_DBG_GUARD_IADDR_VIR;
else
bx_guard.guard_for &= ~BX_DBG_GUARD_IADDR_VIR;
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
if (bx_guard.iaddr.num_linear)
bx_guard.guard_for |= BX_DBG_GUARD_IADDR_LIN;
else
bx_guard.guard_for &= ~BX_DBG_GUARD_IADDR_LIN;
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
if (bx_guard.iaddr.num_physical)
bx_guard.guard_for |= BX_DBG_GUARD_IADDR_PHY;
else
@ -1530,19 +1530,19 @@ void bx_dbg_breakpoint_changed(void)
void bx_dbg_en_dis_breakpoint_command(unsigned handle, bx_bool enable)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
if (bx_dbg_en_dis_vbreak(handle, enable))
goto done;
goto done;
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
if (bx_dbg_en_dis_lbreak(handle, enable))
goto done;
goto done;
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
if (bx_dbg_en_dis_pbreak(handle, enable))
goto done;
goto done;
#endif
dbg_printf("Error: breakpoint %u not found.\n", handle);
@ -1554,7 +1554,7 @@ done:
bx_bool bx_dbg_en_dis_pbreak(unsigned handle, bx_bool enable)
{
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
// see if breakpoint is a physical breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_physical; i++) {
if (bx_guard.iaddr.phy[i].bpoint_id == handle) {
@ -1563,12 +1563,12 @@ bx_bool bx_dbg_en_dis_pbreak(unsigned handle, bx_bool enable)
}
}
#endif
return (bx_bool)false;
return 0;
}
bx_bool bx_dbg_en_dis_lbreak(unsigned handle, bx_bool enable)
{
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
// see if breakpoint is a linear breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_linear; i++) {
if (bx_guard.iaddr.lin[i].bpoint_id == handle) {
@ -1582,7 +1582,7 @@ bx_bool bx_dbg_en_dis_lbreak(unsigned handle, bx_bool enable)
bx_bool bx_dbg_en_dis_vbreak(unsigned handle, bx_bool enable)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
// see if breakpoint is a virtual breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_virtual; i++) {
if (bx_guard.iaddr.vir[i].bpoint_id == handle) {
@ -1596,17 +1596,17 @@ bx_bool bx_dbg_en_dis_vbreak(unsigned handle, bx_bool enable)
void bx_dbg_del_breakpoint_command(unsigned handle)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
if (bx_dbg_del_vbreak(handle))
goto done;
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
if (bx_dbg_del_lbreak(handle))
goto done;
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
if (bx_dbg_del_pbreak(handle))
goto done;
#endif
@ -1620,7 +1620,7 @@ done:
bx_bool bx_dbg_del_pbreak(unsigned handle)
{
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
// see if breakpoint is a physical breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_physical; i++) {
if (bx_guard.iaddr.phy[i].bpoint_id == handle) {
@ -1638,7 +1638,7 @@ bx_bool bx_dbg_del_pbreak(unsigned handle)
bx_bool bx_dbg_del_lbreak(unsigned handle)
{
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
// see if breakpoint is a linear breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_linear; i++) {
if (bx_guard.iaddr.lin[i].bpoint_id == handle) {
@ -1656,7 +1656,7 @@ bx_bool bx_dbg_del_lbreak(unsigned handle)
bx_bool bx_dbg_del_vbreak(unsigned handle)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
// see if breakpoint is a virtual breakpoint
for (unsigned i=0; i<bx_guard.iaddr.num_virtual; i++) {
if (bx_guard.iaddr.vir[i].bpoint_id == handle) {
@ -1674,7 +1674,7 @@ bx_bool bx_dbg_del_vbreak(unsigned handle)
int bx_dbg_vbreakpoint_command(BreakpointKind bk, Bit32u cs, bx_address eip)
{
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
if (bk != bkRegular) {
dbg_printf("Error: vbreak of this kind not implemented yet.\n");
return -1;
@ -1697,14 +1697,14 @@ int bx_dbg_vbreakpoint_command(BreakpointKind bk, Bit32u cs, bx_address eip)
#else
dbg_printf("Error: virtual breakpoint support not compiled in.\n");
dbg_printf("Error: see BX_DBG_SUPPORT_VIR_BPOINT.\n");
dbg_printf("Error: make sure BX_DBG_MAX_VIR_BPOINTS > 0\n");
return -1;
#endif
}
int bx_dbg_lbreakpoint_command(BreakpointKind bk, bx_address laddress)
{
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
if (bk == bkAtIP) {
dbg_printf("Error: lbreak of this kind not implemented yet.\n");
return -1;
@ -1726,14 +1726,14 @@ int bx_dbg_lbreakpoint_command(BreakpointKind bk, bx_address laddress)
#else
dbg_printf("Error: linear breakpoint support not compiled in.\n");
dbg_printf("Error: see BX_DBG_SUPPORT_LIN_BPOINT.\n");
dbg_printf("Error: make sure BX_DBG_MAX_LIN_BPOINTS > 0\n");
return -1;
#endif
}
int bx_dbg_pbreakpoint_command(BreakpointKind bk, bx_phy_address paddress)
{
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
if (bk != bkRegular) {
dbg_printf("Error: pbreak of this kind not implemented yet.\n");
return -1;
@ -1754,7 +1754,7 @@ int bx_dbg_pbreakpoint_command(BreakpointKind bk, bx_phy_address paddress)
return BpId;
#else
dbg_printf("Error: physical breakpoint support not compiled in.\n");
dbg_printf("Error: see BX_DBG_SUPPORT_PHY_BPOINT.\n");
dbg_printf("Error: make sure BX_DBG_MAX_PHY_BPOINTS > 0\n");
return -1;
#endif
}
@ -1766,7 +1766,7 @@ void bx_dbg_info_bpoints_command(void)
// 1 breakpoint keep y 0x00010664 in main at temp.c:7
dbg_printf("Num Type Disp Enb Address\n");
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
for (i=0; i<bx_guard.iaddr.num_virtual; i++) {
dbg_printf("%3u ", bx_guard.iaddr.vir[i].bpoint_id);
dbg_printf("vbreakpoint ");
@ -1778,7 +1778,7 @@ void bx_dbg_info_bpoints_command(void)
}
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
for (i=0; i<bx_guard.iaddr.num_linear; i++) {
dbg_printf("%3u ", bx_guard.iaddr.lin[i].bpoint_id);
dbg_printf("lbreakpoint ");
@ -1788,7 +1788,7 @@ void bx_dbg_info_bpoints_command(void)
}
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
for (i=0; i<bx_guard.iaddr.num_physical; i++) {
dbg_printf("%3u ", bx_guard.iaddr.phy[i].bpoint_id);
dbg_printf("pbreakpoint ");

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: debug.h,v 1.33 2007-10-11 18:11:58 sshwarts Exp $
// $Id: debug.h,v 1.34 2007-10-12 22:11:25 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -377,7 +377,7 @@ typedef struct {
// instruction address breakpoints
struct {
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
unsigned num_virtual;
struct {
Bit32u cs; // only use 16 bits
@ -387,7 +387,7 @@ typedef struct {
} vir[BX_DBG_MAX_VIR_BPOINTS];
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
unsigned num_linear;
struct {
bx_address addr;
@ -396,7 +396,7 @@ typedef struct {
} lin[BX_DBG_MAX_LIN_BPOINTS];
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
unsigned num_physical;
struct {
bx_phy_address addr; // physical address is 32 bits only

View File

@ -319,14 +319,9 @@
// =================================================================
// Compile in support for virtual/linear/physical breakpoints.
// Set to 1, only those you need. Recommend using only linear
// breakpoints, unless you need others. Less supported means
// Enable only those you need. Recommend using only linear
// breakpoints, unless you need others. Less supported means
// slightly faster execution time.
#define BX_DBG_SUPPORT_VIR_BPOINT 1
#define BX_DBG_SUPPORT_LIN_BPOINT 1
#define BX_DBG_SUPPORT_PHY_BPOINT 1
// max number of virtual/linear/physical breakpoints handled
#define BX_DBG_MAX_VIR_BPOINTS 10
#define BX_DBG_MAX_LIN_BPOINTS 10
#define BX_DBG_MAX_PHY_BPOINTS 10
@ -347,7 +342,6 @@
// END: OPTIONAL DEBUGGER SECTION
// =================================================================
//////////////////////////////////////////////////////////////////////
// END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
// THIS IS GENERATED BY THE ./configure SCRIPT //

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.174 2007-09-26 18:07:39 sshwarts Exp $
// $Id: cpu.cc,v 1.175 2007-10-12 22:11:25 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -862,7 +862,7 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
// see if debugger is looking for iaddr breakpoint of any type
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_ALL) {
#if BX_DBG_SUPPORT_VIR_BPOINT
#if (BX_DBG_MAX_VIR_BPOINTS > 0)
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_VIR) {
if ((BX_CPU_THIS_PTR guard_found.icount!=0) ||
(tt != BX_CPU_THIS_PTR guard_found.time_tick))
@ -881,7 +881,7 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
}
}
#endif
#if BX_DBG_SUPPORT_LIN_BPOINT
#if (BX_DBG_MAX_LIN_BPOINTS > 0)
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_LIN) {
if ((BX_CPU_THIS_PTR guard_found.icount!=0) ||
(tt != BX_CPU_THIS_PTR guard_found.time_tick))
@ -899,7 +899,7 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
}
}
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
#if (BX_DBG_MAX_PHY_BPOINTS > 0)
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_PHY) {
bx_phy_address phy;
bx_bool valid = dbg_xlate_linear2phy(BX_CPU_THIS_PTR guard_found.laddr, &phy);