On 12-05-22 21:56 , Cary Coutant wrote:
[Revised to address review comments and to fix a bug we found late:
We've changed want_pubnames to a static inline function, and changed
the pubnames output to include (ironically enough) inline functions.]
This patch is for the google/gcc-4_6 branch.
Fission improvements and bug fixes. Adds new DW_OP_GNU_const_index to
handle TLS offsets in debug info. Adds -gpubnames/-gno-pubnames options
to explicitly request .debug_pubnames/pubtypes sections. Adds style
parameter to C/C++ pretty-printer so that we can get canonical pubnames
without affecting diagnostic output.
Bootstrapped and tested on x86_64.
2012-05-21 Sterling Augustine<saugust...@google.com>
Cary Coutant<ccout...@google.com>
include/
* dwarf2.h: Add DW_OP_GNU_const_index.
gcc/
* opts.c (finish_options): -gfission implies -gpubnames.
(common_handle_option): Pass empty arg string to set_debug_level.
* common.opt (gno-fission): New option.
(gfission): Remove JoinedOrMissing, add RejectNegative.
(gno-pubnames, gpubnames): New options.
* target.def (want_debug_pub_sections): Change default to false.
* gcc.c (check_live_switch): Check -g options for -gno- options.
* c-family/c-pretty-print.c (pp_c_specifier_qualifier_list): Add
support for gnu_v3 style.
* c-family/c-pretty-print.h (pp_c_flag_gnu_v3): New enum constant.
* cp/error.c (dump_decl): Add support for gnu_v3 style.
(decl_as_string): Likewise.
(lang_decl_name): Likewise.
* cp/cp-lang.c (cxx_dwarf_name): Likewise.
* cp/cp-tree.h (enum overload_flags): Add TFF_MATCH_GNU_V3_DEMANGLER.
* dwarf2out.c (dwarf_stack_op_name): Add DW_OP_GNU_const_index.
(size_of_loc_descr): Likewise.
(output_loc_operands): Likewise.
(output_loc_operands_raw): Likewise.
(dw_addr_op): New function.
(new_addr_loc_descr): Call dw_addr_op.
(want_pubnames): New function.
(add_AT_pubnames): Add DW_AT_GNU_pubnames/pubtypes only if
generating .debug_pubnames/pubtypes sections.
(add_pubname_string): Check for -gpubnames option.
(add_pubname): Likewise.
(add_pubtype): Likewise.
(output_pubnames): Likewise.
(mem_loc_descriptor): Call new_addr_loc_desc for TLS vars.
(loc_list_from_tree): Likewise.
(gen_subprogram_die): Output pubnames for all inlined functions.
(output_addr_table): Handle DW_OP_GNU_const_index. Add missing
newline.
(hash_loc_operands): Add DW_OP_GNU_const_index.
(compare_loc_operands): Likewise.
* testsuite/g++.old-deja/g++.pt/memtemp77.C: Revert earlier change
to expected results.
* testsuite/g++.dg/ext/pretty3.C: Likewise.
* testsuite/g++.dg/warn/Wuninitializable-member.C: Likewise.
* testsuite/g++.dg/warn/pr35711.C: Likewise.
* testsuite/g++.dg/pr44486.C: Likewise.
OK with a couple of nits I found on the second read.
@@ -445,6 +445,9 @@ pp_c_specifier_qualifier_list (c_pretty_
{
const enum tree_code code = TREE_CODE (t);
+ if (!(pp->flags& pp_c_flag_gnu_v3)&& TREE_CODE (t) != POINTER_TYPE)
+ pp_c_type_qualifier_list (pp, t);
You can use 'code' here instead of TREE_CODE(t). Either that, or remove
the declaration of 'code' above.
+
switch (code)
{
case REFERENCE_TYPE:
@@ -489,7 +492,7 @@ pp_c_specifier_qualifier_list (c_pretty_
pp_simple_type_specifier (pp, t);
break;
}
- if (TREE_CODE (t) != POINTER_TYPE)
+ if ((pp->flags& pp_c_flag_gnu_v3)&& TREE_CODE (t) != POINTER_TYPE)
Likewise here.
@@ -6589,17 +6595,30 @@ static bool generic_type_p (tree);
static void schedule_generic_params_dies_gen (tree t);
static void gen_scheduled_generic_parms_dies (void);
+/* DW_OP_addr is relocated by the debug info consumer, while
+ tls relative operands should not be. */
+
+static inline enum dwarf_location_atom dw_addr_op (bool dtprel)
Can you describe what DTPREL is used for here?
Diego.