This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Yet another tree dumper


On Wed, Oct 15, 2003 at 10:36:54AM -0700, Per Bothner wrote:
> A suggestion:
> 
> Check in the new tree-dumper, but into the print-tree.c
> like this:
> 
> #define USE_NEW_DUMPER 1
> #ifdef NEW_DUMPER
> ... code for new dumper ...;
> tree
> debug_tree (tree node)
> { call new dumper; }
> #else
> ... existing code for old dumper ...;
> tree
> debug_tree (tree node)
> { call old dumper; }
> #endif

Devang,

why not merge the two completely and make the output format
a function of (obfuscated) globals?  Then one can set his/her
preference in .gdbinit.

Ie,

set __gdb_tree_dump_format=2
call debug_tree(exp)

The remaining problem would then be what to set as the default
of course ;P

But anyway - I don't think the two dumpers are so different
that it isn't possible to merge them, using multiple global
switches for actual differences, in a way that there is no
real code duplication anymore - while keeping both functionalities
(and anything in between) without the need for a recompile.

Changes/improvements in the future can then be added more
easily - and accepted more easily when the are not introduced
as default.

-- 
Carlo Wood <carlo@alinoe.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]