Mail Archives: djgpp/1996/08/21/11:41:13
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...
- Raw text -