From 6d904d8dac11af237aa08eb527f378ac709c72b5 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Thu, 19 Nov 2009 17:24:26 +0000 Subject: [PATCH] small cleanup --- bochs/gui/enh_dbg.cc | 8 +++----- bochs/gui/gtk_enh_dbg_osdep.cc | 25 +++++++++++-------------- bochs/gui/win32_enh_dbg_osdep.cc | 4 ++-- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/bochs/gui/enh_dbg.cc b/bochs/gui/enh_dbg.cc index ab449aac6..b87a4b156 100755 --- a/bochs/gui/enh_dbg.cc +++ b/bochs/gui/enh_dbg.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: enh_dbg.cc,v 1.19 2009-10-31 16:01:29 sshwarts Exp $ +// $Id: enh_dbg.cc,v 1.20 2009-11-19 17:24:26 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // BOCHS ENHANCED DEBUGGER Ver 1.2 @@ -2640,7 +2640,7 @@ void DelWatchpoint(bx_phy_address *wp_array, unsigned *TotEntries, int i) -- *TotEntries; } -void SetWatchpoint(unsigned * num_watchpoints, bx_phy_address * watchpoint) +void SetWatchpoint(unsigned *num_watchpoints, bx_phy_address *watchpoint) { int iExist1 = -1; int i = (int) *num_watchpoints; @@ -2658,9 +2658,7 @@ void SetWatchpoint(unsigned * num_watchpoints, bx_phy_address * watchpoint) if (iExist1 >= 0) { // existing watchpoint, remove by copying the list down - while (++iExist1 < (int) *num_watchpoints) - watchpoint[iExist1 - 1] = watchpoint[iExist1]; - -- *num_watchpoints; + DelWatchpoint(watchpoint, num_watchpoints, iExist1); } else { diff --git a/bochs/gui/gtk_enh_dbg_osdep.cc b/bochs/gui/gtk_enh_dbg_osdep.cc index e0b5e8e84..bed85f45f 100755 --- a/bochs/gui/gtk_enh_dbg_osdep.cc +++ b/bochs/gui/gtk_enh_dbg_osdep.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: gtk_enh_dbg_osdep.cc,v 1.8 2009-09-27 06:19:23 sshwarts Exp $ +// $Id: gtk_enh_dbg_osdep.cc,v 1.9 2009-11-19 17:24:26 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // BOCHS ENHANCED DEBUGGER Ver 1.2 @@ -58,7 +58,7 @@ void RefreshDataWin(); void OnBreak(); void ParseBkpt(); void SetBreak(int i); -void SetWatchpoint(unsigned * num_watchpoints, bx_phy_address * watchpoint); +void SetWatchpoint(unsigned *num_watchpoints, bx_phy_address *watchpoint); void ChangeReg(); int HotKey (int ww, int Alt, int Shift, int Control); void ActivateMenuItem (int LW); @@ -208,6 +208,11 @@ char SelMem[260]; // flag array for which list rows are "selected" char SelAsm[MAX_ASM]; char SelReg[TOT_REG_NUM + EXTRA_REGS]; +extern unsigned num_write_watchpoints; +extern unsigned num_read_watchpoints; +extern bx_phy_address write_watchpoint[]; +extern bx_phy_address read_watchpoint[]; + // "run" the standard dialog box -- get text from the user bx_bool ShowAskDialog() { @@ -1476,10 +1481,6 @@ void Asm_DblClick (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn * void Mem_DblClick (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) { - extern unsigned num_write_watchpoints; - extern unsigned num_read_watchpoints; - extern bx_phy_address write_watchpoint[]; - extern bx_phy_address read_watchpoint[]; sizing_cancel(); if (AtBreak == FALSE || (DViewMode != VIEW_MEMDUMP && DViewMode != VIEW_BREAK)) return; @@ -1864,10 +1865,6 @@ void ListClr_PaintCb(GtkTreeViewColumn *col, { int colnum = GPOINTER_TO_INT ( acolnum ); gint rownum = 0; - extern unsigned num_write_watchpoints; - extern unsigned num_read_watchpoints; - extern bx_phy_address write_watchpoint[]; - extern bx_phy_address read_watchpoint[]; if (AtBreak == FALSE) g_object_set(renderer, "cell-background-gdk", &mgray, "cell-background-set", TRUE, NULL); @@ -1993,7 +1990,7 @@ void ListClr_PaintCb(GtkTreeViewColumn *col, { if (write_watchpoint[--j] == h) { - DmpClrNum = 1; // write watchpoint + DmpClrNum = 1; // write watchpoint j = -1; // on a match j<0 -- else j == 0 } } @@ -2001,11 +1998,11 @@ void ListClr_PaintCb(GtkTreeViewColumn *col, { if (read_watchpoint[i] == h) { - if (j < 0) // BOTH read and write + if (j < 0) // BOTH read and write DmpClrNum = 2; else - DmpClrNum = 3; // read watchpoint - i = 0; // end the loop on a match + DmpClrNum = 3; // read watchpoint + i = 0; // end the loop on a match } } } diff --git a/bochs/gui/win32_enh_dbg_osdep.cc b/bochs/gui/win32_enh_dbg_osdep.cc index 101d2e1e4..74e4c6964 100755 --- a/bochs/gui/win32_enh_dbg_osdep.cc +++ b/bochs/gui/win32_enh_dbg_osdep.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32_enh_dbg_osdep.cc,v 1.15 2009-04-12 05:52:38 sshwarts Exp $ +// $Id: win32_enh_dbg_osdep.cc,v 1.16 2009-11-19 17:24:26 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // BOCHS ENHANCED DEBUGGER Ver 1.2 @@ -85,7 +85,7 @@ void RefreshDataWin(); void OnBreak(); void ParseBkpt(); void SetBreak(int i); -void SetWatchpoint(unsigned * num_watchpoints, bx_phy_address * watchpoint); +void SetWatchpoint(unsigned *num_watchpoints, bx_phy_address *watchpoint); void ChangeReg(); int HotKey (int ww, int Alt, int Shift, int Control); void ActivateMenuItem (int LW);