This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Yet another tree dumper : Part 2 (3/4)
3rd alternative is to use global variable __gdb_tree_dump_format
to select tree dumper.
2003-10-17 Devang Patel <dpatel@apple.com>
* print-tree.c (debug_tree_old): Rename debug_tree()
(debug_tree): New function to call debug_tree_old() or
dmp_tree2().
(__gdb_tree_dump_format): New.
--
Devang
Index: print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.79
diff -Idpatel.pbxuser -c -3 -p -r1.79 print-tree.c
*** print-tree.c 22 Sep 2003 05:09:12 -0000 1.79
--- print-tree.c 17 Oct 2003 18:49:59 -0000
*************** static struct bucket **table;
*** 46,53 ****
Most nodes referred to by this one are printed recursively
down to a depth of six. */
void
! debug_tree (tree node)
{
table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);
--- 46,65 ----
Most nodes referred to by this one are printed recursively
down to a depth of six. */
+ int __gdb_tree_dump_format = 1;
+ extern void dmp_tree2 (tree node);
+ void debug_tree (tree node)
+ {
+ if (__gdb_tree_dump_format == 1)
+ dmp_tree2 (node);
+ else if (__gdb_tree_dump_format == 2)
+ debug_tree_old (node);
+ else
+ fprintf (stderr, "set variable __gdb_tree_dump_format to 1 or
2\n");
+ }
+
void
! debug_tree_old (tree node)
{
table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);