From d493e33659334ce3296cad8b3a6b87cebe2732cd Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 10 Jan 2010 14:11:53 +0000 Subject: [PATCH] print-stack fix --- bochs/bx_debug/dbg_main.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bochs/bx_debug/dbg_main.cc b/bochs/bx_debug/dbg_main.cc index 90b8461aa..599e8ee03 100644 --- a/bochs/bx_debug/dbg_main.cc +++ b/bochs/bx_debug/dbg_main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: dbg_main.cc,v 1.226 2010-01-09 20:28:07 sshwarts Exp $ +// $Id: dbg_main.cc,v 1.227 2010-01-10 14:11:53 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -1520,18 +1520,14 @@ void bx_dbg_print_stack_command(unsigned nwords) { if (BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.d_b) { linear_sp = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ESP); - - if (BX_CPU(dbg_cpu)->protected_mode()) { - linear_sp += BX_CPU(dbg_cpu)->sregs[BX_SEG_REG_SS].cache.u.segment.base; - linear_sp &= 0xffffffff; - } - len = 4; } else { linear_sp = BX_CPU(dbg_cpu)->get_reg16(BX_16BIT_REG_SP); len = 2; } + + linear_sp = BX_CPU(dbg_cpu)->get_laddr(BX_SEG_REG_SS, linear_sp); } Bit8u buf[8];