aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-03-03 02:09:02 +0000
committerFred Fish <fnf@specifix.com>1993-03-03 02:09:02 +0000
commit45364c8a2a8b0bbdac88b937f30459281fc4f00d (patch)
treec765dd97caffd7ec2f24294b919cb874099118d7 /gdb/gdbtypes.c
parent312bef9d216edd079836fb258a0c234f169f65ca (diff)
downloadgdb-45364c8a2a8b0bbdac88b937f30459281fc4f00d.zip
gdb-45364c8a2a8b0bbdac88b937f30459281fc4f00d.tar.gz
gdb-45364c8a2a8b0bbdac88b937f30459281fc4f00d.tar.bz2
* c-exp.y (parse_number): Change high_bit to unsigned.
* demangle.c: Change all references to cfront to ARM, since the actual algorithm is the one specified in the Annotated Reference Manual. This was confusing users into thinking that full cfront support was implemented. * dwarfread.c (CFRONT_PRODUCER): Remove, was never really used. * eval.c (evaluate_subexp): For STRUCTOP_PTR pass the arg type directly to lookup_struct_elt_type, which will do the dereferencing itself. * gdbtypes.c (lookup_struct_elt_type): Expand comments. Fix NULL dereferencing bug for unnamed structs, comment out questionable code.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 4be115d..9bcdec0 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -691,6 +691,12 @@ lookup_template_type (name, type, block)
}
/* Given a type TYPE, lookup the type of the component of type named NAME.
+
+ TYPE can be either a struct or union, or a pointer or reference to a struct or
+ union. If it is a pointer or reference, its target type is automatically used.
+ Thus '.' and '->' are interchangable, as specified for the definitions of the
+ expression element types STRUCTOP_STRUCT and STRUCTOP_PTR.
+
If NOERR is nonzero, return zero if NAME is not suitably defined.
If NAME is the name of a baseclass type, return that type. */
@@ -701,6 +707,7 @@ lookup_struct_elt_type (type, name, noerr)
int noerr;
{
int i;
+ char *typename;
if (TYPE_CODE (type) == TYPE_CODE_PTR ||
TYPE_CODE (type) == TYPE_CODE_REF)
@@ -718,8 +725,15 @@ lookup_struct_elt_type (type, name, noerr)
check_stub_type (type);
- if (STREQ (type_name_no_tag (type), name))
+#if 0
+ /* FIXME: This change put in by Michael seems incorrect for the case where
+ the structure tag name is the same as the member name. I.E. when doing
+ "ptype bell->bar" for "struct foo { int bar; int foo; } bell;"
+ Disabled by fnf. */
+ typename = type_name_no_tag (type);
+ if (typename != NULL && STREQ (typename, name))
return type;
+#endif
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{