Commit c6c04836 authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

Fixed a couple of bugs (silent backtrace not totally silent, crashes

when the stack is corrupted or similar).
parent 1e1eb509
...@@ -189,7 +189,8 @@ static void DEBUG_DoBackTrace(int noisy) ...@@ -189,7 +189,8 @@ static void DEBUG_DoBackTrace(int noisy)
nframe = 1; nframe = 1;
if (frames) DBG_free( frames ); if (frames) DBG_free( frames );
frames = (struct bt_info *) DBG_alloc( sizeof(struct bt_info) ); 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(ss)) ss = 0;
if (IS_SELECTOR_SYSTEM(cs)) cs = 0; if (IS_SELECTOR_SYSTEM(cs)) cs = 0;
...@@ -232,6 +233,10 @@ static void DEBUG_DoBackTrace(int noisy) ...@@ -232,6 +233,10 @@ static void DEBUG_DoBackTrace(int noisy)
sw_addr.seg = ss; sw_addr.seg = ss;
sw_addr.off = cur_switch; 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;) { for (ok = TRUE; ok;) {
if ((frames[frameno].ss == sw_addr.seg) && if ((frames[frameno].ss == sw_addr.seg) &&
...@@ -269,6 +274,10 @@ static void DEBUG_DoBackTrace(int noisy) ...@@ -269,6 +274,10 @@ static void DEBUG_DoBackTrace(int noisy)
is16 = TRUE; is16 = TRUE;
} }
if (DEBUG_IsBadReadPtr(&sw_addr,1)) {
sw_addr.seg = (DWORD)-1;
sw_addr.off = (DWORD)-1;
}
} else { } else {
/* ordinary stack frame */ /* ordinary stack frame */
ok = is16 ? DEBUG_Frame16( &addr, &cs, ++frameno, noisy) ok = is16 ? DEBUG_Frame16( &addr, &cs, ++frameno, noisy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment