From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21935 invoked by alias); 11 Jun 2007 22:14:57 -0000 Received: (qmail 21922 invoked by uid 22791); 11 Jun 2007 22:14:55 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Jun 2007 22:14:52 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5BMEnIp373170 for ; Mon, 11 Jun 2007 22:14:49 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5BMEn8q4079634 for ; Tue, 12 Jun 2007 00:14:49 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5BMEmoj026764 for ; Tue, 12 Jun 2007 00:14:48 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l5BMEmW2026761; Tue, 12 Jun 2007 00:14:48 +0200 Message-Id: <200706112214.l5BMEmW2026761@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 12 Jun 2007 00:14:48 +0200 Subject: Re: [0/10] Clean up built-in types To: jimb@codesourcery.com (Jim Blandy) Date: Mon, 11 Jun 2007 22:14:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Jim Blandy" at Jun 11, 2007 10:53:49 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00153.txt.bz2 Jim Blandy wrote: > At first I was concerned that builtin_type (current_gdbarch) would be > populated too late to be useful, but looking at the code I saw that > referring to builtin_type_ from a gdbarch_init function has always > been broken. > > The M32C port creates a bunch of types in its gdbarch_init function, > constructing its own 'void', 'void *', and 'void (*)()' types to avoid > referring to the builtin_type_ variables. Do you see anything offhand > in m32c-tdep.c:make_types (which is called from m32c_gdbarch_init) > that would be incompatible with this approach? No, that shouldn't be affected at all. However, I now noticed the following comment in Makefile.in: # FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that # the first call is to _initialize_gdbtypes (implemented by explicitly # putting that function's name first in the init.l-tmp file). This is # a hack to ensure that all the architecture dependant global # builtin_type_* variables are initialized before anything else # (per-architecture code is called in the same order that it is # registered). The ``correct fix'' is to have all the builtin types # made part of the architecture and initialize them on-demand (using # gdbarch_data) just like everything else. The catch is that other # modules still take the address of these builtin types forcing them # to be variables, sigh! And indeed, _initialize_xcoffread makes use of builtin_type_int. I'll need to fix this before committing the patch set. Fortunately, it looks like this is the only place that still relies on the above guarantee. Here's a list of all functions that use a builtin_type_ compatibility macro (after the patch set was applied). I don't see any of those routines called in an _init routine. Bye, Ulrich Problem: xcoffread.c:_initialize_xcoffread Common Code: auxv.c:target_auxv_parse ax-gdb.c:gen_var_ref ax-gdb.c:gen_usual_unary ax-gdb.c:gen_usual_arithmetic ax-gdb.c:gen_sub ax-gdb.c:gen_logical_not ax-gdb.c:gen_repeat ax-gdb.c:gen_sizeof ax-gdb.c:gen_expr breakpoint.c:set_breakpoint_count bsd-uthread.c:bsd_uthread_fetch_registers bsd-uthread.c:bsd_uthread_store_registers bsd-uthread.c:bsd_uthread_wait bsd-uthread.c:bsd_uthread_find_new_threads dwarf2expr.c:unsigned_address_type dwarf2expr.c:signed_address_type dwarf2-frame.c:size_of_encoded_value dwarf2-frame.c:decode_frame_entry_1 dwarf2loc.c:dwarf_expr_read_reg eval.c:evaluate_subexp_standard eval.c:evaluate_subexp_for_sizeof expprint.c:print_subexp_standard gcore.c:derive_heap_segment gdbtypes.c:create_range_type gdbtypes.c:init_vector_type gdbtypes.c:check_typedef gdbtypes.c:safe_parse_type infcall.c:value_arg_coerce infcall.c:find_function_addr infrun.c:handle_inferior_event language.c:lang_bool_type linux-fork.c:checkpoint_command mi/mi-main.c:mi_cmd_data_read_memory parse.c:write_exp_msymbol parse.c:write_dollar_variable parse.c:follow_types printcmd.c:print_scalar_formatted printcmd.c:set_next_address printcmd.c:x_command printcmd.c:printf_command procfs.c:procfs_address_to_host_pointer procfs.c:procfs_can_use_hw_breakpoint solib-svr4.c:LM_ADDR_FROM_LINK_MAP solib-svr4.c:LM_DYNAMIC_FROM_LINK_MAP solib-svr4.c:LM_NEXT solib-svr4.c:LM_NAME solib-svr4.c:IGNORE_FIRST_LINK_MAP_ENTRY solib-svr4.c:elf_locate_base solib-svr4.c:solib_svr4_r_map solib-svr4.c:solib_svr4_r_ldsomap solib-svr4.c:open_symbol_file_object solib-svr4.c:svr4_fetch_objfile_link_map source.c:forward_search_command source.c:reverse_search_command stabsread.c:define_symbol stabsread.c:read_range_type stack.c:return_command std-regs.c:value_of_builtin_frame_fp_reg std-regs.c:value_of_builtin_frame_pc_reg symfile.c:syms_from_objfile target.c:find_default_create_inferior target-descriptions.c:tdesc_named_type target-descriptions.c:tdesc_register_type tracepoint.c:set_tracepoint_num tracepoint.c:set_traceframe_context valarith.c:value_sub valarith.c:value_subscript valarith.c:value_x_unop valarith.c:value_binop valarith.c:value_pos valarith.c:value_neg valarith.c:value_complement valarith.c:value_bit_index valops.c:find_function_in_inferior valops.c:value_allocate_space_in_inferior valops.c:value_cast valops.c:value_ind valops.c:value_array valops.c:value_string valops.c:value_bitstring valops.c:find_rt_vbase_offset value.c:allocate_repeat_value value.c:lookup_internalvar value.c:value_from_string value.c:coerce_enum varobj.c:c_describe_child xml-tdesc.c:tdesc_start_vector Language code: ada-exp.y:(rules) ada-exp.y:type_system_address ada-lang.c:ada_coerce_to_simple_array_type ada-lang.c:ada_value_ptr_subscript ada-lang.c:ada_index_type ada-lang.c:ada_array_bound_from_type ada-lang.c:ada_array_length ada-lang.c:resolve ada-lang.c:ada_resolve_function ada-lang.c:ada_tag_name_2 ada-lang.c:ada_variant_discrim_type ada-lang.c:pos_atr ada-lang.c:cast_to_fixed ada-lang.c:cast_from_fixed_to_double ada-lang.c:assign_component ada-lang.c:ada_evaluate_subexp ada-lang.c:to_fixed_range_type ada-lex.l:processInt ada-typeprint.c:print_range ada-typeprint.c:print_range_bound ada-typeprint.c:print_range_type_named ada-valprint.c:print_optional_low_bound ada-valprint.c:ada_val_print_1 cp-valprint.c:cp_print_value_fields cp-valprint.c:cp_print_class_member c-valprint.c:c_val_print f-exp.y:(rules) f-exp.y:parse_number f-lang.c:f_create_fundamental_type f-valprint.c:f77_get_dynamic_lowerbound f-valprint.c:f77_get_dynamic_upperbound f-valprint.c:f_val_print gnu-v2-abi.c:gnuv2_virtual_fn_field gnu-v3-abi.c:build_gdb_vtable_type gnu-v3-abi.c:gnuv3_get_virtual_fn gnu-v3-abi.c:gnuv3_baseclass_offset gnu-v3-abi.c:gnuv3_print_method_ptr gnu-v3-abi.c:gnuv3_method_ptr_size gnu-v3-abi.c:gnuv3_method_ptr_to_value jv-exp.y:parse_number jv-exp.y:push_expression_name jv-lang.c:java_array_type jv-lang.c:evaluate_subexp_java m2-exp.y:(rules) m2-typeprint.c:m2_print_bounds m2-typeprint.c:m2_is_long_set_of_type m2-valprint.c:m2_print_long_set m2-valprint.c:print_variable_at_address m2-valprint.c:m2_val_print objc-exp.y:(rules) objc-exp.y:parse_number objc-exp.y:yylex objc-lang.c:value_nsstring objc-lang.c:print_object_command objc-lang.c:find_implementation p-exp.y:(rules) p-exp.y:parse_number p-exp.y:yylex p-typeprint.c:pascal_type_print_base p-valprint.c:pascal_val_print Tdep code: alpha-tdep.c:alpha_register_type alpha-tdep.c:alpha_push_dummy_call alpha-tdep.c:alpha_store_return_value amd64-linux-tdep.c:amd64_linux_register_type amd64-tdep.c:amd64_register_type arm-tdep.c:arm_register_type avr-tdep.c:avr_register_type cris-tdep.c:cris_register_type frv-tdep.c:frv_register_type h8300-tdep.c:h8300_register_type hppa-tdep.c:hppa64_push_dummy_call hppa-tdep.c:hppa32_convert_from_func_ptr_addr hppa-tdep.c:hppa32_register_type hppa-tdep.c:hppa64_register_type hppa-tdep.c:hppa_skip_trampoline_code i386-tdep.c:i386_unwind_pc i386-tdep.c:i386_get_longjmp_target i386-tdep.c:i386_extract_return_value i386-tdep.c:i386_store_return_value i386-tdep.c:i386_mmx_type i386-tdep.c:i386_sse_type i386-tdep.c:i386_register_type i387-tdep.c:print_i387_value i387-tdep.c:i387_register_to_value i387-tdep.c:i387_value_to_register ia64-tdep.c:ia64_register_type iq2000-tdep.c:iq2000_return_value m32r-tdep.c:m32r_register_type m68hc11-tdep.c:m68hc11_pseudo_register_read m68hc11-tdep.c:m68hc11_pseudo_register_write m68hc11-tdep.c:m68hc11_register_type m68k-tdep.c:m68k_register_type m68k-tdep.c:m68k_register_to_value m68k-tdep.c:m68k_value_to_register m68k-tdep.c:m68k_svr4_extract_return_value m68k-tdep.c:m68k_svr4_store_return_value m68k-tdep.c:m68k_unwind_pc m99k-tdep.c:m88k_register_type m99k-tdep.c:m88k_store_arguments mep-tdep.c:mep_register_type mips-tdep.cmips_register_type mips-tdep.cmips_o64_return_value mips-tdep.cmips_print_fp_register mn10300-tdep.c:mn10300_register_type mt-tdep.c:mt_copro_register_type mt-tdep.c:mt_register_type ppc-sysv-tdep.c:ppc_sysv_abi_push_dummy_call rs6000-tdep.c:rs6000_builtin_type_vec64 rs6000-tdep.c:rs6000_builtin_type_vec128 rs6000-tdep.c:rs6000_register_type rs6000-tdep.c:rs6000_convert_register_p rs6000-tdep.c:rs6000_register_to_value rs6000-tdep.c:rs6000_value_to_register s390-tdep.c:s390_register_type score-tdep.c:score_register_type sparc-tdep.c:sparc32_register_type sparc-tdep.c:sparc32_store_arguments sparc64-tdep.c:sparc64_register_type sparc64-tdep.c:sparc64_store_arguments spu-tdep.c:spu_builtin_type_vec128 spu-tdep.c:spu_register_type sh-tdep.c:sh_sh2a_register_type sh-tdep.c:sh_sh3e_register_type sh-tdep.c:sh_sh4_build_float_register_type sh-tdep.c:sh_sh4_register_type sh64-tdep.c:sh64_build_float_register_type sh64-tdep.c:sh64_register_type sh64-tdep.c:sh64_do_fp_register v850-tdep.c:v850_register_type vax-tdep.c:vax_register_type xstormy16-tdep.c:xstormy16_register_type xtensa-tdep.c:xtensa_register_type xtensa-tdep.c:xtensa_unwind_pc xtensa-tdep.c:xtensa_push_dummy_call -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com