Xref: news2.mv.net comp.os.msdos.djgpp:7715 From: ps AT ocisgi7 DOT unizh DOT ch (Serge Pachkovsky) Newsgroups: comp.os.msdos.djgpp Subject: Re: -fomit-frame-pointer dangers: FIRE! Date: 21 Aug 1996 07:57:10 GMT Organization: University of Zurich, Switzerland Lines: 31 Message-ID: <4vefgm$304@rzunews.unizh.ch> References: <321A06F5 DOT 40E8 AT stud DOT warande DOT ruu DOT nl> NNTP-Posting-Host: ocisgi7.unizh.ch To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Elliott Oti (e DOT oti AT stud DOT warande DOT ruu DOT nl) wrote: : info says that using -fomit-frame-pointer prevents debugging on i386 machines : (never tried it meself), but I find Mark's question an interesting one. : I try to make my programs as Win-friendly as possible, and they crash : fairly often ( sound routines especially playing mods are the worst : culprits), but the switch has little to do with it. I now use it all : the time, as the extra register makes ALL the difference. Still -- where there's : smoke, there's fire . Only, where's the fire? Any of you guys seen fire? Oh, sure. Quite a lot of, actually ;-) The problem with -fomit-frame-pointer under DPMI is that it frees up an extra register (bp) for general use. x86 use SS: as the default selector when bp is used as an address base register, and if SS: happen to be unequal to DS:, and your data is in DS:, you lose with segmentation fault. So, as long all your pointers are to stack-based objects (or you are not using pointers at all) you are free to compile with -fomit-frame-pointer. It should be fairly easy to fix in gcc (just emit an extra ds: segment override if using bp as a base register and -fomit-frame-pointer is in effect). For all I know, it might have already been fixed (my experience with gcc on x86 ends some time around 2.6.3, and that's history by now). Regards, /Serge.P -- Russian guy from the Zurich university...