This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: 3 debug hooks for begin_function


Richard Henderson wrote:-

> I wouldn't assume that.  You'd need to run the gdb testsuite
> on such a host to verify.  I suspect, in fact, that the change
> would cause the "break in function, check line number, next,
> check line number" type tests to fail.

Hmm.

> >    It seems clearer
> >    than the alternative of moving the output_source_line() calls into the
> >    hooks, which would necessarily include the do_nothing hook.
> 
> No, don't think of adding such to a do_nothing hook.  Instead
> you'd add new functions to whichever formats needed it.

Right, but my point is that the write_symbols==NO_DEBUG variety
currently outputs a line number, too.  The old code was quite kludgy,
which is why I'm struggling to replace it.  Also, output_source_line()
is local to final.c, and takes an rtx that is not passed to the hook,
so calling it from the hook functions is not particularly nice.

How about a different approach.  We have the begin_prologue() hook
return a boolean, which indicates whether to follow up with outputting
a source line?  In other words, in final.c, it becomes

  if ((*debug_hooks->begin_prologue) (last_linenum)
	&& NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
    output_source_line (first);

Then the do_nothing hook and dwarf2 return 1, and sdb and xcoff return
0.

Is that acceptable?  (It's a lot cleaner than anything else I can
think of).

Neil.


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