🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #347

Re: Strange System V/386 problem

#347
From: John R. Levine
Date: Wed, 24 Jan 1990 03:16
15 lines
1339 bytes
In article <1990Jan24.022138.12102@esegue.segue.boston.ma.us> johnl@esegue.segue.boston.ma.us (John R. Levine) writes:
>alloca will, being a good citizen, long-align the stack before it returns,
>after which everything works just fine.  ...

Oops, I should have checked more carefully.  If you compile gdb in the
obvious way with gcc you get the builtin alloca which just subtracts its
argument from the stack pointer without trying to align it.  So try the
following at the beginning of main(), just after the "register int i;".

  i = (int)&count & 0x3;
  if(i) alloca(4-i);	/* align the stack, a gross hack */
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650
johnl@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl
"Now, we are all jelly doughnuts."
Technical Details
Message-ID: <1990Jan24.031658.12945@esegue.segue.boston.ma.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!esegue!johnl
References: <1990Jan24.022138.12102@esegue.segue.boston.ma.us>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!esegue!johnl
From: johnl@esegue.segue.boston.ma.us (John R. Levine)
Newsgroups: gnu.gdb.bug
Subject: Re: Strange System V/386 problem
Message-ID: <1990Jan24.031658.12945@esegue.segue.boston.ma.us>
Date: 24 Jan 90 03:16:58 GMT
References: <1990Jan24.022138.12102@esegue.segue.boston.ma.us>
Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine)
Distribution: gnu
Organization: Segue Software, Cambridge MA
Lines: 15