diff options
author | Martin Liska <mliska@suse.cz> | 2017-11-09 10:11:17 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-11-09 09:11:17 +0000 |
commit | 136ca74eb91c225ff18a7b08e0e7fd027b88517c (patch) | |
tree | 3d35f88384d1fc66a1a463a1b060b85bc366a37d /gcc/gcov-dump.c | |
parent | 6bc322a11bec51aceb463fb2336198645dca993f (diff) | |
download | gcc-136ca74eb91c225ff18a7b08e0e7fd027b88517c.zip gcc-136ca74eb91c225ff18a7b08e0e7fd027b88517c.tar.gz gcc-136ca74eb91c225ff18a7b08e0e7fd027b88517c.tar.bz2 |
GCOV: support multiple functions per a line (PR gcov-profile/48463)
2017-11-09 Martin Liska <mliska@suse.cz>
PR gcov-profile/48463
* coverage.c (coverage_begin_function): Output also end locus
of a function and information whether the function is
artificial.
* gcov-dump.c (tag_function): Parse and print the information.
* gcov.c (INCLUDE_MAP): Add include.
(INCLUDE_SET): Likewise.
(struct line_info): Move earlier in the source file because
of vector<line_info> in function_info structure.
(line_info::line_info): Likewise.
(line_info::has_block): Likewise.
(struct source_info): Add new member index.
(source_info::get_functions_at_location): New function.
(function_info::group_line_p): New function.
(output_intermediate_line): New function.
(output_intermediate_file): Use the mentioned function.
(struct function_start): New.
(struct function_start_pair_hash): Likewise.
(process_file): Add code that identifies group functions.
Assign lines either to global or function scope.
(generate_results): Skip artificial functions.
(find_source): Assign index for each source file.
(read_graph_file): Read new flag artificial and end_line.
(add_line_counts): Assign it either to global of function scope.
(accumulate_line_counts): Isolate core of the function to
accumulate_line_info and call it for both function and global
scope lines.
(accumulate_line_info): New function.
(output_line_beginning): Fix GNU coding style.
(print_source_line): New function.
(output_line_details): Likewise.
(output_function_details): Likewise.
(output_lines): Iterate both source (global) scope and function
scope.
(struct function_line_start_cmp): New class.
* doc/gcov.texi: Reflect changes in documentation.
From-SVN: r254562
Diffstat (limited to 'gcc/gcov-dump.c')
-rw-r--r-- | gcc/gcov-dump.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c index d24e72a..c4e05cd 100644 --- a/gcc/gcov-dump.c +++ b/gcc/gcov-dump.c @@ -308,9 +308,15 @@ tag_function (const char *filename ATTRIBUTE_UNUSED, name = gcov_read_string (); printf (", `%s'", name ? name : "NULL"); + unsigned artificial = gcov_read_unsigned (); name = gcov_read_string (); printf (" %s", name ? name : "NULL"); - printf (":%u", gcov_read_unsigned ()); + unsigned line_start = gcov_read_unsigned (); + unsigned column_start = gcov_read_unsigned (); + unsigned line_end = gcov_read_unsigned (); + printf (":%u:%u:%u", line_start, column_start, line_end); + if (artificial) + printf (", artificial"); } } } |