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]

[PATCH] Debugging dump support for gengtype and some cleanups


[Reposting without sample debugging output attached, which made the
previous attempt to send it silently rejected]

This adds a new command line option -d for gengtype that makes it to
dump (in an ad hoc format) its internal data structures to stdout. It
is useful in finding out why some data types do not appear in gengtype
output files, or why some do when they shouldn't.

It does depth-first processing of types and the very first type dumped
includes almost all the other types, so the output is quite ugly if
read from the beginning. However this output is most useful for
grepping of some interesting type names and in that case it is
perfectly readable. However I could do make it do breadth-first
processing if necessary.

Also this patch factors out duplicate code for finding out which
output file to use for a given structure and has some other minor
random cleanups.

It has been tested on gc-improv branch for a few months. I have
submitted this patch as an RFC some time ago already:
http://gcc.gnu.org/ml/gcc/2009-08/msg00382.html

Bootstrapped/regtested on x86_64/linux together with the rest of the bunch.

OK for mainline?

2010-04-21 ÂLaurynas Biveinis Â<laurynas.biveinis@gmail.com>

   Â* Makefile.in (build/gengtype.o): Add $(HASHTAB_H) to
   Âdependencies.

   Â* gengtype.h (erro_at_line): Constify pos argument.

   Â* gengtype.c: Include hashtab.h.
   Â(enum gc_used): Document GC_MAYBE_POINTED_TO.
   Â(error_at_line): Constify pos argument.
   Â(do_typedef): Initialize p->opt field.
   Â(get_file_gtfilename): Fix comment typo.
   Â(struct walk_type_data): Constify line field.
   Â(get_output_file_for_structure): New function.
   Â(write_local_func_for_structure): Constify orig_s argument.
   ÂUse get_output_file_for_structure.
   Â(write_func_for_structure): Use get_output_file_for_structure.
   Â(INDENT): New define.
   Â(dump_pair, dump_type, dump_type_list, dump_typekind)
   Â(dump_gc_used, dump_options, dump_fileloc, dump_type_u_s)
   Â(dump_type_u_s_lang_struct, dump_type_u_a)
   Â(dump_type_u_param_struct, dump_pair_list, dump_structures)
   Â(dump_everything): New functions.
   Â(seen_types): New variable.
   Â(main): New variable do_dump. ÂProcess "-d" command line option.
   ÂCall dump_everything if dump requested.

--
Laurynas



-- 
Laurynas

Attachment: gengtype-dump.patch
Description: Binary data


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