From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 473523858D1E; Wed, 20 Apr 2022 16:28:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 473523858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Replace symbol_arch with symbol::arch X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: e19b2d94653dd4a7523a9e9b62020a63dac39439 X-Git-Newrev: bcd6845e2b66adb58d36eb1d9b8fbf71900b517d Message-Id: <20220420162821.473523858D1E@sourceware.org> Date: Wed, 20 Apr 2022 16:28:21 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 16:28:21 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbcd6845e2b66= adb58d36eb1d9b8fbf71900b517d commit bcd6845e2b66adb58d36eb1d9b8fbf71900b517d Author: Tom Tromey Date: Sun Apr 17 19:47:22 2022 -0600 Replace symbol_arch with symbol::arch =20 This turns symbol_arch into a method on symbol. Diff: --- gdb/block.c | 2 +- gdb/findvar.c | 2 +- gdb/guile/scm-symbol.c | 2 +- gdb/printcmd.c | 2 +- gdb/symtab.c | 8 ++++---- gdb/symtab.h | 8 ++++---- gdb/tracepoint.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gdb/block.c b/gdb/block.c index 530d2339cc6..bab6868bbbb 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -60,7 +60,7 @@ struct gdbarch * block_gdbarch (const struct block *block) { if (BLOCK_FUNCTION (block) !=3D NULL) - return symbol_arch (BLOCK_FUNCTION (block)); + return BLOCK_FUNCTION (block)->arch (); =20 return block_objfile (block)->arch (); } diff --git a/gdb/findvar.c b/gdb/findvar.c index 4f109f560b9..067fb3f6757 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -753,7 +753,7 @@ language_defn::read_var_value (struct symbol *var, lookup_data.name =3D var->linkage_name (); =20 gdbarch_iterate_over_objfiles_in_search_order - (symbol_arch (var), + (var->arch (), minsym_lookup_iterator_cb, &lookup_data, var->objfile ()); msym =3D lookup_data.result.minsym; diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index 48ea28fb243..9e89b0458af 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -115,7 +115,7 @@ syscm_get_symbol_map (struct symbol *symbol) } else { - struct gdbarch *gdbarch =3D symbol_arch (symbol); + struct gdbarch *gdbarch =3D symbol->arch (); struct syscm_gdbarch_data *data =3D (struct syscm_gdbarch_data *) gdbarch_data (gdbarch, syscm_gdbarch_data_key); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 0e139e09c41..102058a8579 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1684,7 +1684,7 @@ info_address_command (const char *exp, int from_tty) section =3D sym->obj_section (sym->objfile ()); else section =3D NULL; - gdbarch =3D symbol_arch (sym); + gdbarch =3D sym->arch (); =20 if (SYMBOL_COMPUTED_OPS (sym) !=3D NULL) { diff --git a/gdb/symtab.c b/gdb/symtab.c index 7188169f660..d5d3877d90e 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -6602,11 +6602,11 @@ symbol::objfile () const /* See symtab.h. */ =20 struct gdbarch * -symbol_arch (const struct symbol *symbol) +symbol::arch () const { - if (!symbol->is_objfile_owned ()) - return symbol->owner.arch; - return symbol->owner.symtab->compunit ()->objfile ()->arch (); + if (!is_objfile_owned ()) + return owner.arch; + return owner.symtab->compunit ()->objfile ()->arch (); } =20 /* See symtab.h. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index f6720bb07d8..a773fccf50f 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1382,6 +1382,10 @@ struct symbol : public general_symbol_info, public a= llocate_on_obstack =20 struct objfile *objfile () const; =20 + /* Return the ARCH of this symbol. */ + + struct gdbarch *arch () const; + /* Data type of value */ =20 struct type *m_type =3D nullptr; @@ -1498,10 +1502,6 @@ extern int register_symbol_block_impl (enum address_= class aclass, extern int register_symbol_register_impl (enum address_class, const struct symbol_register_ops *); =20 -/* Return the ARCH of SYMBOL. */ - -extern struct gdbarch *symbol_arch (const struct symbol *symbol); - /* Return the SYMTAB of SYMBOL. It is an error to call this if symbol.is_objfile_owned is false, which only happens for architecture-provided types. */ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 5a4048f9078..18c3803ac19 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2506,7 +2506,7 @@ info_scope_command (const char *args_in, int from_tty) if (symname =3D=3D NULL || *symname =3D=3D '\0') continue; /* Probably botched, certainly useless. */ =20 - gdbarch =3D symbol_arch (sym); + gdbarch =3D sym->arch (); =20 gdb_printf ("Symbol %s is ", symname);