Path: 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 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."