]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change get_objfile_arch to a method on objfile
authorTom Tromey <tom@tromey.com>
Sat, 18 Apr 2020 14:35:04 +0000 (08:35 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 18 Apr 2020 14:35:04 +0000 (08:35 -0600)
This changes get_objfile_arch to be a new inline method,
objfile::arch.

To my surprise, this function came up while profiling DWARF psymbol
reading.  Making this change improved performance from 1.986 seconds
to 1.869 seconds.  Both measurements were done by taking the mean of
10 runs on a fixed copy of the gdb executable.

gdb/ChangeLog
2020-04-18  Tom Tromey  <tom@tromey.com>

* xcoffread.c (enter_line_range, scan_xcoff_symtab): Update.
* value.c (value_fn_field): Update.
* valops.c (find_function_in_inferior)
(value_allocate_space_in_inferior): Update.
* tui/tui-winsource.c (tui_update_source_windows_with_line):
Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* symtab.c (lookup_global_or_static_symbol)
(find_function_start_sal_1, skip_prologue_sal)
(print_msymbol_info, find_gnu_ifunc, symbol_arch): Update.
* symmisc.c (dump_msymbols, dump_symtab_1)
(maintenance_print_one_line_table): Update.
* symfile.c (init_entry_point_info, section_is_mapped)
(list_overlays_command, simple_read_overlay_table)
(simple_overlay_update_1): Update.
* stap-probe.c (handle_stap_probe): Update.
* stabsread.c (dbx_init_float_type, define_symbol)
(read_one_struct_field, read_enum_type, read_range_type): Update.
* source.c (info_line_command): Update.
* python/python.c (gdbpy_source_objfile_script)
(gdbpy_execute_objfile_script): Update.
* python/py-type.c (save_objfile_types): Update.
* python/py-objfile.c (py_free_objfile): Update.
* python/py-inferior.c (python_new_objfile): Update.
* psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab)
(dump_psymtab_addrmap_1, maintenance_info_psymtabs)
(maintenance_check_psymtabs): Update.
* printcmd.c (info_address_command): Update.
* objfiles.h (struct objfile) <arch>: New method, from
get_objfile_arch.
(get_objfile_arch): Don't declare.
* objfiles.c (get_objfile_arch): Remove.
(filter_overlapping_sections): Update.
* minsyms.c (msymbol_is_function): Update.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines)
(output_nondebug_symbol): Update.
* mdebugread.c (parse_symbol, basic_type, parse_partial_symbols)
(mdebug_expand_psymtab): Update.
* machoread.c (macho_add_oso_symfile): Update.
* linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap):
Update.
* linux-fork.c (checkpoint_command): Update.
* linespec.c (convert_linespec_to_sals): Update.
* jit.c (finalize_symtab): Update.
* infrun.c (insert_exception_resume_from_probe): Update.
* ia64-tdep.c (ia64_find_unwind_table): Update.
* hppa-tdep.c (internalize_unwinds): Update.
* gdbtypes.c (get_type_arch, init_float_type, objfile_type):
Update.
* gcore.c (call_target_sbrk): Update.
* elfread.c (record_minimal_symbol, elf_symtab_read)
(elf_rel_plt_read, elf_gnu_ifunc_record_cache)
(elf_gnu_ifunc_resolve_by_got): Update.
* dwarf2/read.c (create_addrmap_from_index)
(create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab)
(read_debug_names_from_section)
(process_psymtab_comp_unit_reader, add_partial_symbol)
(add_partial_subprogram, process_full_comp_unit)
(read_file_scope, read_func_scope, read_lexical_block_scope)
(read_call_site_scope, dwarf2_ranges_read)
(dwarf2_record_block_ranges, dwarf2_add_field)
(mark_common_block_symbol_computed, read_tag_pointer_type)
(read_tag_string_type, dwarf2_init_float_type)
(dwarf2_init_complex_target_type, read_base_type)
(partial_die_info::read, partial_die_info::read)
(read_attribute_value, dwarf_decode_lines_1, new_symbol)
(dwarf2_fetch_die_loc_sect_off): Update.
* dwarf2/loc.c (dwarf2_find_location_expression)
(class dwarf_evaluate_loc_desc, rw_pieced_value)
(dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval)
(dwarf2_loc_desc_get_symbol_read_needs)
(locexpr_describe_location_piece, locexpr_describe_location_1)
(loclist_describe_location): Update.
* dwarf2/index-write.c (write_debug_names): Update.
* dwarf2/frame.c (dwarf2_build_frame_info): Update.
* dtrace-probe.c (dtrace_process_dof): Update.
* dbxread.c (read_dbx_symtab, dbx_end_psymtab)
(process_one_symbol): Update.
* ctfread.c (ctf_init_float_type, read_base_type): Update.
* coffread.c (coff_symtab_read, enter_linenos, decode_base_type)
(coff_read_enum_type): Update.
* cli/cli-cmds.c (edit_command, list_command): Update.
* buildsym.c (buildsym_compunit::finish_block_internal): Update.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint, get_sal_arch): Update.
* block.c (block_gdbarch): Update.
* annotate.c (annotate_source_line): Update.

47 files changed:
gdb/ChangeLog
gdb/annotate.c
gdb/block.c
gdb/breakpoint.c
gdb/buildsym.c
gdb/cli/cli-cmds.c
gdb/coffread.c
gdb/ctfread.c
gdb/dbxread.c
gdb/dtrace-probe.c
gdb/dwarf2/frame.c
gdb/dwarf2/index-write.c
gdb/dwarf2/loc.c
gdb/dwarf2/read.c
gdb/elfread.c
gdb/gcore.c
gdb/gdbtypes.c
gdb/hppa-tdep.c
gdb/ia64-tdep.c
gdb/infrun.c
gdb/jit.c
gdb/linespec.c
gdb/linux-fork.c
gdb/linux-tdep.c
gdb/machoread.c
gdb/mdebugread.c
gdb/mi/mi-symbol-cmds.c
gdb/minsyms.c
gdb/objfiles.c
gdb/objfiles.h
gdb/printcmd.c
gdb/psymtab.c
gdb/python/py-inferior.c
gdb/python/py-objfile.c
gdb/python/py-type.c
gdb/python/python.c
gdb/source.c
gdb/stabsread.c
gdb/stap-probe.c
gdb/symfile.c
gdb/symmisc.c
gdb/symtab.c
gdb/tui/tui-source.c
gdb/tui/tui-winsource.c
gdb/valops.c
gdb/value.c
gdb/xcoffread.c

index 57418b852fe97fde53cd3c2e50b42dee8ad253fb..7078129fe7c8896aea857c5afd199e1738a7b54d 100644 (file)
@@ -1,3 +1,95 @@
+2020-04-18  Tom Tromey  <tom@tromey.com>
+
+       * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update.
+       * value.c (value_fn_field): Update.
+       * valops.c (find_function_in_inferior)
+       (value_allocate_space_in_inferior): Update.
+       * tui/tui-winsource.c (tui_update_source_windows_with_line):
+       Update.
+       * tui/tui-source.c (tui_source_window::set_contents): Update.
+       * symtab.c (lookup_global_or_static_symbol)
+       (find_function_start_sal_1, skip_prologue_sal)
+       (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update.
+       * symmisc.c (dump_msymbols, dump_symtab_1)
+       (maintenance_print_one_line_table): Update.
+       * symfile.c (init_entry_point_info, section_is_mapped)
+       (list_overlays_command, simple_read_overlay_table)
+       (simple_overlay_update_1): Update.
+       * stap-probe.c (handle_stap_probe): Update.
+       * stabsread.c (dbx_init_float_type, define_symbol)
+       (read_one_struct_field, read_enum_type, read_range_type): Update.
+       * source.c (info_line_command): Update.
+       * python/python.c (gdbpy_source_objfile_script)
+       (gdbpy_execute_objfile_script): Update.
+       * python/py-type.c (save_objfile_types): Update.
+       * python/py-objfile.c (py_free_objfile): Update.
+       * python/py-inferior.c (python_new_objfile): Update.
+       * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab)
+       (dump_psymtab_addrmap_1, maintenance_info_psymtabs)
+       (maintenance_check_psymtabs): Update.
+       * printcmd.c (info_address_command): Update.
+       * objfiles.h (struct objfile) <arch>: New method, from
+       get_objfile_arch.
+       (get_objfile_arch): Don't declare.
+       * objfiles.c (get_objfile_arch): Remove.
+       (filter_overlapping_sections): Update.
+       * minsyms.c (msymbol_is_function): Update.
+       * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines)
+       (output_nondebug_symbol): Update.
+       * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols)
+       (mdebug_expand_psymtab): Update.
+       * machoread.c (macho_add_oso_symfile): Update.
+       * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap):
+       Update.
+       * linux-fork.c (checkpoint_command): Update.
+       * linespec.c (convert_linespec_to_sals): Update.
+       * jit.c (finalize_symtab): Update.
+       * infrun.c (insert_exception_resume_from_probe): Update.
+       * ia64-tdep.c (ia64_find_unwind_table): Update.
+       * hppa-tdep.c (internalize_unwinds): Update.
+       * gdbtypes.c (get_type_arch, init_float_type, objfile_type):
+       Update.
+       * gcore.c (call_target_sbrk): Update.
+       * elfread.c (record_minimal_symbol, elf_symtab_read)
+       (elf_rel_plt_read, elf_gnu_ifunc_record_cache)
+       (elf_gnu_ifunc_resolve_by_got): Update.
+       * dwarf2/read.c (create_addrmap_from_index)
+       (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab)
+       (read_debug_names_from_section)
+       (process_psymtab_comp_unit_reader, add_partial_symbol)
+       (add_partial_subprogram, process_full_comp_unit)
+       (read_file_scope, read_func_scope, read_lexical_block_scope)
+       (read_call_site_scope, dwarf2_ranges_read)
+       (dwarf2_record_block_ranges, dwarf2_add_field)
+       (mark_common_block_symbol_computed, read_tag_pointer_type)
+       (read_tag_string_type, dwarf2_init_float_type)
+       (dwarf2_init_complex_target_type, read_base_type)
+       (partial_die_info::read, partial_die_info::read)
+       (read_attribute_value, dwarf_decode_lines_1, new_symbol)
+       (dwarf2_fetch_die_loc_sect_off): Update.
+       * dwarf2/loc.c (dwarf2_find_location_expression)
+       (class dwarf_evaluate_loc_desc, rw_pieced_value)
+       (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval)
+       (dwarf2_loc_desc_get_symbol_read_needs)
+       (locexpr_describe_location_piece, locexpr_describe_location_1)
+       (loclist_describe_location): Update.
+       * dwarf2/index-write.c (write_debug_names): Update.
+       * dwarf2/frame.c (dwarf2_build_frame_info): Update.
+       * dtrace-probe.c (dtrace_process_dof): Update.
+       * dbxread.c (read_dbx_symtab, dbx_end_psymtab)
+       (process_one_symbol): Update.
+       * ctfread.c (ctf_init_float_type, read_base_type): Update.
+       * coffread.c (coff_symtab_read, enter_linenos, decode_base_type)
+       (coff_read_enum_type): Update.
+       * cli/cli-cmds.c (edit_command, list_command): Update.
+       * buildsym.c (buildsym_compunit::finish_block_internal): Update.
+       * breakpoint.c (create_overlay_event_breakpoint)
+       (create_longjmp_master_breakpoint)
+       (create_std_terminate_master_breakpoint)
+       (create_exception_master_breakpoint, get_sal_arch): Update.
+       * block.c (block_gdbarch): Update.
+       * annotate.c (annotate_source_line): Update.
+
 2020-04-17  Tom Tromey  <tromey@adacore.com>
 
        * auto-load.c (show_auto_load_cmd): Remove.
index cf9e88cee512add96fdff06e33d4fec22f3a961d..6daa0c570179b676ec7aa4e9b2feaf325d54a162 100644 (file)
@@ -450,7 +450,7 @@ annotate_source_line (struct symtab *s, int line, int mid_statement,
        return;
 
       annotate_source (s->fullname, line, (int) (*offsets)[line - 1],
-                      mid_statement, get_objfile_arch (SYMTAB_OBJFILE (s)),
+                      mid_statement, SYMTAB_OBJFILE (s)->arch (),
                       pc);
     }
 }
index 46c24ec96d510d01231be932ac8c9fd0288d701d..9b582433e48b8684f272d424ea2c9dbf997f0bca 100644 (file)
@@ -62,7 +62,7 @@ block_gdbarch (const struct block *block)
   if (BLOCK_FUNCTION (block) != NULL)
     return symbol_arch (BLOCK_FUNCTION (block));
 
-  return get_objfile_arch (block_objfile (block));
+  return block_objfile (block)->arch ();
 }
 
 /* See block.h.  */
index 89eb29628b1efb63bc3c2941ca747e4254d1d534..858f4c756918724072706d0aa6f9e19757646f3d 100644 (file)
@@ -3201,7 +3201,7 @@ create_overlay_event_breakpoint (void)
        }
 
       addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
-      b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
+      b = create_internal_breakpoint (objfile->arch (), addr,
                                       bp_overlay_event,
                                      &internal_breakpoint_ops);
       initialize_explicit_location (&explicit_loc);
@@ -3238,7 +3238,7 @@ create_longjmp_master_breakpoint (void)
        struct gdbarch *gdbarch;
        struct breakpoint_objfile_data *bp_objfile_data;
 
-       gdbarch = get_objfile_arch (objfile);
+       gdbarch = objfile->arch ();
 
        bp_objfile_data = get_breakpoint_objfile_data (objfile);
 
@@ -3362,7 +3362,7 @@ create_std_terminate_master_breakpoint (void)
          }
 
        addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym);
-       b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
+       b = create_internal_breakpoint (objfile->arch (), addr,
                                        bp_std_terminate_master,
                                        &internal_breakpoint_ops);
        initialize_explicit_location (&explicit_loc);
@@ -3414,7 +3414,7 @@ create_exception_master_breakpoint (void)
 
       if (!bp_objfile_data->exception_probes.empty ())
        {
-         gdbarch = get_objfile_arch (objfile);
+         gdbarch = objfile->arch ();
 
          for (probe *p : bp_objfile_data->exception_probes)
            {
@@ -3434,7 +3434,7 @@ create_exception_master_breakpoint (void)
       if (msym_not_found_p (bp_objfile_data->exception_msym.minsym))
        continue;
 
-      gdbarch = get_objfile_arch (objfile);
+      gdbarch = objfile->arch ();
 
       if (bp_objfile_data->exception_msym.minsym == NULL)
        {
@@ -7116,9 +7116,9 @@ struct gdbarch *
 get_sal_arch (struct symtab_and_line sal)
 {
   if (sal.section)
-    return get_objfile_arch (sal.section->objfile);
+    return sal.section->objfile->arch ();
   if (sal.symtab)
-    return get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+    return SYMTAB_OBJFILE (sal.symtab)->arch ();
 
   return NULL;
 }
index c08c476a0d4a559b9a9091be8a7c8a7002866a36..b9bcc33080abece60428d1dc2feb426a6694fb05 100644 (file)
@@ -213,7 +213,7 @@ buildsym_compunit::finish_block_internal
      CORE_ADDR start, CORE_ADDR end,
      int is_global, int expandable)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (m_objfile);
+  struct gdbarch *gdbarch = m_objfile->arch ();
   struct pending *next, *next1;
   struct block *block;
   struct pending_block *pblock;
index f7178510878b2abb1894c15a1a2b745a89aa311a..1b677f5d7a197889ec8691ffec569827b5da7d5a 100644 (file)
@@ -925,7 +925,7 @@ edit_command (const char *arg, int from_tty)
            error (_("No source file for address %s."),
                   paddress (get_current_arch (), sal.pc));
 
-         gdbarch = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+         gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
           sym = find_pc_function (sal.pc);
           if (sym)
            printf_filtered ("%s is in %s (%s:%d).\n",
@@ -1257,7 +1257,7 @@ list_command (const char *arg, int from_tty)
        error (_("No source file for address %s."),
               paddress (get_current_arch (), sal.pc));
 
-      gdbarch = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+      gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
       sym = find_pc_function (sal.pc);
       if (sym)
        printf_filtered ("%s is in %s (%s:%d).\n",
index b682755bbba7d6d458122900da109255de098250..7fbdcc4f68fb6742634d328bfd5e73ef26a87cb3 100644 (file)
@@ -753,7 +753,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
                  long symtab_offset, unsigned int nsyms,
                  struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct context_stack *newobj = nullptr;
   struct coff_symbol coff_symbol;
   struct coff_symbol *cs = &coff_symbol;
@@ -1402,7 +1402,7 @@ static void
 enter_linenos (long file_offset, int first_line,
               int last_line, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   char *rawptr;
   struct internal_lineno lptr;
 
@@ -1834,7 +1834,7 @@ decode_base_type (struct coff_symbol *cs,
                  union internal_auxent *aux, 
                  struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct type *type;
 
   switch (c_type)
@@ -2062,7 +2062,7 @@ static struct type *
 coff_read_enum_type (int index, int length, int lastsym,
                     struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct symbol *sym;
   struct type *type;
   int nsyms = 0;
index 7784e9d35d60575d25c12275a88973b0048940dc..8cc7271c0750a0c6bfe020453f7086b0739d6e57 100644 (file)
@@ -330,7 +330,7 @@ ctf_init_float_type (struct objfile *objfile,
                     const char *name,
                     const char *name_hint)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const struct floatformat **format;
   struct type *type;
 
@@ -521,7 +521,7 @@ read_base_type (struct ctf_context *ccp, ctf_id_t tid)
   if (kind == CTF_K_INTEGER)
     {
       uint32_t issigned, ischar, isbool;
-      struct gdbarch *gdbarch = get_objfile_arch (of);
+      struct gdbarch *gdbarch = of->arch ();
 
       issigned = cet.cte_format & CTF_INT_SIGNED;
       ischar = cet.cte_format & CTF_INT_CHAR;
index ac81278e996c333d3efee93a630a42d145ac4c11..c0155593e3b4301021ac06d00cb540db6509c94e 100644 (file)
@@ -951,7 +951,7 @@ function_outside_compilation_unit_complaint (const char *arg1)
 static void
 read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct external_nlist *bufp = 0;     /* =0 avoids gcc -Wall glitch.  */
   struct internal_nlist nlist;
   CORE_ADDR text_addr;
@@ -1936,7 +1936,7 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
                 int textlow_not_set)
 {
   int i;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
 
   if (capping_symbol_offset != -1)
     LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
@@ -2338,7 +2338,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
                    const section_offsets &section_offsets,
                    struct objfile *objfile, enum language language)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct context_stack *newobj;
   struct context_stack cstk;
   /* This remembers the address of the start of a function.  It is
index daa5dcc1e98f1be661ad589157695686b31e0d64..c452ac9b476c5f84dfc2326d709075f25939da60 100644 (file)
@@ -520,7 +520,7 @@ dtrace_process_dof (asection *sect, struct objfile *objfile,
                    std::vector<std::unique_ptr<probe>> *probesp,
                    struct dtrace_dof_hdr *dof)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct dtrace_dof_sect *section;
   int i;
 
index 74488f9a8aa97b5ab05f2c0e639dd17428061537..f7276d48ce79dc339a0c915a593e163b67a70a26 100644 (file)
@@ -2147,7 +2147,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
   dwarf2_cie_table cie_table;
   dwarf2_fde_table fde_table;
 
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
 
   /* Build a minimal decoding of the DWARF2 compilation unit.  */
   std::unique_ptr<comp_unit> unit (new comp_unit (objfile));
index b6a13a0ca169616b5faa31454e313d32a9d7cc3e..fc42816b1e7c517ef93649a949fb74f000d53acb 100644 (file)
@@ -1493,7 +1493,7 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
   const bool dwarf5_is_dwarf64 = check_dwarf64_offsets (dwarf2_per_objfile);
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   const enum bfd_endian dwarf5_byte_order
-    = gdbarch_byte_order (get_objfile_arch (objfile));
+    = gdbarch_byte_order (objfile->arch ());
 
   /* The CU list is already sorted, so we don't need to do additional
      work here.  Also, the debug_types entries do not appear in
index 2ec4626b17cc7e5a57c4357ab67bf2ef1d1944e0..b9456bc9dfbb90e311fb81538829fe5559f3a0f1 100644 (file)
@@ -318,7 +318,7 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
                                 size_t *locexpr_length, CORE_ADDR pc)
 {
   struct objfile *objfile = baton->per_cu->objfile ();
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   unsigned int addr_size = baton->per_cu->addr_size ();
   int signed_addr_p = bfd_get_sign_extend_vma (objfile->obfd);
@@ -729,7 +729,7 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context
                                                        (CORE_ADDR) 0);
 
     scoped_restore save_arch = make_scoped_restore (&this->gdbarch);
-    this->gdbarch = get_objfile_arch (per_cu->objfile ());
+    this->gdbarch = per_cu->objfile ()->arch ();
     scoped_restore save_addr_size = make_scoped_restore (&this->addr_size);
     this->addr_size = per_cu->addr_size ();
     scoped_restore save_offset = make_scoped_restore (&this->offset);
@@ -1816,7 +1816,7 @@ rw_pieced_value (struct value *v, struct value *from)
              }
 
            struct objfile *objfile = c->per_cu->objfile ();
-           struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+           struct gdbarch *objfile_gdbarch = objfile->arch ();
            ULONGEST stack_value_size_bits
              = 8 * TYPE_LENGTH (value_type (p->v.value));
 
@@ -2192,7 +2192,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
 
   scoped_value_mark free_values;
 
-  ctx.gdbarch = get_objfile_arch (objfile);
+  ctx.gdbarch = objfile->arch ();
   ctx.addr_size = per_cu->addr_size ();
   ctx.ref_addr_size = per_cu->ref_addr_size ();
   ctx.offset = per_cu->text_offset ();
@@ -2315,7 +2315,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
            size_t n = TYPE_LENGTH (value_type (value));
            size_t len = TYPE_LENGTH (subobj_type);
            size_t max = TYPE_LENGTH (type);
-           struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+           struct gdbarch *objfile_gdbarch = objfile->arch ();
 
            if (subobj_byte_offset + len > max)
              invalid_synthetic_pointer ();
@@ -2409,7 +2409,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
 
   objfile = dlbaton->per_cu->objfile ();
 
-  ctx.gdbarch = get_objfile_arch (objfile);
+  ctx.gdbarch = objfile->arch ();
   ctx.addr_size = dlbaton->per_cu->addr_size ();
   ctx.ref_addr_size = dlbaton->per_cu->ref_addr_size ();
   ctx.offset = dlbaton->per_cu->text_offset ();
@@ -2740,7 +2740,7 @@ dwarf2_loc_desc_get_symbol_read_needs (const gdb_byte *data, size_t size,
 
   ctx.needs = SYMBOL_NEEDS_NONE;
   ctx.per_cu = per_cu;
-  ctx.gdbarch = get_objfile_arch (objfile);
+  ctx.gdbarch = objfile->arch ();
   ctx.addr_size = per_cu->addr_size ();
   ctx.ref_addr_size = per_cu->ref_addr_size ();
   ctx.offset = per_cu->text_offset ();
@@ -3638,7 +3638,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
                                 const gdb_byte *data, const gdb_byte *end,
                                 unsigned int addr_size)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   size_t leb128_size;
 
   if (data[0] >= DW_OP_reg0 && data[0] <= DW_OP_reg31)
@@ -4234,7 +4234,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
        {
          fprintf_filtered (stream, _("a complex DWARF expression:\n"));
          data = disassemble_dwarf_expression (stream,
-                                              get_objfile_arch (objfile),
+                                              objfile->arch (),
                                               addr_size, offset_size, data,
                                               data, end, 0,
                                               dwarf_always_disassemble,
@@ -4436,7 +4436,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
     = (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol);
   const gdb_byte *loc_ptr, *buf_end;
   struct objfile *objfile = dlbaton->per_cu->objfile ();
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   unsigned int addr_size = dlbaton->per_cu->addr_size ();
   int offset_size = dlbaton->per_cu->offset_size ();
index 9cc0e1b59ed50f152abe18da9ecd9f033bf00e59..41db511c85103c9dfb1bb98298029fa22da2e58b 100644 (file)
@@ -2567,7 +2567,7 @@ create_addrmap_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
                           struct mapped_index *index)
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const gdb_byte *iter, *end;
   struct addrmap *mutable_map;
   CORE_ADDR baseaddr;
@@ -2624,7 +2624,7 @@ create_addrmap_from_aranges (struct dwarf2_per_objfile *dwarf2_per_objfile,
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   bfd *abfd = objfile->obfd;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const CORE_ADDR baseaddr = objfile->text_section_offset ();
 
   auto_obstack temp_obstack;
@@ -4690,7 +4690,7 @@ dw2_find_pc_sect_compunit_symtab (struct objfile *objfile,
 
   if (warn_if_readin && data->v.quick->compunit_symtab)
     warning (_("(Internal error: pc %s in read in CU, but not in symtab.)"),
-            paddress (get_objfile_arch (objfile), pc));
+            paddress (objfile->arch (), pc));
 
   result
     = recursively_find_pc_sect_compunit_symtab (dw2_instantiate_symtab (data,
@@ -4820,7 +4820,7 @@ read_debug_names_from_section (struct objfile *objfile,
 
   section->read (objfile);
 
-  map.dwarf5_byte_order = gdbarch_byte_order (get_objfile_arch (objfile));
+  map.dwarf5_byte_order = gdbarch_byte_order (objfile->arch ());
 
   const gdb_byte *addr = section->buffer;
 
@@ -7253,7 +7253,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
 {
   struct dwarf2_cu *cu = reader->cu;
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct dwarf2_per_cu_data *per_cu = cu->per_cu;
   CORE_ADDR baseaddr;
   CORE_ADDR best_lowpc = 0, best_highpc = 0;
@@ -8167,7 +8167,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
   struct dwarf2_per_objfile *dwarf2_per_objfile
     = cu->per_cu->dwarf2_per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR addr = 0;
   const char *actual_name = NULL;
   CORE_ADDR baseaddr;
@@ -8410,7 +8410,7 @@ add_partial_subprogram (struct partial_die_info *pdi,
          if (set_addrmap)
            {
              struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-             struct gdbarch *gdbarch = get_objfile_arch (objfile);
+             struct gdbarch *gdbarch = objfile->arch ();
              CORE_ADDR baseaddr;
              CORE_ADDR this_highpc;
              CORE_ADDR this_lowpc;
@@ -9546,7 +9546,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu,
   struct dwarf2_cu *cu = per_cu->cu;
   struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR lowpc, highpc;
   struct compunit_symtab *cust;
   CORE_ADDR baseaddr;
@@ -10751,7 +10751,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
   struct dwarf2_per_objfile *dwarf2_per_objfile
     = cu->per_cu->dwarf2_per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR lowpc = ((CORE_ADDR) -1);
   CORE_ADDR highpc = ((CORE_ADDR) 0);
   struct attribute *attr;
@@ -12830,7 +12830,7 @@ static void
 read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct context_stack *newobj;
   CORE_ADDR lowpc;
   CORE_ADDR highpc;
@@ -13031,7 +13031,7 @@ static void
 read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR lowpc, highpc;
   struct die_info *child_die;
   CORE_ADDR baseaddr;
@@ -13102,7 +13102,7 @@ static void
 read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR pc, baseaddr;
   struct attribute *attr;
   struct call_site *call_site, call_site_local;
@@ -13747,7 +13747,7 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
                    dwarf2_psymtab *ranges_pst)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const CORE_ADDR baseaddr = objfile->text_section_offset ();
   int low_set = 0;
   CORE_ADDR low = 0;
@@ -13991,7 +13991,7 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
                             CORE_ADDR baseaddr, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct attribute *attr;
   struct attribute *attr_high;
 
@@ -14179,7 +14179,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
                  struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct nextfield *new_field;
   struct attribute *attr;
   struct field *fp;
@@ -15945,7 +15945,7 @@ mark_common_block_symbol_computed (struct symbol *sym,
   struct dwarf2_locexpr_baton *baton;
   gdb_byte *ptr;
   unsigned int cu_off;
-  enum bfd_endian byte_order = gdbarch_byte_order (get_objfile_arch (objfile));
+  enum bfd_endian byte_order = gdbarch_byte_order (objfile->arch ());
   LONGEST offset = 0;
 
   gdb_assert (common_loc && member_loc);
@@ -16253,7 +16253,7 @@ static struct type *
 read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct gdbarch *gdbarch
-    = get_objfile_arch (cu->per_cu->dwarf2_per_objfile->objfile);
+    = cu->per_cu->dwarf2_per_objfile->objfile->arch ();
   struct comp_unit_head *cu_header = &cu->header;
   struct type *type;
   struct attribute *attr_byte_size;
@@ -16512,7 +16512,7 @@ static struct type *
 read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct type *type, *range_type, *index_type, *char_type;
   struct attribute *attr;
   struct dynamic_prop prop;
@@ -16830,7 +16830,7 @@ static struct type *
 dwarf2_init_float_type (struct objfile *objfile, int bits, const char *name,
                        const char *name_hint, enum bfd_endian byte_order)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const struct floatformat **format;
   struct type *type;
 
@@ -16878,7 +16878,7 @@ dwarf2_init_complex_target_type (struct dwarf2_cu *cu,
                                 int bits, const char *name_hint,
                                 enum bfd_endian byte_order)
 {
-  gdbarch *gdbarch = get_objfile_arch (objfile);
+  gdbarch *gdbarch = objfile->arch ();
   struct type *tt = nullptr;
 
   /* Try to find a suitable floating point builtin type of size BITS.
@@ -16951,7 +16951,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
   if (!name)
     complaint (_("DW_AT_name missing from DW_TAG_base_type"));
 
-  arch = get_objfile_arch (objfile);
+  arch = objfile->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (arch);
 
   attr = dwarf2_attr (die, DW_AT_endianity, cu);
@@ -18173,7 +18173,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
       if (lowpc == 0 && !dwarf2_per_objfile->has_section_at_zero)
        {
          struct objfile *objfile = dwarf2_per_objfile->objfile;
-         struct gdbarch *gdbarch = get_objfile_arch (objfile);
+         struct gdbarch *gdbarch = objfile->arch ();
 
          complaint (_("DW_AT_low_pc %s is zero "
                       "for DIE at %s [in module %s]"),
@@ -18185,7 +18185,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
       else if (lowpc >= highpc)
        {
          struct objfile *objfile = dwarf2_per_objfile->objfile;
-         struct gdbarch *gdbarch = get_objfile_arch (objfile);
+         struct gdbarch *gdbarch = objfile->arch ();
 
          complaint (_("DW_AT_low_pc %s is not < DW_AT_high_pc %s "
                       "for DIE at %s [in module %s]"),
@@ -18589,7 +18589,6 @@ read_attribute_value (const struct die_reader_specs *reader,
   struct dwarf2_per_objfile *dwarf2_per_objfile
     = cu->per_cu->dwarf2_per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
   bfd *abfd = reader->abfd;
   struct comp_unit_head *cu_header = &cu->header;
   unsigned int bytes_read;
@@ -18613,9 +18612,12 @@ read_attribute_value (const struct die_reader_specs *reader,
       info_ptr += bytes_read;
       break;
     case DW_FORM_addr:
-      DW_ADDR (attr) = cu->header.read_address (abfd, info_ptr, &bytes_read);
-      DW_ADDR (attr) = gdbarch_adjust_dwarf2_addr (gdbarch, DW_ADDR (attr));
-      info_ptr += bytes_read;
+      {
+       struct gdbarch *gdbarch = objfile->arch ();
+       DW_ADDR (attr) = cu->header.read_address (abfd, info_ptr, &bytes_read);
+       DW_ADDR (attr) = gdbarch_adjust_dwarf2_addr (gdbarch, DW_ADDR (attr));
+       info_ptr += bytes_read;
+      }
       break;
     case DW_FORM_block2:
       blk = dwarf_alloc_block (cu);
@@ -19827,7 +19829,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
   CORE_ADDR baseaddr;
   struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
   bfd *abfd = objfile->obfd;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   /* True if we're recording line info (as opposed to building partial
      symtabs and just interested in finding include files mentioned by
      the line number program).  */
@@ -20251,7 +20253,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
   struct dwarf2_per_objfile *dwarf2_per_objfile
     = cu->per_cu->dwarf2_per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct symbol *sym = NULL;
   const char *name;
   struct attribute *attr = NULL;
@@ -21898,7 +21900,7 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
     {
       CORE_ADDR pc = (*get_frame_pc) (baton);
       CORE_ADDR baseaddr = objfile->text_section_offset ();
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
 
       for (const auto &cand_off
             : dwarf2_per_objfile->abstract_to_concrete[die->sect_off])
index 42c4e77785f36f5c6aa1ec118dc1e45298a30da5..2f2fef93996acd817acc9038b68a931fcca7f5bb 100644 (file)
@@ -206,7 +206,7 @@ record_minimal_symbol (minimal_symbol_reader &reader,
                       enum minimal_symbol_type ms_type,
                       asection *bfd_section, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
 
   if (ms_type == mst_text || ms_type == mst_file_text
       || ms_type == mst_text_gnu_ifunc)
@@ -251,7 +251,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
                 long number_of_symbols, asymbol **symbol_table,
                 bool copy_names)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   asymbol *sym;
   long i;
   CORE_ADDR symaddr;
@@ -559,7 +559,7 @@ elf_rel_plt_read (minimal_symbol_reader &reader,
   const struct elf_backend_data *bed = get_elf_backend_data (obfd);
   asection *relplt, *got_plt;
   bfd_size_type reloc_count, reloc;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
   size_t ptr_size = TYPE_LENGTH (ptr_type);
 
@@ -747,7 +747,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
     {
       struct elf_gnu_ifunc_cache *entry_found_p
        = (struct elf_gnu_ifunc_cache *) *slot;
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
 
       if (entry_found_p->addr != addr)
        {
@@ -825,7 +825,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
   for (objfile *objfile : current_program_space->objfiles ())
     {
       bfd *obfd = objfile->obfd;
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
       struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
       size_t ptr_size = TYPE_LENGTH (ptr_type);
       CORE_ADDR pointer_address, addr;
index d12011e9021d045efe81ec5c90f4d2cab3ecbce8..7b653fb74e37e7417b66696d958a710382d992f6 100644 (file)
@@ -282,7 +282,7 @@ call_target_sbrk (int sbrk_arg)
   else
     return (bfd_vma) 0;
 
-  gdbarch = get_objfile_arch (sbrk_objf);
+  gdbarch = sbrk_objf->arch ();
   target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int, 
                                        sbrk_arg);
   gdb_assert (target_sbrk_arg);
index f23def1ff71cca58e41326de7fa7e10c408c90e5..157b3c5e614cfa0ba3ff0b40f74ff36c597c4278 100644 (file)
@@ -236,7 +236,7 @@ get_type_arch (const struct type *type)
   struct gdbarch *arch;
 
   if (TYPE_OBJFILE_OWNED (type))
-    arch = get_objfile_arch (TYPE_OWNER (type).objfile);
+    arch = TYPE_OWNER (type).objfile->arch ();
   else
     arch = TYPE_OWNER (type).gdbarch;
 
@@ -3000,7 +3000,7 @@ init_float_type (struct objfile *objfile,
 {
   if (byte_order == BFD_ENDIAN_UNKNOWN)
     {
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
       byte_order = gdbarch_byte_order (gdbarch);
     }
   const struct floatformat *fmt = floatformats[byte_order];
@@ -5607,7 +5607,7 @@ objfile_type (struct objfile *objfile)
                                 1, struct objfile_type);
 
   /* Use the objfile architecture to determine basic type properties.  */
-  gdbarch = get_objfile_arch (objfile);
+  gdbarch = objfile->arch ();
 
   /* Basic types.  */
   objfile_type->builtin_void
index 3730a73af2a0cab5e67b9ee2e3d9c929d98a6e44..88abe90c5a898fe68256fa2714a0fd13c5e5d8f7 100644 (file)
@@ -258,7 +258,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
 
   if (size > 0)
     {
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
       unsigned long tmp;
       unsigned i;
       char *buf = (char *) alloca (size);
index db02882bbe367c13cab27d7fc8957696a7fd9bef..5fa0fad2888a5321658966529aa7002372fd9a91 100644 (file)
@@ -2764,7 +2764,7 @@ ia64_find_unwind_table (struct objfile *objfile, unw_word_t ip,
 
   dip->start_ip = p_text->p_vaddr + load_base;
   dip->end_ip = dip->start_ip + p_text->p_memsz;
-  dip->gp = ia64_find_global_pointer (get_objfile_arch (objfile), ip);
+  dip->gp = ia64_find_global_pointer (objfile->arch (), ip);
   dip->format = UNW_INFO_FORMAT_REMOTE_TABLE;
   dip->u.rti.name_ptr = (unw_word_t) bfd_get_filename (bfd);
   dip->u.rti.segbase = segbase;
index 0f00b93f26982785e50ba964c24c0fd964e6b604..5d60e64230b5efe9e789cd888c23d5c5695b47ae 100644 (file)
@@ -7819,7 +7819,7 @@ insert_exception_resume_from_probe (struct thread_info *tp,
   if (debug_infrun)
     fprintf_unfiltered (gdb_stdlog,
                        "infrun: exception resume at %s\n",
-                       paddress (get_objfile_arch (probe->objfile),
+                       paddress (probe->objfile->arch (),
                                  handler));
 
   bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
index 8eb98f4a38af77df9b059394869a05a2c5350580..07e9ce7ae245539ab3cc08601abc34ba380bb700 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -656,7 +656,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
     {
       struct block *new_block = allocate_block (&objfile->objfile_obstack);
       struct symbol *block_name = allocate_symbol (objfile);
-      struct type *block_type = arch_type (get_objfile_arch (objfile),
+      struct type *block_type = arch_type (objfile->arch (),
                                           TYPE_CODE_VOID,
                                           TARGET_CHAR_BIT,
                                           "void");
index e1349e78a0d8d6bbd6225e614d9a641011717974..0eb3bc5b8d4fe4119e3debee22c6b70bd2ace83e 100644 (file)
@@ -2291,7 +2291,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
                          if (MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
                            {
                              struct gdbarch *gdbarch
-                               = get_objfile_arch (elem.objfile);
+                               = elem.objfile->arch ();
                              msym_addr
                                = (gdbarch_convert_from_func_ptr_addr
                                   (gdbarch,
index 357188685d071f41642abc4e82cda0f12b717187..2233d4429ce0a0fd4effd912ed5d7aa1f7e60285 100644 (file)
@@ -663,7 +663,7 @@ checkpoint_command (const char *args, int from_tty)
   if (!fork_fn)
     error (_("checkpoint: can't find fork function in inferior."));
 
-  gdbarch = get_objfile_arch (fork_objf);
+  gdbarch = fork_objf->arch ();
   ret = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
 
   /* Tell linux-nat.c that we're checkpointing this inferior.  */
index e50946ce379af94793436572889631484c537e93..ed84d6ace6b61b518dde3d9b02bfd2202056b783 100644 (file)
@@ -2326,7 +2326,7 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot)
      "mmap" uses 64-bit off_t on x86_64 and 32-bit off_t on i386 and x32.  */
   struct value *mmap_val = find_function_in_inferior ("mmap64", &objf);
   struct value *addr_val;
-  struct gdbarch *gdbarch = get_objfile_arch (objf);
+  struct gdbarch *gdbarch = objf->arch ();
   CORE_ADDR retval;
   enum
     {
@@ -2365,7 +2365,7 @@ linux_infcall_munmap (CORE_ADDR addr, CORE_ADDR size)
   struct objfile *objf;
   struct value *munmap_val = find_function_in_inferior ("munmap", &objf);
   struct value *retval_val;
-  struct gdbarch *gdbarch = get_objfile_arch (objf);
+  struct gdbarch *gdbarch = objf->arch ();
   LONGEST retval;
   enum
     {
index 9881298021dfe53d23ce6b3cfbf4f89e7798a58a..4655b67f118c770c69565b3c8f10bd10f1ca37d2 100644 (file)
@@ -493,7 +493,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
             {
               if (mach_o_debug_level > 4)
                 {
-                  struct gdbarch *arch = get_objfile_arch (main_objfile);
+                  struct gdbarch *arch = main_objfile->arch ();
                   printf_unfiltered
                     (_("Adding symbol %s (addr: %s)\n"),
                      sym->name, paddress (arch, sym->value));
@@ -567,7 +567,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
 
                   if (mach_o_debug_level > 3)
                     {
-                      struct gdbarch *arch = get_objfile_arch (main_objfile);
+                      struct gdbarch *arch = main_objfile->arch ();
                       printf_unfiltered
                         (_("resolve sect %s with %s (set to %s)\n"),
                          sec->name, sym->name,
index 5dfd80de1923b53e37000074f24b9b337f45da3a..5c4158cd6fbfabe1d1546d6ba05b7c69b5be6e54 100644 (file)
@@ -573,7 +573,7 @@ static int
 parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
              const section_offsets &section_offsets, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
   void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
   const char *name;
@@ -1357,7 +1357,7 @@ static const struct objfile_key<struct type *,
 static struct type *
 basic_type (int bt, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct type **map_bt = basic_type_data.get (objfile);
   struct type *tp;
 
@@ -2283,7 +2283,7 @@ static void
 parse_partial_symbols (minimal_symbol_reader &reader,
                       struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
   const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
   const bfd_size_type external_ext_size = debug_swap->external_ext_size;
@@ -3899,7 +3899,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 
   if (processing_gcc_compilation != 0)
     {
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
 
       /* This symbol table contains stabs-in-ecoff entries.  */
 
index a5ce2d179d89607d4fdc64a8d2b31f8da173f9a8..d48d0effe271ffa99c8fdf01d0fc40b36ec624e8 100644 (file)
@@ -50,7 +50,7 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc)
      already sorted by increasing values in the symbol table, so no
      need to perform any other sorting.  */
 
-  gdbarch = get_objfile_arch (SYMTAB_OBJFILE (s));
+  gdbarch = SYMTAB_OBJFILE (s)->arch ();
 
   ui_out_emit_list list_emitter (uiout, "lines");
   if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
@@ -96,7 +96,7 @@ static void
 output_nondebug_symbol (ui_out *uiout,
                        const struct bound_minimal_symbol &msymbol)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (msymbol.objfile);
+  struct gdbarch *gdbarch = msymbol.objfile->arch ();
   ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
   uiout->field_core_addr ("address", gdbarch,
index d2ac8172eea4f2426e8c20229a6aa77d201ae876..2c1262b0dd6c26a20f2ed9a5e7328db79b1cd0ad 100644 (file)
@@ -77,7 +77,7 @@ msymbol_is_function (struct objfile *objfile, minimal_symbol *minsym,
     case mst_file_bss:
     case mst_data_gnu_ifunc:
       {
-       struct gdbarch *gdbarch = get_objfile_arch (objfile);
+       struct gdbarch *gdbarch = objfile->arch ();
        CORE_ADDR pc
          = gdbarch_convert_from_func_ptr_addr (gdbarch, msym_addr,
                                                current_top_target ());
index 3138049e6223b3b45e6700d63c69c621e5d34ba4..d329a953c17cac6b1ef5c77bf8d59e686000e2c4 100644 (file)
@@ -374,14 +374,6 @@ objfile::objfile (bfd *abfd, const char *name, objfile_flags flags_)
   per_bfd = get_objfile_bfd_data (this, abfd);
 }
 
-/* Retrieve the gdbarch associated with OBJFILE.  */
-
-struct gdbarch *
-get_objfile_arch (const struct objfile *objfile)
-{
-  return objfile->per_bfd->gdbarch;
-}
-
 /* If there is a valid and known entry point, function fills *ENTRY_P with it
    and returns non-zero; otherwise it returns zero.  */
 
@@ -1132,7 +1124,7 @@ filter_overlapping_sections (struct obj_section **map, int map_size)
 
              const CORE_ADDR sect2_endaddr = obj_section_endaddr (sect2);
 
-             struct gdbarch *const gdbarch = get_objfile_arch (objf1);
+             struct gdbarch *const gdbarch = objf1->arch ();
 
              complaint (_("unexpected overlap between:\n"
                           " (A) section `%s' from `%s' [%s, %s)\n"
index a568fa4bcdac82cdaf7415755b7ecbca6a3bcbf1..77f94e4f21d14a8fb1e8b1ff883e49a9ce01e9ce 100644 (file)
@@ -544,6 +544,12 @@ public:
                                                        str.size () + 1);
   }
 
+  /* Retrieve the gdbarch associated with this objfile.  */
+  struct gdbarch *arch () const
+  {
+    return per_bfd->gdbarch;
+  }
+
 
   /* The object file's original name as specified by the user,
      made absolute, and tilde-expanded.  However, it is not canonicalized
@@ -709,8 +715,6 @@ typedef std::unique_ptr<objfile, objfile_deleter> objfile_up;
 
 /* Declarations for functions defined in objfiles.c */
 
-extern struct gdbarch *get_objfile_arch (const struct objfile *);
-
 extern int entry_point_address_query (CORE_ADDR *entry_p);
 
 extern CORE_ADDR entry_point_address (void);
index 645ac4da9a4785025738adc5d1ea6d2d9d3f2b8b..de6d3d43bb4983ebdf02ae580461bba865650f06 100644 (file)
@@ -1442,7 +1442,7 @@ info_address_command (const char *exp, int from_tty)
        {
          struct objfile *objfile = msymbol.objfile;
 
-         gdbarch = get_objfile_arch (objfile);
+         gdbarch = objfile->arch ();
          load_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
 
          printf_filtered ("Symbol \"");
index d952f453d99184ffbc9d053eac44919892e9c48a..b156aa0e228da6970f5dedb42cc130d14339fc3c 100644 (file)
@@ -392,7 +392,7 @@ psym_find_pc_sect_compunit_symtab (struct objfile *objfile,
           continue, so let's not.  */
        warning (_("\
 (Internal error: pc %s in read in psymtab, but not in symtab.)\n"),
-                paddress (get_objfile_arch (objfile), pc));
+                paddress (objfile->arch (), pc));
       psymtab_to_symtab (objfile, ps);
       return ps->get_compunit_symtab ();
     }
@@ -927,7 +927,7 @@ static void
 dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
              struct ui_file *outfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   int i;
 
   if (psymtab->anonymous)
@@ -1779,7 +1779,7 @@ dump_psymtab_addrmap_1 (void *datap, CORE_ADDR start_addr, void *obj)
 {
   struct dump_psymtab_addrmap_data *data
     = (struct dump_psymtab_addrmap_data *) datap;
-  struct gdbarch *gdbarch = get_objfile_arch (data->objfile);
+  struct gdbarch *gdbarch = data->objfile->arch ();
   struct partial_symtab *addrmap_psymtab = (struct partial_symtab *) obj;
   const char *psymtab_address_or_end = NULL;
 
@@ -1999,7 +1999,7 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
   ALL_PSPACES (pspace)
     for (objfile *objfile : pspace->objfiles ())
       {
-       struct gdbarch *gdbarch = get_objfile_arch (objfile);
+       struct gdbarch *gdbarch = objfile->arch ();
 
        /* We don't want to print anything for this objfile until we
           actually find a symtab whose name matches.  */
@@ -2118,7 +2118,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
   for (objfile *objfile : current_program_space->objfiles ())
     for (partial_symtab *ps : require_partial_symbols (objfile, true))
       {
-       struct gdbarch *gdbarch = get_objfile_arch (objfile);
+       struct gdbarch *gdbarch = objfile->arch ();
 
        /* We don't call psymtab_to_symtab here because that may cause symtab
           expansion.  When debugging a problem it helps if checkers leave
index fd7d8a8aa7094b549859dec370520b2cb9a8c616..b9268c11d4385b6eeef25aa0e92222c796ed30eb 100644 (file)
@@ -193,7 +193,7 @@ python_new_objfile (struct objfile *objfile)
     return;
 
   gdbpy_enter enter_py (objfile != NULL
-                       ? get_objfile_arch (objfile)
+                       ? objfile->arch ()
                        : target_gdbarch (),
                        current_language);
 
index 942349d6e6638cf0fa5e2bbf610d7b8ea93a18da..205da8b649fa3fc2874d004c057d58b44c8063b5 100644 (file)
@@ -661,7 +661,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 static void
 py_free_objfile (struct objfile *objfile, void *datum)
 {
-  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (objfile->arch (), current_language);
   gdbpy_ref<objfile_object> object ((objfile_object *) datum);
   object->objfile = NULL;
 }
index b19cad098a46410262080cd2b1aaa8f8f1729ea6..61720491c7ab7cbda20084b0f323290a22942797 100644 (file)
@@ -1049,7 +1049,7 @@ save_objfile_types (struct objfile *objfile, void *datum)
 
   /* This prevents another thread from freeing the objects we're
      operating on.  */
-  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (objfile->arch (), current_language);
 
   copied_types = create_copied_types_hash (objfile);
 
index d252646c02cfd4bde41582a7695402a8c7b49f5b..d65cca403bec4755baf51507211a0331c19c8e7f 100644 (file)
@@ -1389,7 +1389,7 @@ gdbpy_source_objfile_script (const struct extension_language_defn *extlang,
   if (!gdb_python_initialized)
     return;
 
-  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (objfile->arch (), current_language);
   gdbpy_current_objfile = objfile;
 
   python_run_simple_file (file, filename);
@@ -1411,7 +1411,7 @@ gdbpy_execute_objfile_script (const struct extension_language_defn *extlang,
   if (!gdb_python_initialized)
     return;
 
-  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (objfile->arch (), current_language);
   gdbpy_current_objfile = objfile;
 
   PyRun_SimpleString (script);
index 50de93952bb04a2568830b9224129786b6312695..7d22bbb5db34524ab4dbb599650b592855ef3c21 100644 (file)
@@ -1499,8 +1499,7 @@ info_line_command (const char *arg, int from_tty)
       else if (sal.line > 0
               && find_line_pc_range (sal, &start_pc, &end_pc))
        {
-         struct gdbarch *gdbarch
-           = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+         struct gdbarch *gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
 
          if (start_pc == end_pc)
            {
index 068ece2ff5345e473a2ad7e3e1f561d4b2e7abc9..5ef7748a9ebfc59bd9345e6001386d10ef1712ee 100644 (file)
@@ -369,7 +369,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
 static struct type *
 dbx_init_float_type (struct objfile *objfile, int bits)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const struct floatformat **format;
   struct type *type;
 
@@ -649,7 +649,7 @@ struct symbol *
 define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
               struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct symbol *sym;
   const char *p = find_name_end (string);
   int deftype;
@@ -2823,7 +2823,7 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp,
                       const char *p, struct type *type,
                       struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
 
   fip->list->field.name
     = obstack_strndup (&objfile->objfile_obstack, *pp, p - *pp);
@@ -3581,7 +3581,7 @@ static struct type *
 read_enum_type (const char **pp, struct type *type,
                struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const char *p;
   char *name;
   long n;
@@ -3997,7 +3997,7 @@ static struct type *
 read_range_type (const char **pp, int typenums[2], int type_size,
                  struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   const char *orig_pp = *pp;
   int rangenums[2];
   long n2, n3;
index 1a5ba5a1b3e090575ff1d45ea94dbe19e9728b2e..4b1a75f8166ea4e11772442033ac42f8294b99e5 100644 (file)
@@ -1517,7 +1517,7 @@ handle_stap_probe (struct objfile *objfile, struct sdt_note *el,
 {
   bfd *abfd = objfile->obfd;
   int size = bfd_get_arch_size (abfd) / 8;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
 
   /* Provider and the name of the probe.  */
index 407534445253b3467a6141855e5e44adc2a20372..7c862d5513a276365614751d3decd030ccabe04d 100644 (file)
@@ -852,14 +852,14 @@ init_entry_point_info (struct objfile *objfile)
       /* Make certain that the address points at real code, and not a
         function descriptor.  */
       entry_point
-       = gdbarch_convert_from_func_ptr_addr (get_objfile_arch (objfile),
+       = gdbarch_convert_from_func_ptr_addr (objfile->arch (),
                                              entry_point,
                                              current_top_target ());
 
       /* Remove any ISA markers, so that this matches entries in the
         symbol table.  */
       ei->entry_point
-       = gdbarch_addr_bits_remove (get_objfile_arch (objfile), entry_point);
+       = gdbarch_addr_bits_remove (objfile->arch (), entry_point);
 
       found = 0;
       ALL_OBJFILE_OSECTIONS (objfile, osect)
@@ -2998,7 +2998,7 @@ section_is_mapped (struct obj_section *osect)
     case ovly_auto:            /* overlay debugging automatic */
       /* Unles there is a gdbarch_overlay_update function,
          there's really nothing useful to do here (can't really go auto).  */
-      gdbarch = get_objfile_arch (osect->objfile);
+      gdbarch = osect->objfile->arch ();
       if (gdbarch_overlay_update_p (gdbarch))
        {
          if (overlay_cache_invalid)
@@ -3197,7 +3197,7 @@ list_overlays_command (const char *args, int from_tty)
        ALL_OBJFILE_OSECTIONS (objfile, osect)
          if (section_is_mapped (osect))
            {
-             struct gdbarch *gdbarch = get_objfile_arch (objfile);
+             struct gdbarch *gdbarch = objfile->arch ();
              const char *name;
              bfd_vma lma, vma;
              int size;
@@ -3453,7 +3453,7 @@ simple_read_overlay_table (void)
       return 0;
     }
 
-  gdbarch = get_objfile_arch (ovly_table_msym.objfile);
+  gdbarch = ovly_table_msym.objfile->arch ();
   word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   byte_order = gdbarch_byte_order (gdbarch);
 
@@ -3482,7 +3482,7 @@ simple_overlay_update_1 (struct obj_section *osect)
 {
   int i;
   asection *bsect = osect->the_bfd_section;
-  struct gdbarch *gdbarch = get_objfile_arch (osect->objfile);
+  struct gdbarch *gdbarch = osect->objfile->arch ();
   int word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
index 1076a0bcaf837f5a263a9788c33d74f9a0ed9f65..f45364a8832f4251b37df9483cf9ac8cce47d995 100644 (file)
@@ -179,7 +179,7 @@ dump_objfile (struct objfile *objfile)
 static void
 dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   int index;
   char ms_type;
 
@@ -269,7 +269,7 @@ static void
 dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
 {
   struct objfile *objfile = SYMTAB_OBJFILE (symtab);
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   int i;
   struct mdict_iterator miter;
   int len;
@@ -1050,7 +1050,7 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
            uiout->field_signed ("line", item->line);
          else
            uiout->field_string ("line", _("END"));
-         uiout->field_core_addr ("address", get_objfile_arch (objfile),
+         uiout->field_core_addr ("address", objfile->arch (),
                                  item->pc);
          uiout->field_string ("is-stmt", item->is_stmt ? "Y" : "");
          uiout->text ("\n");
index 6354a8b0d20be06b711d247af064e01910d9d2bd..dc079efbc2717f858d486bea13e6e7fd05c7f784 100644 (file)
@@ -2666,7 +2666,7 @@ lookup_global_or_static_symbol (const char *name,
       lookup_data.block_index = block_index;
       lookup_data.domain = domain;
       gdbarch_iterate_over_objfiles_in_search_order
-       (objfile != NULL ? get_objfile_arch (objfile) : target_gdbarch (),
+       (objfile != NULL ? objfile->arch () : target_gdbarch (),
         lookup_symbol_global_or_static_iterator_cb, &lookup_data, objfile);
       result = lookup_data.result;
     }
@@ -3647,7 +3647,7 @@ find_function_start_sal_1 (CORE_ADDR func_addr, obj_section *section,
       && (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab))
          || SYMTAB_LANGUAGE (sal.symtab) == language_asm))
     {
-      struct gdbarch *gdbarch = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+      struct gdbarch *gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
 
       sal.pc = func_addr;
       if (gdbarch_skip_entrypoint_p (gdbarch))
@@ -3806,7 +3806,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
       name = msymbol.minsym->linkage_name ();
     }
 
-  gdbarch = get_objfile_arch (objfile);
+  gdbarch = objfile->arch ();
 
   /* Process the prologue in two passes.  In the first pass try to skip the
      prologue (SKIP is true) and verify there is a real need for it (indicated
@@ -4928,7 +4928,7 @@ print_symbol_info (enum search_domain kind,
 static void
 print_msymbol_info (struct bound_minimal_symbol msymbol)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (msymbol.objfile);
+  struct gdbarch *gdbarch = msymbol.objfile->arch ();
   char *tmp;
 
   if (gdbarch_addr_bit (gdbarch) <= 32)
@@ -5550,7 +5550,7 @@ find_gnu_ifunc (const symbol *sym)
          CORE_ADDR msym_addr = MSYMBOL_VALUE_ADDRESS (objfile, minsym);
          if (MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
            {
-             struct gdbarch *gdbarch = get_objfile_arch (objfile);
+             struct gdbarch *gdbarch = objfile->arch ();
              msym_addr
                = gdbarch_convert_from_func_ptr_addr (gdbarch,
                                                      msym_addr,
@@ -6405,7 +6405,7 @@ symbol_arch (const struct symbol *symbol)
 {
   if (!SYMBOL_OBJFILE_OWNED (symbol))
     return symbol->owner.arch;
-  return get_objfile_arch (SYMTAB_OBJFILE (symbol->owner.symtab));
+  return SYMTAB_OBJFILE (symbol->owner.symtab)->arch ();
 }
 
 /* See symtab.h.  */
index 7bc1220a87624e41d2a8ba1815935660ddeaaf9a..fd5bd7dd9608617889f55218948f7896913e248c 100644 (file)
@@ -74,7 +74,7 @@ tui_source_window::set_contents (struct gdbarch *arch,
   m_fullname = make_unique_xstrdup (symtab_to_fullname (s));
 
   cur_line = 0;
-  m_gdbarch = get_objfile_arch (SYMTAB_OBJFILE (s));
+  m_gdbarch = SYMTAB_OBJFILE (s)->arch ();
   m_start_line_or_addr.loa = LOA_LINE;
   cur_line_no = m_start_line_or_addr.u.line_no = line_no;
 
index b5ba59e2f7a4d475b19a648eb87f07c73f927ef4..db0add996883d416c8e733a492e0bfbe706d2d2d 100644 (file)
@@ -216,7 +216,7 @@ tui_update_source_windows_with_line (struct symtab_and_line sal)
   if (sal.symtab != nullptr)
     {
       find_line_pc (sal.symtab, sal.line, &sal.pc);
-      gdbarch = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
+      gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
     }
 
   for (struct tui_source_window_base *win_info : tui_source_windows ())
index 03c6482ee1e9136a54b8a6327f67bd51ee941032..04cf22cced138975ed58c56fd3ef58bd27ddae80 100644 (file)
@@ -139,7 +139,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
       if (msymbol.minsym != NULL)
        {
          struct objfile *objfile = msymbol.objfile;
-         struct gdbarch *gdbarch = get_objfile_arch (objfile);
+         struct gdbarch *gdbarch = objfile->arch ();
 
          struct type *type;
          CORE_ADDR maddr;
@@ -175,7 +175,7 @@ value_allocate_space_in_inferior (int len)
 {
   struct objfile *objf;
   struct value *val = find_function_in_inferior ("malloc", &objf);
-  struct gdbarch *gdbarch = get_objfile_arch (objf);
+  struct gdbarch *gdbarch = objf->arch ();
   struct value *blocklen;
 
   blocklen = value_from_longest (builtin_type (gdbarch)->builtin_int, len);
index f722c272d8b0a8dc6ea27d6ead7e5bf12dc999a2..6e2a9ba4fccc3350604825640dfa7f76adbd69e6 100644 (file)
@@ -3068,7 +3068,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
       /* The minimal symbol might point to a function descriptor;
         resolve it to the actual code address instead.  */
       struct objfile *objfile = msym.objfile;
-      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+      struct gdbarch *gdbarch = objfile->arch ();
 
       set_value_address (v,
        gdbarch_convert_from_func_ptr_addr
index 6c1181388070bfc15652a6022042a1653dd08f37..2c19dc8c8226c0075b4b963b5042efec0b20ed13 100644 (file)
@@ -829,7 +829,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset,
                  CORE_ADDR endaddr, unsigned *firstLine)
 {
   struct objfile *objfile = this_symtab_objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   unsigned int curoffset;
   CORE_ADDR addr;
   void *ext_lnno;
@@ -2121,7 +2121,7 @@ static void
 scan_xcoff_symtab (minimal_symbol_reader &reader,
                   struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR toc_offset = 0;    /* toc offset value in data section.  */
   const char *filestring = NULL;