delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/15/09:23:27

Date: Sun, 15 Mar 1998 16:22:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Depth of printed traceback
In-Reply-To: <199802011915.OAA20779@delorie.com>
Message-ID: <Pine.SUN.3.91.980315162102.9861X-100000@is>
MIME-Version: 1.0

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");

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019