aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1997-08-05 21:58:57 +0000
committerPer Bothner <per@bothner.com>1997-08-05 21:58:57 +0000
commitf7f37388dc1d7910711f89b1c6b4f3808533ff2d (patch)
tree8f18c81b7fd22c852dd579cc2afe559caea8b7ac /gdb/cp-valprint.c
parent0e25edcacc69ff157685d6653fb1304eae9b773d (diff)
downloadgdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.zip
gdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.tar.gz
gdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.tar.bz2
* gdbtypes.h: Re-interpret struct field. Suppport address of static.
Add a bunch of macros. * coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c: Update to use new macros. * coffread.c, hpread.c, stabsread.c: Remove bugus TYPE_FIELD_VALUE. * value.h, values.c (value_static_field): New function. * cp-valprint.c, valops.c: Modify to use value_static_field.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index b43da16..e6790a4 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -333,21 +333,13 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
}
else if (TYPE_FIELD_STATIC (type, i))
{
- value_ptr v;
- char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, i);
- struct symbol *sym =
- lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym == NULL)
+ value_ptr v = value_static_field (type, i);
+ if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
- {
- v = value_at (TYPE_FIELD_TYPE (type, i),
- SYMBOL_VALUE_ADDRESS (sym),
- NULL);
- cp_print_static_field (TYPE_FIELD_TYPE (type, i), v,
- stream, format, recurse + 1,
- pretty);
- }
+ cp_print_static_field (TYPE_FIELD_TYPE (type, i), v,
+ stream, format, recurse + 1,
+ pretty);
}
else
{