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] c++/12266 (again)


Hi,

I know it has been some time since my last attempt at this, but I have spent the last several weeks testing the living daylights out of this code and fixing fallout. I've added almost 300 new tests (for a total of almost 800 tests), and I've run the code through libstdc++ and some of libwebkit.

I feel relatively confident that I've tackled most of the problems, but, of course, C++ is big and complex, and people always manage to surprise me with strange ways of using it...

A reminder about this bug/enhancement request: linespecs can't deal with typedefs. So if a user types "break my_func(my_typedef)", gdb may not necessarily find it. [That's not entirely true today because a patch was committed while I was away that allows decode_compound to fallback to looking up minsyms. I have tested this with that patch defeated (testing against the output of "nm -C").]

I've pruned the original patchset down substantially: a lot of the previous three (!) patches dealt with dwarf2_physname fixes which are now no longer necessary for GCC. I will attempt to clean these up for later submission for the benefit of other non-GNU compilers.

I've attached two patches:

1) cp_demangled_name_parse_free.patch
This patch simply massages cp_string_to_comp to be redundant. It is almost exactly the same as in my previous submissions. This patch is mechanical and may be applied independently of the other patch.


2) cp_canonicalize_string_no_typedefs.patch
This is the guts of the work, and has changed quite a bit compared to previous submissions. Major changes include better qualified name handling, dealing with anonymous types, more complete/correct handling of CV types in parameters, templates, and a few other things.


Keith

ChangeLog for cp_demangled_name_parse_free
2011-07-28  Keith Seitz  <keiths@redhat.com>

	* cp-name-parser.y (struct demangle_info): Remove unused
	member PREV.
	(d_grab): Likewise.
	(allocate_info): Change return type to struct demangle_info *.
	Always allocate a new demangle_info.
	Remove unused PREV pointer.
	(cp_demangled_name_parse_free): New function.
	(do_dmeangled_name_parse_free_cleanup): New function.
	(make_cleanup_cp_demangled_name_parse_free): New function.
	(cp_demangled_name_to_comp): Change return type to
	struct demangle_parse_info *.
	Allocate a new storage for each call.
	(main): Update usage for cp_demangled_name_to_comp
	API change.
	* cp-support.h (struct demangle_parse_info): New structure.
	(cp_demangled_name_to_comp): Update API change for
	return type.
	(make_cleanup_cp_demangled_name_parse_free): New declaration.
	(cp_demangled_name_parse_free): Declare.
	* cp-support.c (cp_canonicalize_string): Update API
	change for cp_demangled_name_to_comp.
	(mangled_name_to_comp): Likewise.
	Return struct demangle_parse_info, too.
	(cp_class_name_from_physname): Update mangled_name_to_comp
	API change.
	(method_name_from_physname): Likewise.
	(cp_func_name): Update API change for cp_demangled_name_to_comp.
	(cp_remove_params): Likewise.
	* python/py-type.c (typy_legacy_template_argument): Likewise.

ChangeLogs for cp_canonicalize_string_no_typedefs.patch
2011-07-28  Keith Seitz  <keiths@redhat.com>

	* cp-support.h (cp_canonicalize_string_no_typedefs): Declare.
	(cp_merge_demangle_parse_infos): Declare.
	* cp-support.c (ignore_typedefs): New file global.
	(inspect_type): New function.
	(replace_typedefs): New function.
	(replace_typedefs_qualified_name): New function.
	(cp_canonicalize_string_no_typedefs): New function.
	* cp-name-parser.y (cp_merge_demangle_parse_infos): New function.
	* linespec.c (find_methods): Use cp_canonicalize_string_no_typedefs
	instead of cp_canonicalize_string.
	(find_method): Likewise.
	(decode_compound): Before looking up the name, call
	cp_canonicalize_string_no_typedefs.
	(decode_variable): Likewise.

testsuite/ChangeLog
2011-07-28  Keith Seitz  <keiths@redhat.com>

	* gdb.cp/meth-typedefs.cc: New file.
	* gdb.cp/meth-typedefs.exp: New file.

Attachment: cp_demangled_name_parse_free-4.patch
Description: Text document

Attachment: cp_canonicalize_no_typedefs-4.patch
Description: Text document


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