aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-03-12 13:39:02 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2019-03-12 13:45:47 -0700
commit36c53a0262f84ad11d738471789dadfa9c4eb320 (patch)
tree97a5e597277b23eee55217cec3f2c840898615f7
parent6e056c817845f3d736a1be6b68c69b439c6c6d25 (diff)
downloadgdb-36c53a0262f84ad11d738471789dadfa9c4eb320.zip
gdb-36c53a0262f84ad11d738471789dadfa9c4eb320.tar.gz
gdb-36c53a0262f84ad11d738471789dadfa9c4eb320.tar.bz2
Remove code disabled since at least 1999 from lookup_struct_elt_type.
Update the comment above the function to reflect the code removal and document the existing behavior. gdb/ChangeLog: * gdbtypes.c (lookup_struct_elt_type): Update comment and remove disabled code block.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c21
2 files changed, 8 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f644723..fe2d3e4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-03-12 John Baldwin <jhb@FreeBSD.org>
+ * gdbtypes.c (lookup_struct_elt_type): Update comment and
+ remove disabled code block.
+
+2019-03-12 John Baldwin <jhb@FreeBSD.org>
+
* gdbarch.sh (get_thread_local_address): New method.
* gdbarch.h, gdbarch.c: Regenerate.
* target.c (target_translate_tls_address): Use
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 09284ef..5924b15 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1644,8 +1644,7 @@ lookup_template_type (char *name, struct type *type,
return (SYMBOL_TYPE (sym));
}
-/* Given a type TYPE, lookup the type of the component of type named
- NAME.
+/* Given a type TYPE, lookup the type of the component 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
@@ -1653,8 +1652,8 @@ lookup_template_type (char *name, struct type *type,
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. */
+ If NOERR is nonzero, return NULL if there is no component named
+ NAME. */
struct type *
lookup_struct_elt_type (struct type *type, const char *name, int noerr)
@@ -1678,20 +1677,6 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
type_name.c_str ());
}
-#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. */
- {
- char *type_name;
-
- type_name = TYPE_NAME (type);
- if (type_name != NULL && strcmp (type_name, name) == 0)
- return type;
- }
-#endif
-
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
const char *t_field_name = TYPE_FIELD_NAME (type, i);