delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/06/06/04:00:50

Date: Sun, 6 Jun 1999 10:58:06 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com
Subject: Stack and transfer buffer size when debugging
Message-ID: <Pine.SUN.3.91.990606105723.16109C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

It turns out v2loadimage was still defaulting to a 256K stack size
when loading unstubified COFF files.  I changed that to take the stack
and the size of the transfer buffer from the debugger; this way, users
can get predictable results by stubediting the debugger.

Here are the diffs:

*** src/debug/common/v2load.c~0	Sun Aug 31 19:40:40 1997
--- src/debug/common/v2load.c	Fri Jun  4 21:22:42 1999
***************
*** 21,29 ****
--- 21,32 ----
  #include <sys/stat.h>
  #define SIMAGIC "go32stub"
  
+ #define __tb_size _go32_info_block.size_of_transfer_buffer
+ 
  AREAS areas[MAX_AREA];
  
  extern char **environ;
+ extern unsigned _stklen;
  
  static int read_section(int pf, unsigned ds, unsigned foffset, unsigned soffset, unsigned size)
  {
*************** int v2loadimage(const char *program, con
*** 89,96 ****
      coff_offset = 0;
      strcpy(si.magic, "go32stub, V 2.00");
      si.size = 0x44;
!     si.minstack = 0x40000;
!     si.minkeep = 16384;			/* transfer buffer size */
      memset(&si.basename, 0, 24);	/* Asciiz strings */
    }
    if (header[0] != 0x014c) {		/* COFF? */
--- 92,102 ----
      coff_offset = 0;
      strcpy(si.magic, "go32stub, V 2.00");
      si.size = 0x44;
!     /* The default size of the stack and the transfer buffer are taken
!        from the debugger's values, so that users could get predictable
!        results by stubediting the debugger.  */
!     si.minstack = _stklen;
!     si.minkeep = __tb_size;		/* transfer buffer size */
      memset(&si.basename, 0, 24);	/* Asciiz strings */
    }
    if (header[0] != 0x014c) {		/* COFF? */

- Raw text -


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