GCC for i386 does several optimization to allow correct pairing of instructions. This leads in particular to mix loading of constants into registers with usual prologue instructions. The major effect is that the backtrace shows some 'pseudo' trace levels, which are due to a failure to get the correct prologue. One of the nastiest effect of this is that if you use 'return' on that function, it sets a temporary breakpoint on a wrong location and you program continues without stopping when frame is left. I started to implement some code that tries to deal with that issue. Its far from perfect, but it gives already some result (when debugging GDB with itself compiled with -O2, it reduces the number of those false frame levels). This code might probably be used at several other position. All comments and suggestions welcome. 2001-12-02 Pierre Muller * i386-tdep.c (i386_skip_optimization_code): New function used to skip over code inserted by optimizer. (i386_get_frame_setup): Use i386_skip_optimization_code to enhance prologue detection.