From a21018e1dbd9370168db1131a49932ee380dc387 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Thu, 30 Sep 2004 16:50:03 +0000 Subject: [PATCH] Fixed bug [ 766020 ] info registers / dump_cpu get old eflags --- bochs/cpu/debugstuff.cc | 8 ++------ bochs/cpu/flag_ctrl_pro.cc | 16 +++++++--------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/bochs/cpu/debugstuff.cc b/bochs/cpu/debugstuff.cc index 651e67420..00a79edee 100644 --- a/bochs/cpu/debugstuff.cc +++ b/bochs/cpu/debugstuff.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: debugstuff.cc,v 1.31 2003-12-24 20:32:59 sshwarts Exp $ +// $Id: debugstuff.cc,v 1.32 2004-09-30 16:50:03 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -321,15 +321,12 @@ BX_CPU_C::dbg_query_pending(void) return(ret); } - - Bit32u BX_CPU_C::dbg_get_eflags(void) { - return(BX_CPU_THIS_PTR eflags.val32); + return (BX_CPU_THIS_PTR read_eflags()); } - Bit32u BX_CPU_C::dbg_get_descriptor_l(bx_descriptor_t *d) { @@ -666,7 +663,6 @@ BX_CPU_C::dbg_set_cpu(bx_dbg_cpu_t *cpu) EIP = cpu->eip; - // CS: BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value = cpu->cs.sel; BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.index = cpu->cs.sel >> 3; diff --git a/bochs/cpu/flag_ctrl_pro.cc b/bochs/cpu/flag_ctrl_pro.cc index 444c9b060..31bcf9ff1 100644 --- a/bochs/cpu/flag_ctrl_pro.cc +++ b/bochs/cpu/flag_ctrl_pro.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: flag_ctrl_pro.cc,v 1.15 2004-08-13 20:00:03 sshwarts Exp $ +// $Id: flag_ctrl_pro.cc,v 1.16 2004-09-30 16:50:03 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -95,9 +95,7 @@ BX_CPU_C::write_eflags(Bit32u eflags_raw, bx_bool change_IOPL, bx_bool change_IF } #endif /* BX_CPU_LEVEL >= 3 */ - - Bit16u -BX_CPU_C::read_flags(void) +Bit16u BX_CPU_C::read_flags(void) { Bit16u flags16; @@ -109,7 +107,8 @@ BX_CPU_C::read_flags(void) (void) get_ZF(); (void) get_SF(); (void) get_OF(); - } + } + flags16 = (Bit16u) BX_CPU_THIS_PTR eflags.val32; /* 8086: bits 12-15 always set to 1. @@ -129,10 +128,8 @@ BX_CPU_C::read_flags(void) return(flags16); } - #if BX_CPU_LEVEL >= 3 - Bit32u -BX_CPU_C::read_eflags(void) +Bit32u BX_CPU_C::read_eflags(void) { Bit32u flags32; @@ -144,7 +141,8 @@ BX_CPU_C::read_eflags(void) (void) get_ZF(); (void) get_SF(); (void) get_OF(); - } + } + flags32 = BX_CPU_THIS_PTR eflags.val32; #if 0