From 672ac67ff91175fa7e859764358f16c4ad041fea Mon Sep 17 00:00:00 2001 From: Alexander Krisak Date: Mon, 15 Aug 2005 05:32:36 +0000 Subject: [PATCH] Fixed bug in bochs debugger caused breakpoints doesn't fires sometimes. --- bochs/bx_debug/debug.h | 4 +++- bochs/cpu/cpu.cc | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bochs/bx_debug/debug.h b/bochs/bx_debug/debug.h index b26acfdb3..dbc364ba2 100644 --- a/bochs/bx_debug/debug.h +++ b/bochs/bx_debug/debug.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: debug.h,v 1.4 2005-04-08 18:30:33 sshwarts Exp $ +// $Id: debug.h,v 1.5 2005-08-15 05:32:36 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -356,6 +356,8 @@ typedef struct bx_guard_found_t { Bit32u laddr; bx_bool is_32bit_code; // 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; extern bx_guard_t bx_guard; diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index 333dd9ba4..a0b4aab08 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.cc,v 1.108 2005-08-13 14:10:22 sshwarts Exp $ +// $Id: cpu.cc,v 1.109 2005-08-15 05:32:36 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -885,7 +885,8 @@ extern unsigned int dbg_show_mask; bx_bool BX_CPU_C::dbg_is_begin_instr_bpoint(Bit32u cs, Bit32u eip, Bit32u laddr, Bit32u is_32) -{ +{ Bit64u tt = bx_pc_system.time_ticks(); + //fprintf (stderr, "begin_instr_bp: checking cs:eip %04x:%08x\n", cs, eip); BX_CPU_THIS_PTR guard_found.cs = cs; BX_CPU_THIS_PTR guard_found.eip = eip; @@ -915,7 +916,8 @@ BX_CPU_C::dbg_is_begin_instr_bpoint(Bit32u cs, Bit32u eip, Bit32u laddr, if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_ALL) { #if BX_DBG_SUPPORT_VIR_BPOINT if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_VIR) { - if (BX_CPU_THIS_PTR guard_found.icount!=0) { + if ((BX_CPU_THIS_PTR guard_found.icount!=0) || + (tt != BX_CPU_THIS_PTR guard_found.time_tick)) { for (unsigned i=0; i