This is the mail archive of the 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]
Other format: [Raw text]

Re: [RFC] Modify -g1 to produce line tables

On Wed, Feb 6, 2013 at 11:51 AM, Cary Coutant <> wrote:
> A long time ago, I proposed a -gmlt option to generate "minimal line
> tables" (basically -g1 + line tables):
> The consensus from that thread was that instead of a new option, we
> should just modify -g1 to produce line tables (the documented purpose
> of -g1 is to enable stack traces, and stack traces are much more
> useful with line numbers). I also proposed, and got no objection, that
> -g by itself should set the debugging level to 2 (i.e., -g1 -g should
> behave the same as -g1 -g2).
> Here, finally, is that patch again, reworked to generate line tables
> at -g1. I plan to commit this when Stage 1 reopens, but I'd like to
> verify that earlier consensus. I also plan to commit this to the
> google/main branch, and future merges will go more smoothly if what I
> put in google/main matches what eventually goes into trunk.

Hmm,  Stage 1 has been opened for a while now but I could not find
this patch has been committed yet.  Is there any plans to include this
patch?  It would be useful for Sanitizer and other uses.

Andrew Pinski

> -cary
> 2013-02-06   Cary Coutant  <>
> gcc/
>         * dwarf2out.c (want_pubnames): Don't do pubnames for -g1.
>         (add_linkage_name): Don't add linkage name for -g1.
>         (decls_for_scope): Process subblocks for -g1.
>         (dwarf2out_source_line): Output line tables for -g1.
>         (dwarf2out_finish): Likewise.
>         * tree-ssa-live.c (remove_unused_scope_block_p): Don't prune
>         unused scopes for -g1.
>         * opts.c (common_handle_option): Handle -g same as -g2.
>         * doc/invoke.texi: Update description for -g1.
> gcc/testsuite/
>         * gcc.dg/debug/dwarf2/mlt1.c: New test.
>         * gcc.dg/debug/dwarf2/mlt2.c: New test.

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