From f0bf6139de804c4695d17376142c3fd250105a03 Mon Sep 17 00:00:00 2001 From: Alexander Krisak Date: Thu, 28 Aug 2008 10:57:37 +0000 Subject: [PATCH] debugger: command 'print-stack' in 32bit protected mode now use base of stack segment --- bochs/bx_debug/dbg_main.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bochs/bx_debug/dbg_main.cc b/bochs/bx_debug/dbg_main.cc index e6674dbb2..e1de0024a 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.156 2008-08-07 21:09:29 sshwarts Exp $ +// $Id: dbg_main.cc,v 1.157 2008-08-28 10:57:37 akrisak Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -1465,6 +1465,12 @@ 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 {