Message ID | 20170217185923.GS1849@tucnak |
---|---|
State | New |
Headers | show |
Looks fine. On Fri, Feb 17, 2017 at 1:59 PM, Jakub Jelinek <jakub@redhat.com> wrote: > Hi! > > And here is incremental patch to provide column information even in > .debug_line (whether through .loc directives or custom .debug_line). > The patch looks large, because I had to adjust the two hooks to pass > through the column information, but beyond that it is actually very simple. > > If the earlier patch is ok, would this be ok too (not bootstrapped yet, > going to regtest it soon)? > > 2017-02-17 Jakub Jelinek <jakub@redhat.com> > > * final.c (last_columnnum, override_columnnum): New variables. > (final_start_function): Set last_columnnum, pass it to begin_prologue > hook and pass 0 to dwarf2out_begin_prologue. > (final_scan_insn): Update override_columnnum. Pass last_columnnum > to source_line debug hook. > (notice_source_line): Compute last_columnnum and for debug_column_info > return true on column changes. > * debug.h (struct gcc_debug_hooks): Add column argument to > source_line and begin_prologue hooks. > (debug_nothing_int_charstar_int_bool): Remove prototype. > (debug_nothing_int_int_charstar, > debug_nothing_int_int_charstar_int_bool): New prototypes. > (dwarf2out_begin_prologue): Add column argument. > * debug.c (do_nothing_debug_hooks): Adjust source_line and > begin_prologue hooks. > (debug_nothing_int_charstar_int_bool): Remove. > (debug_nothing_int_int_charstar, > debug_nothing_int_int_charstar_int_bool): New functions. > * dwarf2out.c (dwarf2out_begin_prologue): Add column argument, pass it > through to dwarf2out_source_line. > (dwarf2_lineno_debug_hooks): Adjust begin_prologue hook. > (dwarf2out_source_line): Add column argument, emit it if requested. > * sdbout.c (sdbout_source_line, sdbout_begin_prologue): Add column > arguments. > * xcoffout.h (xcoffout_begin_prologue, xcoffout_source_line): Likewise. > * xcoffout.c (xcoffout_begin_prologue, xcoffout_source_line): Likewise. > * vmsdbgout.c (vmsdbgout_begin_prologue): Add column argument, pass it > through to dwarf2out_begin_prologue. > (vmsdbgout_source_line): Add column argument, pass it through to > dwarf2out_source_line. > * dbxout.c (dbxout_begin_prologue): Add column argument, adjust > dbxout_source_line caller. > (dbxout_source_line): Add column argument. > > --- gcc/final.c.jj 2017-01-24 23:29:07.000000000 +0100 > +++ gcc/final.c 2017-02-17 19:13:39.504406149 +0100 > @@ -118,6 +118,9 @@ rtx_insn *current_output_insn; > /* Line number of last NOTE. */ > static int last_linenum; > > +/* Column number of last NOTE. */ > +static int last_columnnum; > + > /* Last discriminator written to assembly. */ > static int last_discriminator; > > @@ -133,9 +136,10 @@ static int high_function_linenum; > /* Filename of last NOTE. */ > static const char *last_filename; > > -/* Override filename and line number. */ > +/* Override filename, line and column number. */ > static const char *override_filename; > static int override_linenum; > +static int override_columnnum; > > /* Whether to force emission of a line note before the next insn. */ > static bool force_source_line = false; > @@ -1763,6 +1767,7 @@ final_start_function (rtx_insn *first, F > > last_filename = LOCATION_FILE (prologue_location); > last_linenum = LOCATION_LINE (prologue_location); > + last_columnnum = LOCATION_COLUMN (prologue_location); > last_discriminator = discriminator = 0; > > high_block_linenum = high_function_linenum = last_linenum; > @@ -1771,10 +1776,10 @@ final_start_function (rtx_insn *first, F > asan_function_start (); > > if (!DECL_IGNORED_P (current_function_decl)) > - debug_hooks->begin_prologue (last_linenum, last_filename); > + debug_hooks->begin_prologue (last_linenum, last_columnnum, last_filename); > > if (!dwarf2_debug_info_emitted_p (current_function_decl)) > - dwarf2out_begin_prologue (0, NULL); > + dwarf2out_begin_prologue (0, 0, NULL); > > #ifdef LEAF_REG_REMAP > if (crtl->uses_only_leaf_regs) > @@ -2335,6 +2340,7 @@ final_scan_insn (rtx_insn *insn, FILE *f > { > override_filename = LOCATION_FILE (*locus_ptr); > override_linenum = LOCATION_LINE (*locus_ptr); > + override_columnnum = LOCATION_COLUMN (*locus_ptr); > } > } > break; > @@ -2370,11 +2376,13 @@ final_scan_insn (rtx_insn *insn, FILE *f > { > override_filename = LOCATION_FILE (*locus_ptr); > override_linenum = LOCATION_LINE (*locus_ptr); > + override_columnnum = LOCATION_COLUMN (*locus_ptr); > } > else > { > override_filename = NULL; > override_linenum = 0; > + override_columnnum = 0; > } > } > break; > @@ -2592,8 +2600,9 @@ final_scan_insn (rtx_insn *insn, FILE *f > { > if (flag_verbose_asm) > asm_show_source (last_filename, last_linenum); > - (*debug_hooks->source_line) (last_linenum, last_filename, > - last_discriminator, is_stmt); > + (*debug_hooks->source_line) (last_linenum, last_columnnum, > + last_filename, last_discriminator, > + is_stmt); > } > > if (GET_CODE (body) == PARALLEL > @@ -3078,23 +3087,26 @@ static bool > notice_source_line (rtx_insn *insn, bool *is_stmt) > { > const char *filename; > - int linenum; > + int linenum, columnnum; > > if (override_filename) > { > filename = override_filename; > linenum = override_linenum; > + columnnum = override_columnnum; > } > else if (INSN_HAS_LOCATION (insn)) > { > expanded_location xloc = insn_location (insn); > filename = xloc.file; > linenum = xloc.line; > + columnnum = xloc.column; > } > else > { > filename = NULL; > linenum = 0; > + columnnum = 0; > } > > if (filename == NULL) > @@ -3102,11 +3114,13 @@ notice_source_line (rtx_insn *insn, bool > > if (force_source_line > || filename != last_filename > - || last_linenum != linenum) > + || last_linenum != linenum > + || (debug_column_info && last_columnnum != columnnum)) > { > force_source_line = false; > last_filename = filename; > last_linenum = linenum; > + last_columnnum = columnnum; > last_discriminator = discriminator; > *is_stmt = true; > high_block_linenum = MAX (last_linenum, high_block_linenum); > --- gcc/debug.h.jj 2017-01-01 12:45:37.000000000 +0100 > +++ gcc/debug.h 2017-02-17 19:10:55.919495624 +0100 > @@ -65,13 +65,14 @@ struct gcc_debug_hooks > though the BLOCK information is messed up. Defaults to true. */ > bool (* ignore_block) (const_tree); > > - /* Record a source file location at (FILE, LINE, DISCRIMINATOR). */ > - void (* source_line) (unsigned int line, const char *file, > - int discriminator, bool is_stmt); > + /* Record a source file location at (FILE, LINE, COLUMN, DISCRIMINATOR). */ > + void (* source_line) (unsigned int line, unsigned int column, > + const char *file, int discriminator, bool is_stmt); > > /* Called at start of prologue code. LINE is the first line in the > function. */ > - void (* begin_prologue) (unsigned int line, const char *file); > + void (* begin_prologue) (unsigned int line, unsigned int column, > + const char *file); > > /* Called at end of prologue code. LINE is the first line in the > function. */ > @@ -193,9 +194,13 @@ extern const struct gcc_debug_hooks *deb > /* The do-nothing hooks. */ > extern void debug_nothing_void (void); > extern void debug_nothing_charstar (const char *); > +extern void debug_nothing_int_int_charstar (unsigned int, unsigned int, > + const char *); > extern void debug_nothing_int_charstar (unsigned int, const char *); > -extern void debug_nothing_int_charstar_int_bool (unsigned int, const char *, > - int, bool); > +extern void debug_nothing_int_int_charstar_int_bool (unsigned int, > + unsigned int, > + const char *, > + int, bool); > extern void debug_nothing_int (unsigned int); > extern void debug_nothing_int_int (unsigned int, unsigned int); > extern void debug_nothing_tree (tree); > @@ -217,7 +222,8 @@ extern const struct gcc_debug_hooks vmsd > > /* Dwarf2 frame information. */ > > -extern void dwarf2out_begin_prologue (unsigned int, const char *); > +extern void dwarf2out_begin_prologue (unsigned int, unsigned int, > + const char *); > extern void dwarf2out_vms_end_prologue (unsigned int, const char *); > extern void dwarf2out_vms_begin_epilogue (unsigned int, const char *); > extern void dwarf2out_end_epilogue (unsigned int, const char *); > --- gcc/debug.c.jj 2017-01-01 12:45:35.000000000 +0100 > +++ gcc/debug.c 2017-02-17 19:14:10.010016500 +0100 > @@ -35,8 +35,8 @@ const struct gcc_debug_hooks do_nothing_ > debug_nothing_int_int, /* begin_block */ > debug_nothing_int_int, /* end_block */ > debug_true_const_tree, /* ignore_block */ > - debug_nothing_int_charstar_int_bool, /* source_line */ > - debug_nothing_int_charstar, /* begin_prologue */ > + debug_nothing_int_int_charstar_int_bool, /* source_line */ > + debug_nothing_int_int_charstar, /* begin_prologue */ > debug_nothing_int_charstar, /* end_prologue */ > debug_nothing_int_charstar, /* begin_epilogue */ > debug_nothing_int_charstar, /* end_epilogue */ > @@ -115,10 +115,18 @@ debug_nothing_int_charstar (unsigned int > } > > void > -debug_nothing_int_charstar_int_bool (unsigned int line ATTRIBUTE_UNUSED, > - const char *text ATTRIBUTE_UNUSED, > - int discriminator ATTRIBUTE_UNUSED, > - bool is_stmt ATTRIBUTE_UNUSED) > +debug_nothing_int_int_charstar (unsigned int line ATTRIBUTE_UNUSED, > + unsigned int column ATTRIBUTE_UNUSED, > + const char *text ATTRIBUTE_UNUSED) > +{ > +} > + > +void > +debug_nothing_int_int_charstar_int_bool (unsigned int line ATTRIBUTE_UNUSED, > + unsigned int column ATTRIBUTE_UNUSED, > + const char *text ATTRIBUTE_UNUSED, > + int discriminator ATTRIBUTE_UNUSED, > + bool is_stmt ATTRIBUTE_UNUSED) > { > } > > --- gcc/dwarf2out.c.jj 2017-02-17 18:29:53.000000000 +0100 > +++ gcc/dwarf2out.c 2017-02-17 19:10:26.481871631 +0100 > @@ -93,7 +93,8 @@ along with GCC; see the file COPYING3. > #include "gdb/gdb-index.h" > #include "rtl-iter.h" > > -static void dwarf2out_source_line (unsigned int, const char *, int, bool); > +static void dwarf2out_source_line (unsigned int, unsigned int, const char *, > + int, bool); > static rtx_insn *last_var_location_insn; > static rtx_insn *cached_next_real_insn; > static void dwarf2out_decl (tree); > @@ -1023,6 +1024,7 @@ dwarf2out_alloc_current_fde (void) > > void > dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, > + unsigned int column ATTRIBUTE_UNUSED, > const char *file ATTRIBUTE_UNUSED) > { > char label[MAX_ARTIFICIAL_LABEL_BYTES]; > @@ -1073,7 +1075,7 @@ dwarf2out_begin_prologue (unsigned int l > prologue case, not the eh frame case. */ > #ifdef DWARF2_DEBUGGING_INFO > if (file) > - dwarf2out_source_line (line, file, 0, true); > + dwarf2out_source_line (line, column, file, 0, true); > #endif > > if (dwarf2out_do_cfi_asm ()) > @@ -1099,7 +1101,7 @@ dwarf2out_begin_prologue (unsigned int l > > void > dwarf2out_vms_end_prologue (unsigned int line ATTRIBUTE_UNUSED, > - const char *file ATTRIBUTE_UNUSED) > + const char *file ATTRIBUTE_UNUSED) > { > char label[MAX_ARTIFICIAL_LABEL_BYTES]; > > @@ -2733,7 +2735,7 @@ const struct gcc_debug_hooks dwarf2_line > debug_nothing_int_int, /* end_block */ > debug_true_const_tree, /* ignore_block */ > dwarf2out_source_line, /* source_line */ > - debug_nothing_int_charstar, /* begin_prologue */ > + debug_nothing_int_int_charstar, /* begin_prologue */ > debug_nothing_int_charstar, /* end_prologue */ > debug_nothing_int_charstar, /* begin_epilogue */ > debug_nothing_int_charstar, /* end_epilogue */ > @@ -26534,7 +26536,8 @@ push_dw_line_info_entry (dw_line_info_ta > /* ??? The discriminator parameter ought to be unsigned. */ > > static void > -dwarf2out_source_line (unsigned int line, const char *filename, > +dwarf2out_source_line (unsigned int line, unsigned int column, > + const char *filename, > int discriminator, bool is_stmt) > { > unsigned int file_num; > @@ -26548,6 +26551,9 @@ dwarf2out_source_line (unsigned int line > if (dwarf_version < 4 && dwarf_strict) > discriminator = 0; > > + if (!debug_column_info) > + column = 0; > + > table = cur_line_info_table; > file_num = maybe_emit_file (lookup_filename (filename)); > > @@ -26567,6 +26573,7 @@ dwarf2out_source_line (unsigned int line > > if (0 && file_num == table->file_num > && line == table->line_num > + && column == table->column_num > && discriminator == table->discrim_num > && is_stmt == table->is_stmt) > return; > @@ -26575,7 +26582,14 @@ dwarf2out_source_line (unsigned int line > > /* If requested, emit something human-readable. */ > if (flag_debug_asm) > - fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, filename, line); > + { > + if (debug_column_info) > + fprintf (asm_out_file, "\t%s %s:%d:%d\n", ASM_COMMENT_START, > + filename, line, column); > + else > + fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, > + filename, line); > + } > > if (DWARF2_ASM_LINE_DEBUG_INFO) > { > @@ -26587,7 +26601,10 @@ dwarf2out_source_line (unsigned int line > putc (' ', asm_out_file); > fprint_ul (asm_out_file, line); > putc (' ', asm_out_file); > - putc ('0', asm_out_file); > + if (debug_column_info) > + fprint_ul (asm_out_file, column); > + else > + putc ('0', asm_out_file); > > if (is_stmt != table->is_stmt) > { > @@ -26616,10 +26633,13 @@ dwarf2out_source_line (unsigned int line > if (is_stmt != table->is_stmt) > push_dw_line_info_entry (table, LI_negate_stmt, 0); > push_dw_line_info_entry (table, LI_set_line, line); > + if (debug_column_info) > + push_dw_line_info_entry (table, LI_set_column, column); > } > > table->file_num = file_num; > table->line_num = line; > + table->column_num = column; > table->discrim_num = discriminator; > table->is_stmt = is_stmt; > table->in_use = true; > --- gcc/sdbout.c.jj 2017-01-01 12:45:35.000000000 +0100 > +++ gcc/sdbout.c 2017-02-17 19:12:27.526325527 +0100 > @@ -116,11 +116,13 @@ static void sdbout_start_source_file (un > static void sdbout_end_source_file (unsigned int); > static void sdbout_begin_block (unsigned int, unsigned int); > static void sdbout_end_block (unsigned int, unsigned int); > -static void sdbout_source_line (unsigned int, const char *, int, bool); > +static void sdbout_source_line (unsigned int, unsigned int, > + const char *, int, bool); > static void sdbout_end_epilogue (unsigned int, const char *); > static void sdbout_early_global_decl (tree); > static void sdbout_late_global_decl (tree); > -static void sdbout_begin_prologue (unsigned int, const char *); > +static void sdbout_begin_prologue (unsigned int, unsigned int, > + const char *); > static void sdbout_end_prologue (unsigned int, const char *); > static void sdbout_begin_function (tree); > static void sdbout_end_function (unsigned int); > @@ -1519,7 +1521,8 @@ sdbout_end_block (unsigned int line, uns > number LINE. */ > > static void > -sdbout_source_line (unsigned int line, const char *filename ATTRIBUTE_UNUSED, > +sdbout_source_line (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, > + const char *filename ATTRIBUTE_UNUSED, > int discriminator ATTRIBUTE_UNUSED, > bool is_stmt ATTRIBUTE_UNUSED) > { > @@ -1551,7 +1554,8 @@ sdbout_begin_function (tree decl ATTRIBU > describe the parameter list. */ > > static void > -sdbout_begin_prologue (unsigned int line, const char *file ATTRIBUTE_UNUSED) > +sdbout_begin_prologue (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, > + const char *file ATTRIBUTE_UNUSED) > { > sdbout_end_prologue (line, file); > } > --- gcc/xcoffout.h.jj 2017-01-01 12:45:34.000000000 +0100 > +++ gcc/xcoffout.h 2017-02-17 18:31:11.961331304 +0100 > @@ -181,13 +181,14 @@ do { \ > /* Prototype functions in xcoffout.c. */ > > extern int stab_to_sclass (int); > -extern void xcoffout_begin_prologue (unsigned int, const char *); > +extern void xcoffout_begin_prologue (unsigned int, unsigned int, const char *); > extern void xcoffout_begin_block (unsigned, unsigned); > extern void xcoffout_end_epilogue (unsigned int, const char *); > extern void xcoffout_end_function (unsigned int); > extern void xcoffout_end_block (unsigned, unsigned); > extern int xcoff_assign_fundamental_type_number (tree); > extern void xcoffout_declare_function (FILE *, tree, const char *); > -extern void xcoffout_source_line (unsigned int, const char *, int, bool); > +extern void xcoffout_source_line (unsigned int, unsigned int, const char *, > + int, bool); > > #endif /* GCC_XCOFFOUT_H */ > --- gcc/xcoffout.c.jj 2017-01-01 12:45:39.000000000 +0100 > +++ gcc/xcoffout.c 2017-02-17 18:36:30.399361015 +0100 > @@ -327,8 +327,8 @@ xcoffout_source_file (FILE *file, const > /* Output a line number symbol entry for location (FILENAME, LINE). */ > > void > -xcoffout_source_line (unsigned int line, const char *filename, > - int discriminator ATTRIBUTE_UNUSED, > +xcoffout_source_line (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, > + const char *filename, int discriminator ATTRIBUTE_UNUSED, > bool is_stmt ATTRIBUTE_UNUSED) > { > bool inline_p = (strcmp (xcoff_current_function_file, filename) != 0 > @@ -446,6 +446,7 @@ xcoffout_declare_function (FILE *file, t > > void > xcoffout_begin_prologue (unsigned int line, > + unsigned int column ATTRIBUTE_UNUSED, > const char *file ATTRIBUTE_UNUSED) > { > ASM_OUTPUT_LFB (asm_out_file, line); > --- gcc/vmsdbgout.c.jj 2017-01-01 12:45:39.000000000 +0100 > +++ gcc/vmsdbgout.c 2017-02-17 19:13:08.489802300 +0100 > @@ -155,9 +155,11 @@ static void vmsdbgout_end_source_file (u > static void vmsdbgout_begin_block (unsigned int, unsigned int); > static void vmsdbgout_end_block (unsigned int, unsigned int); > static bool vmsdbgout_ignore_block (const_tree); > -static void vmsdbgout_source_line (unsigned int, const char *, int, bool); > +static void vmsdbgout_source_line (unsigned int, unsigned int, const char *, > + int, bool); > static void vmsdbgout_write_source_line (unsigned, const char *, int , bool); > -static void vmsdbgout_begin_prologue (unsigned int, const char *); > +static void vmsdbgout_begin_prologue (unsigned int, unsigned int, > + const char *); > static void vmsdbgout_end_prologue (unsigned int, const char *); > static void vmsdbgout_end_function (unsigned int); > static void vmsdbgout_begin_epilogue (unsigned int, const char *); > @@ -1114,12 +1116,13 @@ write_srccorrs (int dosizeonly) > the prologue. */ > > static void > -vmsdbgout_begin_prologue (unsigned int line, const char *file) > +vmsdbgout_begin_prologue (unsigned int line, unsigned int column, > + const char *file) > { > char label[MAX_ARTIFICIAL_LABEL_BYTES]; > > if (write_symbols == VMS_AND_DWARF2_DEBUG) > - (*dwarf2_debug_hooks.begin_prologue) (line, file); > + (*dwarf2_debug_hooks.begin_prologue) (line, column, file); > > if (debug_info_level > DINFO_LEVEL_NONE) > { > @@ -1397,11 +1400,13 @@ vmsdbgout_write_source_line (unsigned li > } > > static void > -vmsdbgout_source_line (register unsigned line, register const char *filename, > +vmsdbgout_source_line (register unsigned line, unsigned int column, > + register const char *filename, > int discriminator, bool is_stmt) > { > if (write_symbols == VMS_AND_DWARF2_DEBUG) > - (*dwarf2_debug_hooks.source_line) (line, filename, discriminator, is_stmt); > + (*dwarf2_debug_hooks.source_line) (line, column, filename, discriminator, > + is_stmt); > > if (debug_info_level >= DINFO_LEVEL_TERSE) > vmsdbgout_write_source_line (line, filename, discriminator, is_stmt); > --- gcc/dbxout.c.jj 2017-01-01 12:45:36.000000000 +0100 > +++ gcc/dbxout.c 2017-02-17 19:09:20.718711626 +0100 > @@ -332,8 +332,9 @@ static void debug_free_queue (void); > /* The debug hooks structure. */ > #if defined (DBX_DEBUGGING_INFO) > > -static void dbxout_source_line (unsigned int, const char *, int, bool); > -static void dbxout_begin_prologue (unsigned int, const char *); > +static void dbxout_source_line (unsigned int, unsigned int, const char *, > + int, bool); > +static void dbxout_begin_prologue (unsigned int, unsigned int, const char *); > static void dbxout_source_file (const char *); > static void dbxout_function_end (tree); > static void dbxout_begin_function (tree); > @@ -1241,7 +1242,9 @@ dbxout_source_file (const char *filename > function scope */ > > static void > -dbxout_begin_prologue (unsigned int lineno, const char *filename) > +dbxout_begin_prologue (unsigned int lineno, > + unsigned int column ATTRIBUTE_UNUSED, > + const char *filename) > { > if (use_gnu_debug_info_extensions > && !NO_DBX_FUNCTION_END > @@ -1252,7 +1255,7 @@ dbxout_begin_prologue (unsigned int line > /* pre-increment the scope counter */ > scope_labelno++; > > - dbxout_source_line (lineno, filename, 0, true); > + dbxout_source_line (lineno, 0, filename, 0, true); > /* Output function begin block at function scope, referenced > by dbxout_block, dbxout_source_line and dbxout_function_end. */ > emit_pending_bincls_if_required (); > @@ -1263,8 +1266,8 @@ dbxout_begin_prologue (unsigned int line > number LINENO. */ > > static void > -dbxout_source_line (unsigned int lineno, const char *filename, > - int discriminator ATTRIBUTE_UNUSED, > +dbxout_source_line (unsigned int lineno, unsigned int column ATTRIBUTE_UNUSED, > + const char *filename, int discriminator ATTRIBUTE_UNUSED, > bool is_stmt ATTRIBUTE_UNUSED) > { > dbxout_source_file (filename); > > Jakub
On Fri, Feb 17, 2017 at 09:33:07PM -0500, Jason Merrill wrote:
> Looks fine.
Passed bootstrap/regtest, I've committed both -gcolumn-info patches; thanks
for review.
Comparing the cc1plus debug info sizes between standard bootstrap and
one with hacked default -gcolumn-info shows:
-gno-column-info (default):
[31] .debug_info PROGBITS 0000000000000000 1d9e948 5ae23f3 00 0 0 1
[32] .debug_abbrev PROGBITS 0000000000000000 7880d3b 1b1dac 00 0 0 1
[33] .debug_line PROGBITS 0000000000000000 7a32ae7 68ab1b 00 0 0 1
-gcolumn-info:
[31] .debug_info PROGBITS 0000000000000000 1d9e948 5d72ddb 00 0 0 1
[32] .debug_abbrev PROGBITS 0000000000000000 7b11723 1d9ec9 00 0 0 1
[33] .debug_line PROGBITS 0000000000000000 7ceb5ec 9bf412 00 0 0 1
All other sections have the same size.
So it is 2.8% growth in .debug_info, 9.2% growth in .debug_abbrev and 49%
growth in .debug_line.
Jakub
--- gcc/final.c.jj 2017-01-24 23:29:07.000000000 +0100 +++ gcc/final.c 2017-02-17 19:13:39.504406149 +0100 @@ -118,6 +118,9 @@ rtx_insn *current_output_insn; /* Line number of last NOTE. */ static int last_linenum; +/* Column number of last NOTE. */ +static int last_columnnum; + /* Last discriminator written to assembly. */ static int last_discriminator; @@ -133,9 +136,10 @@ static int high_function_linenum; /* Filename of last NOTE. */ static const char *last_filename; -/* Override filename and line number. */ +/* Override filename, line and column number. */ static const char *override_filename; static int override_linenum; +static int override_columnnum; /* Whether to force emission of a line note before the next insn. */ static bool force_source_line = false; @@ -1763,6 +1767,7 @@ final_start_function (rtx_insn *first, F last_filename = LOCATION_FILE (prologue_location); last_linenum = LOCATION_LINE (prologue_location); + last_columnnum = LOCATION_COLUMN (prologue_location); last_discriminator = discriminator = 0; high_block_linenum = high_function_linenum = last_linenum; @@ -1771,10 +1776,10 @@ final_start_function (rtx_insn *first, F asan_function_start (); if (!DECL_IGNORED_P (current_function_decl)) - debug_hooks->begin_prologue (last_linenum, last_filename); + debug_hooks->begin_prologue (last_linenum, last_columnnum, last_filename); if (!dwarf2_debug_info_emitted_p (current_function_decl)) - dwarf2out_begin_prologue (0, NULL); + dwarf2out_begin_prologue (0, 0, NULL); #ifdef LEAF_REG_REMAP if (crtl->uses_only_leaf_regs) @@ -2335,6 +2340,7 @@ final_scan_insn (rtx_insn *insn, FILE *f { override_filename = LOCATION_FILE (*locus_ptr); override_linenum = LOCATION_LINE (*locus_ptr); + override_columnnum = LOCATION_COLUMN (*locus_ptr); } } break; @@ -2370,11 +2376,13 @@ final_scan_insn (rtx_insn *insn, FILE *f { override_filename = LOCATION_FILE (*locus_ptr); override_linenum = LOCATION_LINE (*locus_ptr); + override_columnnum = LOCATION_COLUMN (*locus_ptr); } else { override_filename = NULL; override_linenum = 0; + override_columnnum = 0; } } break; @@ -2592,8 +2600,9 @@ final_scan_insn (rtx_insn *insn, FILE *f { if (flag_verbose_asm) asm_show_source (last_filename, last_linenum); - (*debug_hooks->source_line) (last_linenum, last_filename, - last_discriminator, is_stmt); + (*debug_hooks->source_line) (last_linenum, last_columnnum, + last_filename, last_discriminator, + is_stmt); } if (GET_CODE (body) == PARALLEL @@ -3078,23 +3087,26 @@ static bool notice_source_line (rtx_insn *insn, bool *is_stmt) { const char *filename; - int linenum; + int linenum, columnnum; if (override_filename) { filename = override_filename; linenum = override_linenum; + columnnum = override_columnnum; } else if (INSN_HAS_LOCATION (insn)) { expanded_location xloc = insn_location (insn); filename = xloc.file; linenum = xloc.line; + columnnum = xloc.column; } else { filename = NULL; linenum = 0; + columnnum = 0; } if (filename == NULL) @@ -3102,11 +3114,13 @@ notice_source_line (rtx_insn *insn, bool if (force_source_line || filename != last_filename - || last_linenum != linenum) + || last_linenum != linenum + || (debug_column_info && last_columnnum != columnnum)) { force_source_line = false; last_filename = filename; last_linenum = linenum; + last_columnnum = columnnum; last_discriminator = discriminator; *is_stmt = true; high_block_linenum = MAX (last_linenum, high_block_linenum); --- gcc/debug.h.jj 2017-01-01 12:45:37.000000000 +0100 +++ gcc/debug.h 2017-02-17 19:10:55.919495624 +0100 @@ -65,13 +65,14 @@ struct gcc_debug_hooks though the BLOCK information is messed up. Defaults to true. */ bool (* ignore_block) (const_tree); - /* Record a source file location at (FILE, LINE, DISCRIMINATOR). */ - void (* source_line) (unsigned int line, const char *file, - int discriminator, bool is_stmt); + /* Record a source file location at (FILE, LINE, COLUMN, DISCRIMINATOR). */ + void (* source_line) (unsigned int line, unsigned int column, + const char *file, int discriminator, bool is_stmt); /* Called at start of prologue code. LINE is the first line in the function. */ - void (* begin_prologue) (unsigned int line, const char *file); + void (* begin_prologue) (unsigned int line, unsigned int column, + const char *file); /* Called at end of prologue code. LINE is the first line in the function. */ @@ -193,9 +194,13 @@ extern const struct gcc_debug_hooks *deb /* The do-nothing hooks. */ extern void debug_nothing_void (void); extern void debug_nothing_charstar (const char *); +extern void debug_nothing_int_int_charstar (unsigned int, unsigned int, + const char *); extern void debug_nothing_int_charstar (unsigned int, const char *); -extern void debug_nothing_int_charstar_int_bool (unsigned int, const char *, - int, bool); +extern void debug_nothing_int_int_charstar_int_bool (unsigned int, + unsigned int, + const char *, + int, bool); extern void debug_nothing_int (unsigned int); extern void debug_nothing_int_int (unsigned int, unsigned int); extern void debug_nothing_tree (tree); @@ -217,7 +222,8 @@ extern const struct gcc_debug_hooks vmsd /* Dwarf2 frame information. */ -extern void dwarf2out_begin_prologue (unsigned int, const char *); +extern void dwarf2out_begin_prologue (unsigned int, unsigned int, + const char *); extern void dwarf2out_vms_end_prologue (unsigned int, const char *); extern void dwarf2out_vms_begin_epilogue (unsigned int, const char *); extern void dwarf2out_end_epilogue (unsigned int, const char *); --- gcc/debug.c.jj 2017-01-01 12:45:35.000000000 +0100 +++ gcc/debug.c 2017-02-17 19:14:10.010016500 +0100 @@ -35,8 +35,8 @@ const struct gcc_debug_hooks do_nothing_ debug_nothing_int_int, /* begin_block */ debug_nothing_int_int, /* end_block */ debug_true_const_tree, /* ignore_block */ - debug_nothing_int_charstar_int_bool, /* source_line */ - debug_nothing_int_charstar, /* begin_prologue */ + debug_nothing_int_int_charstar_int_bool, /* source_line */ + debug_nothing_int_int_charstar, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ debug_nothing_int_charstar, /* begin_epilogue */ debug_nothing_int_charstar, /* end_epilogue */ @@ -115,10 +115,18 @@ debug_nothing_int_charstar (unsigned int } void -debug_nothing_int_charstar_int_bool (unsigned int line ATTRIBUTE_UNUSED, - const char *text ATTRIBUTE_UNUSED, - int discriminator ATTRIBUTE_UNUSED, - bool is_stmt ATTRIBUTE_UNUSED) +debug_nothing_int_int_charstar (unsigned int line ATTRIBUTE_UNUSED, + unsigned int column ATTRIBUTE_UNUSED, + const char *text ATTRIBUTE_UNUSED) +{ +} + +void +debug_nothing_int_int_charstar_int_bool (unsigned int line ATTRIBUTE_UNUSED, + unsigned int column ATTRIBUTE_UNUSED, + const char *text ATTRIBUTE_UNUSED, + int discriminator ATTRIBUTE_UNUSED, + bool is_stmt ATTRIBUTE_UNUSED) { } --- gcc/dwarf2out.c.jj 2017-02-17 18:29:53.000000000 +0100 +++ gcc/dwarf2out.c 2017-02-17 19:10:26.481871631 +0100 @@ -93,7 +93,8 @@ along with GCC; see the file COPYING3. #include "gdb/gdb-index.h" #include "rtl-iter.h" -static void dwarf2out_source_line (unsigned int, const char *, int, bool); +static void dwarf2out_source_line (unsigned int, unsigned int, const char *, + int, bool); static rtx_insn *last_var_location_insn; static rtx_insn *cached_next_real_insn; static void dwarf2out_decl (tree); @@ -1023,6 +1024,7 @@ dwarf2out_alloc_current_fde (void) void dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, + unsigned int column ATTRIBUTE_UNUSED, const char *file ATTRIBUTE_UNUSED) { char label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -1073,7 +1075,7 @@ dwarf2out_begin_prologue (unsigned int l prologue case, not the eh frame case. */ #ifdef DWARF2_DEBUGGING_INFO if (file) - dwarf2out_source_line (line, file, 0, true); + dwarf2out_source_line (line, column, file, 0, true); #endif if (dwarf2out_do_cfi_asm ()) @@ -1099,7 +1101,7 @@ dwarf2out_begin_prologue (unsigned int l void dwarf2out_vms_end_prologue (unsigned int line ATTRIBUTE_UNUSED, - const char *file ATTRIBUTE_UNUSED) + const char *file ATTRIBUTE_UNUSED) { char label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -2733,7 +2735,7 @@ const struct gcc_debug_hooks dwarf2_line debug_nothing_int_int, /* end_block */ debug_true_const_tree, /* ignore_block */ dwarf2out_source_line, /* source_line */ - debug_nothing_int_charstar, /* begin_prologue */ + debug_nothing_int_int_charstar, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ debug_nothing_int_charstar, /* begin_epilogue */ debug_nothing_int_charstar, /* end_epilogue */ @@ -26534,7 +26536,8 @@ push_dw_line_info_entry (dw_line_info_ta /* ??? The discriminator parameter ought to be unsigned. */ static void -dwarf2out_source_line (unsigned int line, const char *filename, +dwarf2out_source_line (unsigned int line, unsigned int column, + const char *filename, int discriminator, bool is_stmt) { unsigned int file_num; @@ -26548,6 +26551,9 @@ dwarf2out_source_line (unsigned int line if (dwarf_version < 4 && dwarf_strict) discriminator = 0; + if (!debug_column_info) + column = 0; + table = cur_line_info_table; file_num = maybe_emit_file (lookup_filename (filename)); @@ -26567,6 +26573,7 @@ dwarf2out_source_line (unsigned int line if (0 && file_num == table->file_num && line == table->line_num + && column == table->column_num && discriminator == table->discrim_num && is_stmt == table->is_stmt) return; @@ -26575,7 +26582,14 @@ dwarf2out_source_line (unsigned int line /* If requested, emit something human-readable. */ if (flag_debug_asm) - fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, filename, line); + { + if (debug_column_info) + fprintf (asm_out_file, "\t%s %s:%d:%d\n", ASM_COMMENT_START, + filename, line, column); + else + fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START, + filename, line); + } if (DWARF2_ASM_LINE_DEBUG_INFO) { @@ -26587,7 +26601,10 @@ dwarf2out_source_line (unsigned int line putc (' ', asm_out_file); fprint_ul (asm_out_file, line); putc (' ', asm_out_file); - putc ('0', asm_out_file); + if (debug_column_info) + fprint_ul (asm_out_file, column); + else + putc ('0', asm_out_file); if (is_stmt != table->is_stmt) { @@ -26616,10 +26633,13 @@ dwarf2out_source_line (unsigned int line if (is_stmt != table->is_stmt) push_dw_line_info_entry (table, LI_negate_stmt, 0); push_dw_line_info_entry (table, LI_set_line, line); + if (debug_column_info) + push_dw_line_info_entry (table, LI_set_column, column); } table->file_num = file_num; table->line_num = line; + table->column_num = column; table->discrim_num = discriminator; table->is_stmt = is_stmt; table->in_use = true; --- gcc/sdbout.c.jj 2017-01-01 12:45:35.000000000 +0100 +++ gcc/sdbout.c 2017-02-17 19:12:27.526325527 +0100 @@ -116,11 +116,13 @@ static void sdbout_start_source_file (un static void sdbout_end_source_file (unsigned int); static void sdbout_begin_block (unsigned int, unsigned int); static void sdbout_end_block (unsigned int, unsigned int); -static void sdbout_source_line (unsigned int, const char *, int, bool); +static void sdbout_source_line (unsigned int, unsigned int, + const char *, int, bool); static void sdbout_end_epilogue (unsigned int, const char *); static void sdbout_early_global_decl (tree); static void sdbout_late_global_decl (tree); -static void sdbout_begin_prologue (unsigned int, const char *); +static void sdbout_begin_prologue (unsigned int, unsigned int, + const char *); static void sdbout_end_prologue (unsigned int, const char *); static void sdbout_begin_function (tree); static void sdbout_end_function (unsigned int); @@ -1519,7 +1521,8 @@ sdbout_end_block (unsigned int line, uns number LINE. */ static void -sdbout_source_line (unsigned int line, const char *filename ATTRIBUTE_UNUSED, +sdbout_source_line (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, + const char *filename ATTRIBUTE_UNUSED, int discriminator ATTRIBUTE_UNUSED, bool is_stmt ATTRIBUTE_UNUSED) { @@ -1551,7 +1554,8 @@ sdbout_begin_function (tree decl ATTRIBU describe the parameter list. */ static void -sdbout_begin_prologue (unsigned int line, const char *file ATTRIBUTE_UNUSED) +sdbout_begin_prologue (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, + const char *file ATTRIBUTE_UNUSED) { sdbout_end_prologue (line, file); } --- gcc/xcoffout.h.jj 2017-01-01 12:45:34.000000000 +0100 +++ gcc/xcoffout.h 2017-02-17 18:31:11.961331304 +0100 @@ -181,13 +181,14 @@ do { \ /* Prototype functions in xcoffout.c. */ extern int stab_to_sclass (int); -extern void xcoffout_begin_prologue (unsigned int, const char *); +extern void xcoffout_begin_prologue (unsigned int, unsigned int, const char *); extern void xcoffout_begin_block (unsigned, unsigned); extern void xcoffout_end_epilogue (unsigned int, const char *); extern void xcoffout_end_function (unsigned int); extern void xcoffout_end_block (unsigned, unsigned); extern int xcoff_assign_fundamental_type_number (tree); extern void xcoffout_declare_function (FILE *, tree, const char *); -extern void xcoffout_source_line (unsigned int, const char *, int, bool); +extern void xcoffout_source_line (unsigned int, unsigned int, const char *, + int, bool); #endif /* GCC_XCOFFOUT_H */ --- gcc/xcoffout.c.jj 2017-01-01 12:45:39.000000000 +0100 +++ gcc/xcoffout.c 2017-02-17 18:36:30.399361015 +0100 @@ -327,8 +327,8 @@ xcoffout_source_file (FILE *file, const /* Output a line number symbol entry for location (FILENAME, LINE). */ void -xcoffout_source_line (unsigned int line, const char *filename, - int discriminator ATTRIBUTE_UNUSED, +xcoffout_source_line (unsigned int line, unsigned int column ATTRIBUTE_UNUSED, + const char *filename, int discriminator ATTRIBUTE_UNUSED, bool is_stmt ATTRIBUTE_UNUSED) { bool inline_p = (strcmp (xcoff_current_function_file, filename) != 0 @@ -446,6 +446,7 @@ xcoffout_declare_function (FILE *file, t void xcoffout_begin_prologue (unsigned int line, + unsigned int column ATTRIBUTE_UNUSED, const char *file ATTRIBUTE_UNUSED) { ASM_OUTPUT_LFB (asm_out_file, line); --- gcc/vmsdbgout.c.jj 2017-01-01 12:45:39.000000000 +0100 +++ gcc/vmsdbgout.c 2017-02-17 19:13:08.489802300 +0100 @@ -155,9 +155,11 @@ static void vmsdbgout_end_source_file (u static void vmsdbgout_begin_block (unsigned int, unsigned int); static void vmsdbgout_end_block (unsigned int, unsigned int); static bool vmsdbgout_ignore_block (const_tree); -static void vmsdbgout_source_line (unsigned int, const char *, int, bool); +static void vmsdbgout_source_line (unsigned int, unsigned int, const char *, + int, bool); static void vmsdbgout_write_source_line (unsigned, const char *, int , bool); -static void vmsdbgout_begin_prologue (unsigned int, const char *); +static void vmsdbgout_begin_prologue (unsigned int, unsigned int, + const char *); static void vmsdbgout_end_prologue (unsigned int, const char *); static void vmsdbgout_end_function (unsigned int); static void vmsdbgout_begin_epilogue (unsigned int, const char *); @@ -1114,12 +1116,13 @@ write_srccorrs (int dosizeonly) the prologue. */ static void -vmsdbgout_begin_prologue (unsigned int line, const char *file) +vmsdbgout_begin_prologue (unsigned int line, unsigned int column, + const char *file) { char label[MAX_ARTIFICIAL_LABEL_BYTES]; if (write_symbols == VMS_AND_DWARF2_DEBUG) - (*dwarf2_debug_hooks.begin_prologue) (line, file); + (*dwarf2_debug_hooks.begin_prologue) (line, column, file); if (debug_info_level > DINFO_LEVEL_NONE) { @@ -1397,11 +1400,13 @@ vmsdbgout_write_source_line (unsigned li } static void -vmsdbgout_source_line (register unsigned line, register const char *filename, +vmsdbgout_source_line (register unsigned line, unsigned int column, + register const char *filename, int discriminator, bool is_stmt) { if (write_symbols == VMS_AND_DWARF2_DEBUG) - (*dwarf2_debug_hooks.source_line) (line, filename, discriminator, is_stmt); + (*dwarf2_debug_hooks.source_line) (line, column, filename, discriminator, + is_stmt); if (debug_info_level >= DINFO_LEVEL_TERSE) vmsdbgout_write_source_line (line, filename, discriminator, is_stmt); --- gcc/dbxout.c.jj 2017-01-01 12:45:36.000000000 +0100 +++ gcc/dbxout.c 2017-02-17 19:09:20.718711626 +0100 @@ -332,8 +332,9 @@ static void debug_free_queue (void); /* The debug hooks structure. */ #if defined (DBX_DEBUGGING_INFO) -static void dbxout_source_line (unsigned int, const char *, int, bool); -static void dbxout_begin_prologue (unsigned int, const char *); +static void dbxout_source_line (unsigned int, unsigned int, const char *, + int, bool); +static void dbxout_begin_prologue (unsigned int, unsigned int, const char *); static void dbxout_source_file (const char *); static void dbxout_function_end (tree); static void dbxout_begin_function (tree); @@ -1241,7 +1242,9 @@ dbxout_source_file (const char *filename function scope */ static void -dbxout_begin_prologue (unsigned int lineno, const char *filename) +dbxout_begin_prologue (unsigned int lineno, + unsigned int column ATTRIBUTE_UNUSED, + const char *filename) { if (use_gnu_debug_info_extensions && !NO_DBX_FUNCTION_END @@ -1252,7 +1255,7 @@ dbxout_begin_prologue (unsigned int line /* pre-increment the scope counter */ scope_labelno++; - dbxout_source_line (lineno, filename, 0, true); + dbxout_source_line (lineno, 0, filename, 0, true); /* Output function begin block at function scope, referenced by dbxout_block, dbxout_source_line and dbxout_function_end. */ emit_pending_bincls_if_required (); @@ -1263,8 +1266,8 @@ dbxout_begin_prologue (unsigned int line number LINENO. */ static void -dbxout_source_line (unsigned int lineno, const char *filename, - int discriminator ATTRIBUTE_UNUSED, +dbxout_source_line (unsigned int lineno, unsigned int column ATTRIBUTE_UNUSED, + const char *filename, int discriminator ATTRIBUTE_UNUSED, bool is_stmt ATTRIBUTE_UNUSED) { dbxout_source_file (filename);