aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-09-11 13:58:04 -0600
committerTom Tromey <tom@tromey.com>2021-09-23 15:11:00 -0600
commit809f3be12c0621cbf071c585da5638f6841c38b1 (patch)
treec0a9beeebaf38da9fb3a3e7447f4cb18a624479f /gdb/findvar.c
parent0086a91ceef5207463a10c875ed85c40eb066722 (diff)
downloadgdb-809f3be12c0621cbf071c585da5638f6841c38b1.zip
gdb-809f3be12c0621cbf071c585da5638f6841c38b1.tar.gz
gdb-809f3be12c0621cbf071c585da5638f6841c38b1.tar.bz2
Change pointer_type to a method of struct type
I noticed that pointer_type is declared in language.h and defined in language.c. However, it really has to do with types, so it should have been in gdbtypes.h all along. This patch changes it to be a method on struct type. And, I went through uses of TYPE_IS_REFERENCE and updated many spots to use the new method as well. (I didn't update ones that were in arch-specific code, as I couldn't readily test that.)
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index fcd9719..56edbdb 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -153,7 +153,7 @@ extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
CORE_ADDR
extract_typed_address (const gdb_byte *buf, struct type *type)
{
- if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
+ if (!type->is_pointer_or_reference ())
internal_error (__FILE__, __LINE__,
_("extract_typed_address: "
"type is not a pointer or reference"));
@@ -206,7 +206,7 @@ template void store_integer (gdb_byte *addr, int len,
void
store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
- if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
+ if (!type->is_pointer_or_reference ())
internal_error (__FILE__, __LINE__,
_("store_typed_address: "
"type is not a pointer or reference"));