[PATCH] More demangler stuff

Carlo Wood carlo@alinoe.com
Thu Oct 30 15:30:00 GMT 2003


2003-10-30  Carlo Wood  <carlo@alinoe.com>

        * include/bits/demangle.h
	(qualifier_list<Allocator>::decode_qualifiers(string_type&,
	string_type&, bool) const): Made const.
	(qualifier_list<Allocator>::M_printing_suppressed): Added mutable.
	(_GLIBCXX_DEMANGLER_DOUT_ENTERING3, _GLIBCXX_DEMANGLER_RETURN3,
	std::ostream& operator<<(std::ostream&, qualifier const&),
	std::ostream& operator<<(std::ostream&, qualifier_list const&),
	qualifier_list<Allocator>::decode_qualifiers(string_type&,
	string_type&, bool) const,
	session<Allocator>::decode_type_with_postfix(string_type&,
	string_type&, qualifier_list<Allocator>*))
	Added and/or changed debug-only hooks and code.

These new debug hooks (and some tweaks) are needed to debug the demangler
(added specifically to be able to debug PR12736, the patch for which will
follow).

Debug output now looks like:

~/c++/demangler-20030808>c++filt _Z1fVA9_KA6_ri
DEMANGLER: Output thus far: ""
DEMANGLER: Entering decode_encoding("1fVA9_KA6_ri")
DEMANGLER: Entering decode_special_name("1fVA9_KA6_ri", "") [failure]
DEMANGLER: Entering decode_name("1fVA9_KA6_ri", "") <unfinished>
DEMANGLER:     Entering decode_unscoped_name("1fVA9_KA6_ri", "") <unfinished>
DEMANGLER:         Entering decode_unqualified_name("1fVA9_KA6_ri", "") <unfinished>
DEMANGLER:             Entering decode_source_name("1fVA9_KA6_ri", "") [2; "f"]
DEMANGLER:         <continued> [2; "f"]
DEMANGLER:     <continued> [2; "f"]
DEMANGLER: <continued> [2; "f"]
DEMANGLER: Entering decode_bare_function_type("VA9_KA6_ri", "f") <unfinished>
DEMANGLER:     Entering decode_type("VA9_KA6_ri", "f(", "") <unfinished>
DEMANGLER:         Entering decode_number("9_KA6_ri", "") [5; "9"]
DEMANGLER:         Entering decode_number("6_ri", "") [9; "6"]
DEMANGLER:         Entering decode_builtin_type("i", "f(") [12; "f(int"]
DEMANGLER:         Entering decode_qualifiers [with qualifier list: { V, A [9], K, A [6], r }]("f(int", "") <unfinished>
DEMANGLER:             Adding substitution S_ : int restrict (from demangle.h:1435 <- demangle.h:1811 <- demangle.h:347).
DEMANGLER:             Adding substitution S0_ : int restrict [6] (from demangle.h:1435 <- demangle.h:1811 <- demangle.h:347).
DEMANGLER:             Adding substitution S1_ : int restrict ( const) [6] (from demangle.h:1435 <- demangle.h:1811 <- demangle.h:347).
DEMANGLER:             Adding substitution S2_ : int restrict ( const [9]) [6] (from demangle.h:1435 <- demangle.h:1811 <- demangle.h:347).
DEMANGLER:             Adding substitution S3_ : int restrict ( const ( volatile) [9]) [6] (from demangle.h:1435 <- demangle.h:1811 <- demangle.h:347).
DEMANGLER:         <continued> [ "f(int restrict ( const ( volatile", ") [9]) [6]"]
DEMANGLER:     <continued> [12; "f(int restrict ( const ( volatile", ") [9]) [6]"]
DEMANGLER: <continued> [12; "f(int restrict ( const ( volatile) [9]) [6])"]
f(int restrict ( const ( volatile) [9]) [6])


Ok to commit?

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Libstdc++ mailing list