Make debug(edge) more verbose.

Message ID c4dd9c97-73d5-aae0-c116-fdf76d73a989@suse.cz
State New
Headers show
Series
  • Make debug(edge) more verbose.
Related show

Commit Message

Martin Liška May 31, 2019, 9:23 a.m.
Hi.

With the patch one can see more info during debugging:

(gdb) pp
<edge (5 -> 6)>
 5 [11.0% (guessed)]  count:105119324 (estimated locally) (FALLTHRU,CAN_FALLTHRU,LOOP_EXIT)

Ready for trunk?
Thanks,
Martin

gcc/ChangeLog:

2019-05-31  Martin Liska  <mliska@suse.cz>

	* cfg.c (debug): Use TDF_DETAILS for debug and
	print edge info only once.
---
 gcc/cfg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jeff Law May 31, 2019, 2:44 p.m. | #1
On 5/31/19 3:23 AM, Martin Liška wrote:
> Hi.

> 

> With the patch one can see more info during debugging:

> 

> (gdb) pp

> <edge (5 -> 6)>

>  5 [11.0% (guessed)]  count:105119324 (estimated locally) (FALLTHRU,CAN_FALLTHRU,LOOP_EXIT)

> 

> Ready for trunk?

> Thanks,

> Martin

> 

> gcc/ChangeLog:

> 

> 2019-05-31  Martin Liska  <mliska@suse.cz>

> 

> 	* cfg.c (debug): Use TDF_DETAILS for debug and

> 	print edge info only once.

> ---

>  gcc/cfg.c | 7 ++++---

>  1 file changed, 4 insertions(+), 3 deletions(-)

> 

> 

OK
jeff

Patch

diff --git a/gcc/cfg.c b/gcc/cfg.c
index 94e68c83e45..983115ee40a 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -546,9 +546,10 @@  dump_edge_info (FILE *file, edge e, dump_flags_t flags, int do_succ)
 DEBUG_FUNCTION void
 debug (edge_def &ref)
 {
-  /* FIXME (crowl): Is this desireable?  */
-  dump_edge_info (stderr, &ref, TDF_NONE, false);
-  dump_edge_info (stderr, &ref, TDF_NONE, true);
+  fprintf (stderr, "<edge (%d -> %d)>\n",
+	   ref.src->index, ref.dest->index);
+  dump_edge_info (stderr, &ref, TDF_DETAILS, false);
+  fprintf (stderr, "\n");
 }
 
 DEBUG_FUNCTION void