From: David Carlton Date: Fri, 18 Oct 2002 23:42:59 +0000 (+0000) Subject: 2002-10-18 David Carlton X-Git-Tag: newlib-1_11_0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f412952b65dfc75058dfd6db20c3caffd832045;p=thirdparty%2Fbinutils-gdb.git 2002-10-18 David Carlton * Makefile.in (block_h): New variable. Updated dependencies to reflect it. * parse.c (parse_exp_1): Use BLOCK_START. #include "block.h" * p-exp.tab.c: Regenerated. * m2-exp.tab.c: Ditto. * jv-exp.tab.c: Ditto. * f-exp.tab.c: Ditto. * c-exp.tab.c: Ditto. * ada-exp.tab.c: Ditto. * ada-lang.c: #include "block.h" * p-exp.y: Ditto. * objc-exp.y: Ditto. * m2-exp.y: Ditto. * jv-exp.y: Ditto. * f-exp.y: Ditto. * c-exp.y: Ditto. * ada-exp.y: Ditto. * values.c: Ditto. * valops.c: Ditto. * tracepoint.c: Ditto. * symtab.c: Ditto. * symmisc.c: Ditto. * symfile.c: Ditto. * stack.c: Ditto. * printcmd.c: Ditto. * objfiles.c: Ditto. * objc-lang.c: Ditto. * nlmread.c: Ditto. * mips-tdep.c: Ditto. * mdebugread.c: Ditto. * linespec.c: Ditto. * jv-lang.c: Ditto. * infcmd.c: Ditto. * f-valprint.c: Ditto. * findvar.c: Ditto. * expprint.c: Ditto. * coffread.c: Ditto. * buildsym.c: Ditto. * breakpoint.c: Ditto. * blockframe.c: Ditto. * ax-gdb.c: Ditto. * alpha-tdep.c: Ditto. * block.h: New file. * symtab.h: Moved struct block, struct blockvector, and related macros and function declarations to block.h. * dwarf2read.c (process_die): Set processing_has_namespace_info if we run into DW_TAG_namespace, DW_TAG_imported_declaration, or DW_TAG_imported_module. New variable current_namespace. (psymtab_to_symtab_1): Set current_namespace to "". (dwarf2_name): New function. (dwarf2_add_member_fn): Get name via dwarf2_name. (read_typedef): Ditto. (read_file_scope): Ditto. (dwarf2_add_field): Ditto. (read_structure_scope): Ditto. (read_enumeration): Ditto. (dwarf2_extension): New function. (read_namespace): Set current_namespace correctly; also, if we're entering an anonymous namespace, add an appropriate using directive. * buildsym.c (start_symtab): Reset processing_has_namespace_info to 0. (add_symbol_to_list): Only scan for anonymous namespaces if !processing_has_namespace_info. * buildsym.h: Add new flag processing_has_namespace_info. 2002-10-18 David Carlton * mi-cmd-stack.c: #include "block.h" --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e0c59bf81a6..60aad17647e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,73 @@ +2002-10-18 David Carlton + + * Makefile.in (block_h): New variable. + Updated dependencies to reflect it. + * parse.c (parse_exp_1): Use BLOCK_START. + #include "block.h" + * p-exp.tab.c: Regenerated. + * m2-exp.tab.c: Ditto. + * jv-exp.tab.c: Ditto. + * f-exp.tab.c: Ditto. + * c-exp.tab.c: Ditto. + * ada-exp.tab.c: Ditto. + * ada-lang.c: #include "block.h" + * p-exp.y: Ditto. + * objc-exp.y: Ditto. + * m2-exp.y: Ditto. + * jv-exp.y: Ditto. + * f-exp.y: Ditto. + * c-exp.y: Ditto. + * ada-exp.y: Ditto. + * values.c: Ditto. + * valops.c: Ditto. + * tracepoint.c: Ditto. + * symtab.c: Ditto. + * symmisc.c: Ditto. + * symfile.c: Ditto. + * stack.c: Ditto. + * printcmd.c: Ditto. + * objfiles.c: Ditto. + * objc-lang.c: Ditto. + * nlmread.c: Ditto. + * mips-tdep.c: Ditto. + * mdebugread.c: Ditto. + * linespec.c: Ditto. + * jv-lang.c: Ditto. + * infcmd.c: Ditto. + * f-valprint.c: Ditto. + * findvar.c: Ditto. + * expprint.c: Ditto. + * coffread.c: Ditto. + * buildsym.c: Ditto. + * breakpoint.c: Ditto. + * blockframe.c: Ditto. + * ax-gdb.c: Ditto. + * alpha-tdep.c: Ditto. + * block.h: New file. + * symtab.h: Moved struct block, struct blockvector, and related + macros and function declarations to block.h. + * dwarf2read.c (process_die): Set processing_has_namespace_info if + we run into DW_TAG_namespace, DW_TAG_imported_declaration, or + DW_TAG_imported_module. + New variable current_namespace. + (psymtab_to_symtab_1): Set current_namespace to "". + (dwarf2_name): New function. + (dwarf2_add_member_fn): Get name via dwarf2_name. + (read_typedef): Ditto. + (read_file_scope): Ditto. + (dwarf2_add_field): Ditto. + (read_structure_scope): Ditto. + (read_enumeration): Ditto. + (dwarf2_extension): New function. + (read_namespace): Set current_namespace correctly; also, if we're + entering an anonymous namespace, add an appropriate using + directive. + * buildsym.c (start_symtab): Reset processing_has_namespace_info + to 0. + (add_symbol_to_list): Only scan for anonymous namespaces if + !processing_has_namespace_info. + * buildsym.h: Add new flag processing_has_namespace_info. + 2002-10-16 David Carlton * dwarf2read.c (dwarf_tag_name): Add DWARF 3 names. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index ed359957d2d..248f38f6453 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -621,6 +621,7 @@ arm_tdep_h = arm-tdep.h $(osabi_h) ax_gdb_h = ax-gdb.h ax_h = ax.h $(doublest_h) bcache_h = bcache.h +block_h = block.h breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) buildsym_h = buildsym.h builtin_regs_h = builtin-regs.h @@ -1437,28 +1438,28 @@ z8k-tdep.o: $(srcdir)/z8k-tdep.c c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ $(charset_h) \ - $(symfile_h) $(objfiles_h) + $(symfile_h) $(objfiles_h) $(block_h) jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ - $(symfile_h) + $(symfile_h) $(block_h) m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ - $(bfd_h) objfiles.h symfile.h + $(bfd_h) objfiles.h symfile.h $(block_h) # # The dependencies. In aphabetic order. @@ -1470,7 +1471,8 @@ abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ $(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \ $(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ - $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(dictionary_h) $(ui_out_h) + $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(dictionary_h) \ + $(ui_out_h) $(block_h) ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \ $(inferior_h) $(symtab_h) $(target_h) $(gdbcore_h) $(gregset_h) \ $(ada_lang_h) @@ -1493,7 +1495,7 @@ alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) $(symfile_h) \ $(objfiles_h) $(gdb_string_h) $(linespec_h) $(regcache_h) \ - $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) + $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) $(block_h) alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h) alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ @@ -1528,23 +1530,26 @@ avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ - $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \ - $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) + $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \ + $(block_h) breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \ $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ $(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \ - $(cli_script_h) $(gdb_events_h) $(source_h) $(dictionary_h) + $(cli_script_h) $(gdb_events_h) $(source_h) $(dictionary_h) \ + $(block_h) buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(complaints_h) \ $(gdb_string_h) $(expression_h) $(language_h) $(bcache_h) \ $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ - $(stabsread_h) $(dictionary_h) $(gdb_assert_h) $(cp_support_h) + $(stabsread_h) $(dictionary_h) $(gdb_assert_h) $(cp_support_h) \ + $(block_h) builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ $(gdb_string_h) $(gdb_assert_h) c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1570,7 +1575,7 @@ coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \ $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \ $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \ $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \ - $(target_h) $(gdb_assert_h) $(dictionary_h) + $(target_h) $(gdb_assert_h) $(dictionary_h) $(block_h) complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \ $(command_h) $(gdbcmd_h) completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1659,7 +1664,7 @@ exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ - $(value_h) $(language_h) $(parser_defs_h) + $(value_h) $(language_h) $(parser_defs_h) $(block_h) f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ $(valprint_h) @@ -1668,13 +1673,13 @@ f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(f_lang_h) $(gdb_string_h) f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ - $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) + $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) $(block_h) fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(gdb_string_h) $(elf_bfd_h) $(gregset_h) findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \ $(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \ $(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \ - $(builtin_regs_h) + $(builtin_regs_h) $(block_h) fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \ $(terminal_h) $(gdbthread_h) $(command_h) @@ -1790,7 +1795,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \ $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \ $(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \ - $(parser_defs_h) $(regcache_h) + $(parser_defs_h) $(regcache_h) $(block_h) inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) infptrace.o: infptrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ @@ -1811,7 +1816,7 @@ irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ - $(jv_lang_h) $(gdbcore_h) $(dictionary_h) + $(jv_lang_h) $(gdbcore_h) $(dictionary_h) $(block_h) jv-typeprint.o: jv-typeprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(demangle_h) $(jv_lang_h) $(gdb_string_h) $(typeprint_h) \ $(c_lang_h) $(cp_abi_h) @@ -1828,7 +1833,7 @@ lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \ $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \ - $(cp_abi_h) $(source_h) + $(cp_abi_h) $(source_h) $(block_h) linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \ $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ $(cli_decode_h) $(gdb_string_h) @@ -1893,7 +1898,8 @@ mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ - $(aout_stab_gnu_h) $(expression_h) $(language_h) $(dictionary_h) + $(aout_stab_gnu_h) $(expression_h) $(language_h) $(dictionary_h) \ + $(block_h) mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \ $(target_h) memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \ @@ -1909,7 +1915,7 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ $(regcache_h) $(osabi_h) $(opcode_mips_h) $(elf_mips_h) $(elf_bfd_h) \ - $(symcat_h) + $(symcat_h) $(block_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(mipsnbsd_tdep_h) @@ -1937,7 +1943,7 @@ monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ nbsd-tdep.o: nbsd-tdep.c $(defs_h) $(gdb_string_h) $(solib_svr4_h) nindy-tdep.o: nindy-tdep.c $(defs_h) $(symtab_h) $(frame_h) $(gdbcore_h) nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ - $(objfiles_h) $(buildsym_h) $(stabsread_h) + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(block_h) ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \ $(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) \ $(ns32k_tdep_h) $(gdb_string_h) @@ -1947,7 +1953,7 @@ ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h) $(gdb_string_h) objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \ - $(dictionary_h) + $(dictionary_h) $(block_h) ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h) @@ -1972,7 +1978,7 @@ pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \ parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \ $(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \ - $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) + $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) $(block_h) ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ $(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \ @@ -1995,7 +2001,7 @@ printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ - $(gdb_assert_h) $(dictionary_h) + $(gdb_assert_h) $(dictionary_h) $(block_h) proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(proc_utils_h) proc-events.o: proc-events.c $(defs_h) proc-flags.o: proc-flags.c $(defs_h) @@ -2185,7 +2191,7 @@ stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \ stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) $(target_h) $(breakpoint_h) $(demangle_h) $(inferior_h) \ - $(annotate_h) $(ui_out_h) $(source_h) $(dictionary_h) + $(annotate_h) $(ui_out_h) $(source_h) $(dictionary_h) $(block_h) standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \ $(inferior_h) $(gdb_wait_h) std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ @@ -2196,7 +2202,8 @@ symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ - $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) + $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) \ + $(block_h) symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(target_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) $(gdbcore_h) symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ @@ -2204,13 +2211,14 @@ symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ $(gdb_obstack_h) $(language_h) $(bcache_h) $(dictionary_h) \ - $(gdb_string_h) + $(gdb_string_h) $(block_h) symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ $(filenames_h) $(dictionary_h) $(gdb_obstack_h) \ - $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h) $(source_h) $(cp_support_h) + $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h) $(source_h) $(cp_support_h) \ + $(block_h) target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ $(gdb_wait_h) $(dcache_h) $(regcache_h) @@ -2231,7 +2239,7 @@ tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ - $(ax_gdb_h) $(dictionary_h) + $(ax_gdb_h) $(dictionary_h) $(block_h) typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) @@ -2256,14 +2264,14 @@ valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \ valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \ - $(gdb_assert_h) $(dictionary_h) + $(gdb_assert_h) $(dictionary_h) $(block_h) valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) $(target_h) \ $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \ - $(gdb_assert_h) $(regcache_h) + $(gdb_assert_h) $(regcache_h) $(block_h) varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \ $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h) vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \ @@ -2483,7 +2491,8 @@ mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ - $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(dictionary_h) + $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(dictionary_h) \ + $(block_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 70a4b584f1c..aece48a7316 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -42,6 +42,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "expression.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "ada-lang.h" diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c2d491c246d..70b553d050b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -24,6 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "demangle.h" #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "gdbcmd.h" #include "expression.h" diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 7018d39773e..1003eed7c5c 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -23,6 +23,7 @@ #include "frame.h" #include "inferior.h" #include "symtab.h" +#include "block.h" #include "value.h" #include "gdbcmd.h" #include "gdbcore.h" diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 8f23905a90d..fda84362a3a 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -20,6 +20,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "symfile.h" #include "gdbtypes.h" #include "value.h" diff --git a/gdb/block.h b/gdb/block.h new file mode 100644 index 00000000000..b2498636c51 --- /dev/null +++ b/gdb/block.h @@ -0,0 +1,138 @@ +/* Block definitions for GDB. + Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* All of the name-scope contours of the program + are represented by `struct block' objects. + All of these objects are pointed to by the blockvector. + + Each block represents one name scope. + Each lexical context has its own block. + + The blockvector begins with some special blocks. + The GLOBAL_BLOCK contains all the symbols defined in this compilation + whose scope is the entire program linked together. + The STATIC_BLOCK contains all the symbols whose scope is the + entire compilation excluding other separate compilations. + Blocks starting with the FIRST_LOCAL_BLOCK are not special. + + Each block records a range of core addresses for the code that + is in the scope of the block. The STATIC_BLOCK and GLOBAL_BLOCK + give, for the range of code, the entire range of code produced + by the compilation that the symbol segment belongs to. + + The blocks appear in the blockvector + in order of increasing starting-address, + and, within that, in order of decreasing ending-address. + + This implies that within the body of one function + the blocks appear in the order of a depth-first tree walk. */ + +/* Opaque declarations. */ + +struct symbol; +struct dictionary; +struct using_direct_node; + +struct block +{ + + /* Addresses in the executable code that are in this block. */ + + CORE_ADDR startaddr; + CORE_ADDR endaddr; + + /* The symbol that names this block, if the block is the body of a + function; otherwise, zero. */ + + struct symbol *function; + + /* The `struct block' for the containing block, or 0 if none. + + The superblock of a top-level local block (i.e. a function in the + case of C) is the STATIC_BLOCK. The superblock of the + STATIC_BLOCK is the GLOBAL_BLOCK. */ + + struct block *superblock; + + /* This is used to store the symbols in the block. */ + + struct dictionary *dict; + + /* Used for language-specific info. */ + + union + { + struct + { + /* Contains information about what using directives or other + similar features are added by this block. This should always + be NULL for global blocks: if there are using directives that + affect an entire file, put it in the static block. */ + + struct using_direct_node *using; + } + cplus_specific; + } + language_specific; + + /* Version of GCC used to compile the function corresponding + to this block, or 0 if not compiled with GCC. When possible, + GCC should be compatible with the native compiler, or if that + is not feasible, the differences should be fixed during symbol + reading. As of 16 Apr 93, this flag is never used to distinguish + between gcc2 and the native compiler. + + If there is no function corresponding to this block, this meaning + of this flag is undefined. */ + + unsigned char gcc_compile_flag; +}; + +#define BLOCK_START(bl) (bl)->startaddr +#define BLOCK_END(bl) (bl)->endaddr +#define BLOCK_FUNCTION(bl) (bl)->function +#define BLOCK_SUPERBLOCK(bl) (bl)->superblock +#define BLOCK_DICT(bl) (bl)->dict +#define BLOCK_USING(bl) (bl)->language_specific.cplus_specific.using +#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag + +struct blockvector +{ + /* Number of blocks in the list. */ + int nblocks; + /* The blocks themselves. */ + struct block *block[1]; +}; + +#define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks +#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n] + +/* Special block numbers */ + +#define GLOBAL_BLOCK 0 +#define STATIC_BLOCK 1 +#define FIRST_LOCAL_BLOCK 2 + +extern struct symbol *block_function (struct block *); + +extern int contained_in (struct block *, struct block *); + diff --git a/gdb/blockframe.c b/gdb/blockframe.c index eba45a377d9..12452c8e74b 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -24,6 +24,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "bfd.h" #include "symfile.h" #include "objfiles.h" diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d52153f7f40..47eac4ecb7c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -24,6 +24,7 @@ #include "defs.h" #include #include "symtab.h" +#include "block.h" #include "frame.h" #include "breakpoint.h" #include "gdbtypes.h" diff --git a/gdb/buildsym.c b/gdb/buildsym.c index bca5332171d..1371f3799cf 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -30,6 +30,7 @@ #include "bfd.h" #include "gdb_obstack.h" #include "symtab.h" +#include "block.h" #include "symfile.h" /* Needed for "struct complaint", obsavestring */ #include "objfiles.h" #include "gdbtypes.h" @@ -159,6 +160,7 @@ add_symbol_to_list (struct symbol *symbol, struct pending **listhead) namespaces. */ if (SYMBOL_LANGUAGE (symbol) == language_cplus + && !processing_has_namespace_info && SYMBOL_CPLUS_DEMANGLED_NAME (symbol) != NULL) scan_for_anonymous_namespaces (symbol); } @@ -888,6 +890,7 @@ start_symtab (char *name, char *dirname, CORE_ADDR start_addr) global_symbols = NULL; within_function = 0; have_line_numbers = 0; + processing_has_namespace_info = 0; using_list = NULL; /* Context stack is initially empty. Allocate first one with room @@ -1185,10 +1188,6 @@ copy_usings_to_obstack (struct using_direct_node *usings, } } -/* Search the block for global symbols indicating the presence of - anonymous namespaces; add using declarations for them, if - found. */ - /* Push a context block. Args are an identifying nesting level (checkable when you pop it), and the starting PC address of this context. */ diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 28442a7f28f..3b8c16fa19f 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -93,6 +93,12 @@ EXTERN unsigned char processing_acc_compilation; EXTERN unsigned char processing_hp_compilation; +/* When set, the file that we're processing seems to have debugging + info for C++ namespaces, so buildsym.c shouldn't try to guess + namespace info itself. */ + +EXTERN unsigned char processing_has_namespace_info; + /* Count symbols as they are processed, for error messages. */ EXTERN unsigned int symnum; diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 1f344c47b7b..94d29ba4a74 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "expression.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "c-lang.h" diff --git a/gdb/coffread.c b/gdb/coffread.c index fee392f3c4e..ff0f396b4c8 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -23,6 +23,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "demangle.h" #include "breakpoint.h" diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9bb2526c291..1de9e8094b8 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -388,6 +388,13 @@ static struct partial_die_info zeroed_partial_die; in buildsym.c. */ static struct pending **list_in_scope = &file_symbols; +/* If we're debugging C++ code, this string should contain the name of + the current namespace. Other people shouldn't have to copy it when + referring to it, so don't free its previous contents when setting + this to a new value. */ + +static const char *current_namespace; + /* FIXME: decode_locdesc sets these variables to describe the location to the caller. These ought to be a structure or something. If none of the flags are set, the object lives at the address returned @@ -884,6 +891,10 @@ static void process_die (struct die_info *, struct objfile *, static char *dwarf2_linkage_name (struct die_info *); +static char *dwarf2_name (struct die_info *); + +static struct die_info * dwarf2_extension (struct die_info *die); + static char *dwarf_tag_name (unsigned int); static char *dwarf_attr_name (unsigned int); @@ -1599,6 +1610,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) cu_header_offset = offset; info_ptr = dwarf_info_buffer + offset; + /* We're in the global namespace. */ + current_namespace = ""; + obstack_init (&dwarf2_tmp_obstack); back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL); @@ -1724,6 +1738,7 @@ process_die (struct die_info *die, struct objfile *objfile, case DW_TAG_common_inclusion: break; case DW_TAG_namespace: + processing_has_namespace_info = 1; read_namespace (die, objfile, cu_header); break; case DW_TAG_imported_declaration: @@ -1734,6 +1749,7 @@ process_die (struct die_info *die, struct objfile *objfile, shouldn't in the C++ case, but conceivably could in the Fortran case, so we'll have to replace this gdb_assert if Fortran compilers start generating that info. */ + processing_has_namespace_info = 1; gdb_assert (!die->has_children); break; default: @@ -1756,7 +1772,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile, CORE_ADDR lowpc = ((CORE_ADDR) -1); CORE_ADDR highpc = ((CORE_ADDR) 0); struct attribute *attr; - char *name = ""; + char *name; char *comp_dir = NULL; struct die_info *child_die; bfd *abfd = objfile->obfd; @@ -1791,11 +1807,9 @@ read_file_scope (struct die_info *die, struct objfile *objfile, lowpc += baseaddr; highpc += baseaddr; - attr = dwarf_attr (die, DW_AT_name); - if (attr) - { - name = DW_STRING (attr); - } + name = dwarf2_name (die); + if (name == NULL) + name = ""; attr = dwarf_attr (die, DW_AT_comp_dir); if (attr) { @@ -2082,7 +2096,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, struct nextfield *new_field; struct attribute *attr; struct field *fp; - char *fieldname = ""; + char *fieldname; /* Allocate a new field list entry and link it in. */ new_field = (struct nextfield *) xmalloc (sizeof (struct nextfield)); @@ -2181,9 +2195,9 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, } /* Get name of field. */ - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) - fieldname = DW_STRING (attr); + fieldname = dwarf2_name (die); + if (fieldname == NULL) + fieldname = ""; fp->name = obsavestring (fieldname, strlen (fieldname), &objfile->type_obstack); @@ -2201,10 +2215,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, /* C++ static member. Get name of field. */ - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) - fieldname = DW_STRING (attr); - else + fieldname = dwarf2_name (die); + if (fieldname == NULL) return; /* Get physical name. */ @@ -2333,10 +2345,9 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, struct nextfnfield *new_fnfield; /* Get name of member function. */ - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) - fieldname = DW_STRING (attr); - else + + fieldname = dwarf2_name (die); + if (fieldname == NULL) return; /* Get the mangled name. */ @@ -2513,15 +2524,15 @@ read_structure_scope (struct die_info *die, struct objfile *objfile, { struct type *type; struct attribute *attr; + char *name; type = alloc_type (objfile); INIT_CPLUS_SPECIFIC (type); - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) + name = dwarf2_name (die); + if (name != NULL) { - TYPE_TAG_NAME (type) = obsavestring (DW_STRING (attr), - strlen (DW_STRING (attr)), + TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->type_obstack); } @@ -2672,17 +2683,17 @@ read_enumeration (struct die_info *die, struct objfile *objfile, struct field *fields; struct attribute *attr; struct symbol *sym; + char *name; int num_fields; int unsigned_enum = 1; type = alloc_type (objfile); TYPE_CODE (type) = TYPE_CODE_ENUM; - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) + name = dwarf2_name (die); + if (name != NULL) { - TYPE_TAG_NAME (type) = obsavestring (DW_STRING (attr), - strlen (DW_STRING (attr)), + TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->type_obstack); } @@ -2960,6 +2971,43 @@ static void read_namespace (struct die_info *die, struct objfile *objfile, const struct comp_unit_head *cu_header) { + const char *previous_namespace = current_namespace; + const char *name = NULL; + int is_anonymous; + struct die_info *current_die; + + /* Loop through the extensions until we find a name. */ + + for (current_die = die; current_die != NULL; + current_die = dwarf2_extension (die)) + { + name = dwarf2_name (die); + if (name != NULL) + break; + } + + /* Is it an anonymous namespace? */ + + is_anonymous = (name == NULL); + if (is_anonymous) + name = "(anonymous namespace)"; + + /* Now build the name of the current namespace. */ + + current_namespace = obconcat (&objfile->symbol_obstack, + previous_namespace, + previous_namespace[0] == '\0' ? "" : "::", + name); + + /* If it's an anonymous namespace that we're seeing for the first + time, add a using directive. */ + + if (is_anonymous && dwarf_attr (die, DW_AT_extension) == NULL) + add_using_directive (current_namespace, + strlen (previous_namespace), + strlen (current_namespace)); + + if (die->has_children) { struct die_info *child_die = die->next; @@ -2970,6 +3018,8 @@ read_namespace (struct die_info *die, struct objfile *objfile, child_die = sibling_die (child_die); } } + + current_namespace = previous_namespace; } /* Extract all information from a DW_TAG_pointer_type DIE and add to @@ -3225,11 +3275,7 @@ read_typedef (struct die_info *die, struct objfile *objfile, if (!die->type) { - attr = dwarf_attr (die, DW_AT_name); - if (attr && DW_STRING (attr)) - { - name = DW_STRING (attr); - } + name = dwarf2_name (die); die->type = init_type (TYPE_CODE_TYPEDEF, 0, TYPE_FLAG_TARGET_STUB, name, objfile); TYPE_TARGET_TYPE (die->type) = die_type (die, objfile, cu_header); } @@ -5412,6 +5458,43 @@ dwarf2_linkage_name (struct die_info *die) return NULL; } +/* Get name of a die, return NULL if not found. */ + +static char * +dwarf2_name (struct die_info *die) +{ + struct attribute *attr; + + attr = dwarf_attr (die, DW_AT_name); + if (attr && DW_STRING (attr)) + return DW_STRING (attr); + return NULL; +} + +/* Return the die that this die in an extension of, or NULL if there + is none. */ + +static struct die_info * +dwarf2_extension (struct die_info *die) +{ + struct attribute *attr; + struct die_info *extension_die; + unsigned int ref; + + attr = dwarf_attr (die, DW_AT_extension); + if (attr == NULL) + return NULL; + + ref = dwarf2_get_ref_die_offset (attr); + extension_die = follow_die_ref (ref); + if (!extension_die) + { + error ("Dwarf Error: Cannot find referent at offset %d.", ref); + } + + return extension_die; +} + /* Convert a DIE tag into its string name. */ static char * diff --git a/gdb/expprint.c b/gdb/expprint.c index aa8b8762012..aa5c65853ea 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -21,6 +21,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "value.h" diff --git a/gdb/f-exp.y b/gdb/f-exp.y index b9004264eec..57db6fa09bc 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -47,6 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" #include "expression.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "f-lang.h" diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 48c511377e8..deff31dc3e5 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -24,6 +24,7 @@ #include "defs.h" #include "gdb_string.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "value.h" diff --git a/gdb/findvar.c b/gdb/findvar.c index d2591321d75..b14c532a524 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -22,6 +22,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "frame.h" #include "value.h" diff --git a/gdb/infcmd.c b/gdb/infcmd.c index a36258152c7..71daee343db 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -24,6 +24,7 @@ #include #include "gdb_string.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "frame.h" #include "inferior.h" diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index b4ae3401ea4..d4c315f4770 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -42,6 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "expression.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "jv-lang.h" diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index b5d2df995b1..c0daf07286f 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -20,6 +20,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "parser-defs.h" diff --git a/gdb/linespec.c b/gdb/linespec.c index 5631fd31433..24dc640a3d3 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -22,6 +22,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "frame.h" #include "command.h" #include "symfile.h" diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index e291d62b1cb..0957c874ba1 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "expression.h" #include "language.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "m2-lang.h" #include "bfd.h" /* Required by objfiles.h. */ diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index d817e93e3ac..e9c3b8124d7 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -43,6 +43,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "symfile.h" diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 3cbd2ec12c9..78795729b09 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,7 @@ +2002-10-18 David Carlton + + * mi-cmd-stack.c: #include "block.h" + 2002-10-03 Jeff Johnston * gdbmi.texinfo: Fix examples that show frames to remove diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index f89ff2babb0..f01601a3e39 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -26,6 +26,7 @@ #include "mi-cmds.h" #include "ui-out.h" #include "symtab.h" +#include "block.h" #include "dictionary.h" /* FIXME: these should go in some .h file but stack.c doesn't have a diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 39086066332..8aa61c774fa 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -28,6 +28,7 @@ #include "frame.h" #include "inferior.h" #include "symtab.h" +#include "block.h" #include "value.h" #include "gdbcmd.h" #include "language.h" diff --git a/gdb/nlmread.c b/gdb/nlmread.c index eaa9ddeb2f3..9d692ddd906 100644 --- a/gdb/nlmread.c +++ b/gdb/nlmread.c @@ -23,6 +23,7 @@ #include "defs.h" #include "bfd.h" #include "symtab.h" +#include "block.h" #include "symfile.h" #include "objfiles.h" #include "buildsym.h" diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 2ccc8824455..fbeb3a5771f 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -44,6 +44,7 @@ #include "objc-lang.h" /* For objc language constructs. */ #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "c-lang.h" diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 0c749a2ebe5..6f379484ac2 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -24,6 +24,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "parser-defs.h" diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 88003e62d59..8f36f8af655 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -28,6 +28,7 @@ #include "defs.h" #include "bfd.h" /* Binary File Description */ #include "symtab.h" +#include "block.h" #include "symfile.h" #include "objfiles.h" #include "gdb-stabs.h" diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 4dc99be8ce4..dfdab74079a 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "expression.h" #include "value.h" +#include "block.h" #include "parser-defs.h" #include "language.h" #include "p-lang.h" diff --git a/gdb/parse.c b/gdb/parse.c index 29b8e3c3709..5762d6f4168 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -48,6 +48,7 @@ with "gdbarch.h" when appropriate. */ #include "doublest.h" #include "gdb_assert.h" +#include "block.h" /* Symbols which architectures can redefine. */ @@ -1107,7 +1108,7 @@ parse_exp_1 (char **stringptr, struct block *block, int comma) if (block) { expression_context_block = block; - expression_context_pc = block->startaddr; + expression_context_pc = BLOCK_START (block); } else expression_context_block = get_selected_block (&expression_context_pc); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index ade4b18e5b2..cc9d897e3d7 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -25,6 +25,7 @@ #include "gdb_string.h" #include "frame.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "value.h" #include "language.h" diff --git a/gdb/stack.c b/gdb/stack.c index 37070b45ade..3ed82e67855 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -26,6 +26,7 @@ #include "gdb_string.h" #include "value.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "language.h" diff --git a/gdb/symfile.c b/gdb/symfile.c index 6d794d57ffc..f78aa63e5aa 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -24,6 +24,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "frame.h" diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 6cea2f1aeb0..42b27e347f4 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -23,6 +23,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "bfd.h" #include "symfile.h" diff --git a/gdb/symtab.c b/gdb/symtab.c index 390c7643c47..b397440eecc 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -23,6 +23,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "frame.h" diff --git a/gdb/symtab.h b/gdb/symtab.h index fcfca15820f..91a2c459c0b 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -25,8 +25,8 @@ /* Opaque declarations. */ struct obstack; -struct dictionary; -struct using_direct_node; +struct block; +struct blockvector; /* Don't do this; it means that if some .o's are compiled with GNU C and some are not (easy to do accidentally the way we configure @@ -328,114 +328,6 @@ struct minimal_symbol #define MSYMBOL_INFO(msymbol) (msymbol)->info #define MSYMBOL_TYPE(msymbol) (msymbol)->type - - - -/* All of the name-scope contours of the program - are represented by `struct block' objects. - All of these objects are pointed to by the blockvector. - - Each block represents one name scope. - Each lexical context has its own block. - - The blockvector begins with some special blocks. - The GLOBAL_BLOCK contains all the symbols defined in this compilation - whose scope is the entire program linked together. - The STATIC_BLOCK contains all the symbols whose scope is the - entire compilation excluding other separate compilations. - Blocks starting with the FIRST_LOCAL_BLOCK are not special. - - Each block records a range of core addresses for the code that - is in the scope of the block. The STATIC_BLOCK and GLOBAL_BLOCK - give, for the range of code, the entire range of code produced - by the compilation that the symbol segment belongs to. - - The blocks appear in the blockvector - in order of increasing starting-address, - and, within that, in order of decreasing ending-address. - - This implies that within the body of one function - the blocks appear in the order of a depth-first tree walk. */ - -struct blockvector -{ - /* Number of blocks in the list. */ - int nblocks; - /* The blocks themselves. */ - struct block *block[1]; -}; - -#define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks -#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n] - -/* Special block numbers */ - -#define GLOBAL_BLOCK 0 -#define STATIC_BLOCK 1 -#define FIRST_LOCAL_BLOCK 2 - -struct block -{ - - /* Addresses in the executable code that are in this block. */ - - CORE_ADDR startaddr; - CORE_ADDR endaddr; - - /* The symbol that names this block, if the block is the body of a - function; otherwise, zero. */ - - struct symbol *function; - - /* The `struct block' for the containing block, or 0 if none. - - The superblock of a top-level local block (i.e. a function in the - case of C) is the STATIC_BLOCK. The superblock of the - STATIC_BLOCK is the GLOBAL_BLOCK. */ - - struct block *superblock; - - /* This is used to store the symbols in the block. */ - - struct dictionary *dict; - - /* Used for language-specific info. */ - - union - { - struct - { - /* Contains information about what using directives or other - similar features are added by this block. This should always - be NULL for global blocks: if there are using directives that - affect an entire file, put it in the static block. */ - - struct using_direct_node *using; - } - cplus_specific; - } - language_specific; - - /* Version of GCC used to compile the function corresponding - to this block, or 0 if not compiled with GCC. When possible, - GCC should be compatible with the native compiler, or if that - is not feasible, the differences should be fixed during symbol - reading. As of 16 Apr 93, this flag is never used to distinguish - between gcc2 and the native compiler. - - If there is no function corresponding to this block, this meaning - of this flag is undefined. */ - - unsigned char gcc_compile_flag; -}; - -#define BLOCK_START(bl) (bl)->startaddr -#define BLOCK_END(bl) (bl)->endaddr -#define BLOCK_FUNCTION(bl) (bl)->function -#define BLOCK_SUPERBLOCK(bl) (bl)->superblock -#define BLOCK_DICT(bl) (bl)->dict -#define BLOCK_USING(bl) (bl)->language_specific.cplus_specific.using -#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag @@ -1067,10 +959,6 @@ extern struct type *lookup_union (char *, struct block *); extern struct type *lookup_enum (char *, struct block *); -/* lookup the function corresponding to the block */ - -extern struct symbol *block_function (struct block *); - /* from blockframe.c: */ /* lookup the function symbol corresponding to the address */ @@ -1125,8 +1013,6 @@ extern struct partial_symbol *find_pc_sect_psymbol (struct partial_symtab *, extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *); -extern int contained_in (struct block *, struct block *); - extern void reread_symbols (void); extern struct type *lookup_transparent_type (const char *); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 43559f2edd7..da10242be8c 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -22,6 +22,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "frame.h" #include "gdbtypes.h" #include "expression.h" diff --git a/gdb/valops.c b/gdb/valops.c index 20866d115e8..2c051bed3cd 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -22,6 +22,7 @@ #include "defs.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "value.h" #include "frame.h" diff --git a/gdb/values.c b/gdb/values.c index c943f28fa46..7286becfb08 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -23,6 +23,7 @@ #include "defs.h" #include "gdb_string.h" #include "symtab.h" +#include "block.h" #include "gdbtypes.h" #include "value.h" #include "gdbcore.h"