aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-01-12 11:27:34 +0100
committerMartin Liska <mliska@suse.cz>2021-01-12 12:55:17 +0100
commitb2230210f1742ddf5e863172ff86531019d1039e (patch)
treebb2f984ae415d97a03105fd41e9ffa128fc95cbd /gcc/profile.c
parent24ea113f75cfad38894dc1ad16b23c0538ef17d4 (diff)
downloadgcc-b2230210f1742ddf5e863172ff86531019d1039e.zip
gcc-b2230210f1742ddf5e863172ff86531019d1039e.tar.gz
gcc-b2230210f1742ddf5e863172ff86531019d1039e.tar.bz2
gcov: add more debugging facility
gcc/ChangeLog: * gcov.c (source_info::debug): New. (print_usage): Add --debug (-D) option. (process_args): Likewise. (generate_results): Call src->debug after accumulate_line_counts. (read_graph_file): Properly assign id for EXIT_BLOCK. * profile.c (branch_prob): Dump function body before it is instrumented.
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index d629687..1f1d60c 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1294,6 +1294,11 @@ branch_prob (bool thunk)
if (dump_file)
fprintf (dump_file, "%d instrumentation edges\n", num_instrumented);
+ /* Dump function body before it's instrumented.
+ It helps to debug gcov tool. */
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ dump_function_to_file (cfun->decl, dump_file, dump_flags);
+
/* Compute two different checksums. Note that we want to compute
the checksum in only once place, since it depends on the shape
of the control flow which can change during