This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Regressions problem (200 failures)


> The following might be relevant for this discussion:
> 
> The comment on symtab.c:find_function_start_sal() says:
> 
> /* Given a function symbol SYM, find the symtab and line for the start
>    of the function.
>    If the argument FUNFIRSTLINE is nonzero, we want the first line
>    of real code inside the function.  */
> 
> If you look at the implementation of find_function_start_sal() you'll
> see that it uses SKIP_PROLOGUE to skip over the function prologue if
> FUNFIRSTLINE is nonzero, and then chooses the next line after the
> prologue.  So GDB shouldn't have any problems with line notes for the
> prologue.

SKIP_PROLOGUE is very machine dependent and sometimes you can't get it right
(especially with optimization and instruction reordering). If GDB's
prologue skipping stops to early, then we are at the mercy of GCC to provide
us with the `correct' line note, and additional line notes in the prologue
will confuse GDB under these circumstances.

And if GCC puts a line note at the first instruction after the prologue, and
marks it with the line number of the opening brace, then GDB will
stop at the opening brace, which I would like to avoid at all cost, because
I find it confusing.

So there are actually two questions:
At which instruction should GCC put the first line note and which source line
number should be associated with the note.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]