diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-16 17:24:16 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-19 12:51:05 -0700 |
commit | 7f5937df01cc829544baa921bfb81bfe0ccdc892 (patch) | |
tree | 4d9def9bc793bc199a990a13bbe5bbb4364bbd80 | |
parent | 46baa3c6cf679e53b233708f7d5efd543c1084d7 (diff) | |
download | binutils-7f5937df01cc829544baa921bfb81bfe0ccdc892.zip binutils-7f5937df01cc829544baa921bfb81bfe0ccdc892.tar.gz binutils-7f5937df01cc829544baa921bfb81bfe0ccdc892.tar.bz2 |
Convert block_gdbarch to method
This converts block_gdbarch to be a method. This was mostly written
by script.
-rw-r--r-- | gdb/ada-lang.c | 2 | ||||
-rw-r--r-- | gdb/block.c | 8 | ||||
-rw-r--r-- | gdb/block.h | 8 | ||||
-rw-r--r-- | gdb/cp-namespace.c | 2 | ||||
-rw-r--r-- | gdb/d-namespace.c | 2 | ||||
-rw-r--r-- | gdb/symtab.c | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 0198598..a1de8c4 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13822,7 +13822,7 @@ public: if (block == NULL) gdbarch = target_gdbarch (); else - gdbarch = block_gdbarch (block); + gdbarch = block->gdbarch (); sym.symbol = language_lookup_primitive_type_as_symbol (this, gdbarch, name); if (sym.symbol != NULL) diff --git a/gdb/block.c b/gdb/block.c index d7d5f0b..b9c48e7 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -54,12 +54,12 @@ block::objfile () const /* See block. */ struct gdbarch * -block_gdbarch (const struct block *block) +block::gdbarch () const { - if (block->function () != nullptr) - return block->function ()->arch (); + if (function () != nullptr) + return function ()->arch (); - return block->objfile ()->arch (); + return objfile ()->arch (); } /* See block.h. */ diff --git a/gdb/block.h b/gdb/block.h index 2243c9a..b9f1ba8 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -208,6 +208,10 @@ struct block struct objfile *objfile () const; + /* Return the architecture of this block. */ + + struct gdbarch *gdbarch () const; + /* Addresses in the executable code that are in this block. */ CORE_ADDR m_start; @@ -335,10 +339,6 @@ private: struct block *m_blocks[1]; }; -/* Return the architecture of BLOCK, which must be non-NULL. */ - -extern struct gdbarch *block_gdbarch (const struct block *block); - extern struct symbol *block_linkage_function (const struct block *); extern struct symbol *block_containing_function (const struct block *); diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index b1c54c5..97b7a65 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -197,7 +197,7 @@ cp_lookup_bare_symbol (const struct language_defn *langdef, if (block == NULL) gdbarch = target_gdbarch (); else - gdbarch = block_gdbarch (block); + gdbarch = block->gdbarch (); sym.symbol = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name); sym.block = NULL; diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c index 2978e5f..aaef1df 100644 --- a/gdb/d-namespace.c +++ b/gdb/d-namespace.c @@ -94,7 +94,7 @@ d_lookup_symbol (const struct language_defn *langdef, if (block == NULL) gdbarch = target_gdbarch (); else - gdbarch = block_gdbarch (block); + gdbarch = block->gdbarch (); sym.symbol = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name); sym.block = NULL; diff --git a/gdb/symtab.c b/gdb/symtab.c index 4084168..7b7e525 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2442,7 +2442,7 @@ language_defn::lookup_symbol_nonlocal (const char *name, if (block == NULL) gdbarch = target_gdbarch (); else - gdbarch = block_gdbarch (block); + gdbarch = block->gdbarch (); result.symbol = language_lookup_primitive_type_as_symbol (this, gdbarch, name); result.block = NULL; |