Date: Sun, 15 Mar 1998 16:22:12 +0200 (IST) From: Eli Zaretskii To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Re: Depth of printed traceback In-Reply-To: <199802011915.OAA20779@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sun, 1 Feb 1998, DJ Delorie wrote: > > Current version of dpmiexcp.c prints up to 10 levels of stack frames. Is > > there any particular reason to not bump this limit up, provided that we > > No reason. I think we just picked a number to prevent runaways with > corrupt stack frames. Here's the necessary patches: *** src/libc/go32/dpmiexcp.c~1 Sat Jan 17 17:43:40 1998 --- src/libc/go32/dpmiexcp.c Sat Mar 14 20:28:34 1998 *************** show_call_frame(void) *** 95,101 **** { unsigned *vbp, *vbp_new, *tos; unsigned veip; ! int max=0; tos = (unsigned *)__djgpp_selector_limit; vbp = (unsigned *)__djgpp_exception_state->__ebp; --- 95,106 ---- { unsigned *vbp, *vbp_new, *tos; unsigned veip; ! int max=_farpeekb(_dos_ds, 0x484) + 1; ! ! if (max < 10 || max > 75) /* sanity check */ ! max = 10; /* 10 worked for v2.0 and v2.01 */ ! else ! max -= 14; /* 12 lines of preamble + 2 for symify */ tos = (unsigned *)__djgpp_selector_limit; vbp = (unsigned *)__djgpp_exception_state->__ebp; *************** show_call_frame(void) *** 110,116 **** err("\r\n 0x"); itox(veip, 8); vbp = vbp_new; ! if (++max == 10) break; } err("\r\n"); --- 115,121 ---- err("\r\n 0x"); itox(veip, 8); vbp = vbp_new; ! if (--max <= 0) break; } err("\r\n");