This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[RFA] Typedef'd method parameters [2/4]


Hi,

This patch attempts to address the differences between print names and "linkage names" (physnames). This difference is largely (entirely?) the appearance of typedefs in the print name and not in the physname.

In order to prevent a bunch of API changes in the type system, I have chosen to wrap the public API bits in terms of new "internal" functions.

There is one part of this that I am not particularly fond of, but without a proper language in which to express overloaded concepts, the only other choice is to overload a member of struct gsymbol or add another into it. I've chosen in favor of not using more memory. Hence the hacky check for a mangled symbol name in symbol_search_name.

There is also one little cleanup snuck in here: compare_search_syms (a comparator for qsort) was comparing SYMBOL_NATURAL_NAME of the two symbols. It should be using SYMBOL_SEARCH_NAME.

Comments/questions/concerns?

Keith

ChangeLog
2011-04-20  Keith Seitz  <keiths@redhat.com>

	* typeprint.h (c_type_print_args): Add PRINT_NAME parameter.
	* c-typeprint.c (c_print_type_internal): Renamed from
	c_print_type.
	Pass new linkage_name parameter to c_type_print_varspec_suffix.
	(c_print_type): "New" public wrapper.
	(cp_type_print_method_args): Remove unused "prefix" parameter.
	(c_type_print_args): Add PRINT_NAME parameter.
	Skip artificial parameters if PRINT_NAME.
	If LINKAGE_NAME, resolve typedefs.
	Pass LINKAGE_NAME to c_type_print_internal.
	(c_type_print_varspec_suffix): Add LINKAGE_NAME parameter
	and pass to subsequent calls to c_type_print_varspec_suffix.
	(c_type_print_base_internal): Renamed from c_type_print_base.
	Add LINKAGE_NAME parameter and pass to subsequent
	c_type_print_base_internal and c_type_print_internal calls.
	Remove unused PREFIX parameter from cp_type_print_method_args.
	(c_type_print_base): "New" public wrapper.
	* dwarf2read.c (enum name_kind): Define.
	(dwarf2_compute_name): Replace PHYSNAME parameter with
	new enumeration type.
	Add handling for print names.
	(dwarf2_full_name): Pass NAME_KIND_FULL to dwarf2_compute_name.
	(dwarf2_physname): Pass NAME_KIND_PHYS to dwarf2_compute_name.
	(dwarf2_printname): New function.
	(new_symbol_full): If the print name of a symbol is different
	from its physname, set the symbol's demangled name.
	* jv-typeprint.c (c_type_print_varspec_suffix): Remove extern
	declaration.
	(java_print_type): Add new LINKAGE_NAME parameter for call to
	c_type_print_varspec_suffix.
	* symtab.c (symbol_search_name): Update comments to explain
	the overloading of symbol names with mangled minimal symbols.
	If the symbol's name is GNUv3 mangled, return the symbol's
	natural name; otherwise simply return gsymbol->name.
	(compare_search_syms): Compare search names, not print names.

Attachment: printname.patch
Description: Text document


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