This is the mail archive of the
mailing list for the GCC project.
Re: 3 debug hooks for begin_function
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Subject: Re: 3 debug hooks for begin_function
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 16 Jul 2001 22:31:39 +0100
Richard Henderson wrote:-
> Ah. I hadn't looked at this function before. Gross.
> The good news is that this is mostly related to the -a option,
> which I want very much to remove. Humourously, the confusion
> here also results in -a being broken for SDB and XCOFF, since
> we weren't calling output_source_line, which does more than
> just output a source line.
OK, I thought this whole thing looked fishy. It's good that we're
catching this stuff - conditional compilation makes it too easy to
obscure a lot of nasties.
> So, what I think you ought to do is:
> (1) Rename output_source_line to notice_source_line, and delete
> the call to debug_hooks->source_line.
> (2) Change the only other caller of output_source_line to invoke
> both notice_source_line and debug_hooks->source_line.
> (3) Change debug_hooks->source_line to take the line number directly
> instead of via a note. Notice _all_ versions just immediately
> grab the line number from the note and otherwise ignore it.
Sadly not - xcoffout.c's version uses RTX_INTEGRATED_P (note) --
something to do with inlined functions -- which is why I'd left the
rtx alone. Is there an easy way to elide this? e.g. maybe it always
true or false, xcoffout shouldn't really care, or it is determinable
some other way from xcoffout.c? If not, we'll need to stick to the
RTX or have an extra parameter.
> (4) Change the begin_prologue hook to take the filename as well
> as line number. Have begin_prologue call debug_hooks->source_line
> (or the direct equivalent) itself if desired.
> Note that this gives begin_prologue the same interface as
> source_line, so you don't need a do_nothing function. Put,
> for example, dbxout_source_line in the begin_prologue slot.
> (5) This leaves the beginning of final_start_function looking like
> /* Initial line number is supposed to be output before the function's
> prologue and label so that the function's address will not appear
> to be in the last statement of the preceding function. The actual
> line number debug output is done in debug_hooks->begin_prologue. */
> if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
> notice_source_line (first);
> high_block_linenum = high_function_linenum = last_linenum;
> (*debug_hooks->begin_prologue) (last_filename, last_linenum);
> #if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
> if (write_symbols != DWARF2_DEBUG && dwarf2out_do_frame ())
> dwarf2out_begin_prologue (NULL, 0);
If you can answer my question above, I'll try and implement this.
Thanks for your help,