www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/28/19:08:11

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199602282348.AA196631316@relay1.geis.com>
Date: Wed, 28 Feb 96 23:26:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: GDB discovers another one!

Reply to message 8383744    from ELIZ AT IS DOT ELTA. on 02/28/96  3:07AM


> By default, there is a 256K-long stack.  Anybody who uses 250K for local
> variables, should set _stklen to an appropriate value (see the FAQ for
> details), even before the program is run the first time.  For that matter,
> when you write a program which uses so much stack space, you should worry
> in *any* environment (IMHO) and check whether such high stack space
> consumption is at all possible.

Actually, I never truly realized how much stack space that function consumed
until I
began debugging it.  The code had been around long before I began tinkering
with it.  :)

Thanks for the advice on looking in the FAQ.  I'll be sure to check on that.

Question:  If I stubedit the executable, but run it thru 'redir' or 'gdb', does
the program
use its own stubedited values or those of 'redir' and 'gdb'?  I think I know
the
answer, but I want to be sure.

---

I just tried recompiling the program using the hints in the FAQ and ran into
some
problems.  The FAQ tells me to use the following line in my program:

extern unsigned _stklen = 1048576;    (or whatever stack size you want)

But when I put it in the main header file for my program, I got the following
warning
in each of the program files:

in file included with [file].c
merc.h: 1996: warning: '_stklen' initialized and declared extern

Then, I got the following linker error, one for each program file:

multiple definition of '_stklen'

Now, if I am not mistaken, those errors are all genuinely valid, and lead me to
question the validity of the FAQ's solution.  My program is composed of about
20 separate program files, so obviously I can't define _stklen in all of them!.
The FAQ says that simply stubediting the program is a "bad" way to increase
the stack size, so what should I really be doing here?

Thanks

John

- Raw text -


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