Hi all, (moving this from gdb@, also at http://sources.redhat.com/ml/gdb/2006-11/msg00140.html) Daniel Jacobowitz escreveu: > On Sat, Nov 18, 2006 at 03:31:32PM +0000, Pedro Alves wrote: >> .loc 1 15 0 >> pushl %ebp >> LCFI0: >> movl $16, %eax >> movl %esp, %ebp >> LCFI1: >> subl $8, %esp >> LCFI2: >> .loc 1 15 0 >> andl $-16, %esp >> call __alloca >> call ___main >> .loc 1 17 0 > >> What do you think could be done to fix this? >> Is it the .loc directives that are being output wrong? Or is it gdb's >> prologue reader >> (if there is such a thing) that is missing the fact that __main is not >> user code? > > Probably both. The second line number marker normally marks the end of > the prologue, so GCC is wrong, and GDB might have to be taught about > _alloca and __main. > The i386 targets currently don't look at line number markers or the symbol table at all in i386_skip_prologue. I used the attached patch to test the gcc side of the fix, (http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00633.html) With the gcc patch above applied, this patch fixes all the runto_main issues on Cygwin. There are a few other FAILs related to breakpoints and main, but those are testsuite bugs, unrelated to this. I will send patches for those shortly. This are my current Cygwin/i386 results: === gdb Summary === # of expected passes 9897 # of unexpected failures 423 # of unexpected successes 1 # of expected failures 45 # of unknown successes 3 # of known failures 60 # of unresolved testcases 1 # of untested testcases 12 # of unsupported tests 26 (A lot of those seem to be signals related. I guess there are only a couple of bugs producing all of those failures.) Cheers, Pedro Alves --- 2006-12-09 Pedro Alves * i386-tdep.c (i386_skip_prologue): Try to find the end of the prologue using the symbol table.