From c6c04836e8ba3dafa0ad4216bb8a8569d31d04d3 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Sun, 9 May 1999 15:51:43 +0000 Subject: [PATCH] Fixed a couple of bugs (silent backtrace not totally silent, crashes when the stack is corrupted or similar). --- debugger/stack.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debugger/stack.c b/debugger/stack.c index 6888f30839e..82cd1e6a394 100644 --- a/debugger/stack.c +++ b/debugger/stack.c @@ -189,7 +189,8 @@ static void DEBUG_DoBackTrace(int noisy) nframe = 1; if (frames) DBG_free( frames ); frames = (struct bt_info *) DBG_alloc( sizeof(struct bt_info) ); - fprintf(stderr,"%s%d ",(curr_frame == 0 ? "=>" : " "), frameno); + if (noisy) + fprintf(stderr,"%s%d ",(curr_frame == 0 ? "=>" : " "), frameno); if (IS_SELECTOR_SYSTEM(ss)) ss = 0; if (IS_SELECTOR_SYSTEM(cs)) cs = 0; @@ -232,6 +233,10 @@ static void DEBUG_DoBackTrace(int noisy) sw_addr.seg = ss; sw_addr.off = cur_switch; } + if (DEBUG_IsBadReadPtr(&sw_addr,1)) { + sw_addr.seg = (DWORD)-1; + sw_addr.off = (DWORD)-1; + } for (ok = TRUE; ok;) { if ((frames[frameno].ss == sw_addr.seg) && @@ -269,6 +274,10 @@ static void DEBUG_DoBackTrace(int noisy) is16 = TRUE; } + if (DEBUG_IsBadReadPtr(&sw_addr,1)) { + sw_addr.seg = (DWORD)-1; + sw_addr.off = (DWORD)-1; + } } else { /* ordinary stack frame */ ok = is16 ? DEBUG_Frame16( &addr, &cs, ++frameno, noisy)