Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 05/11] Remove code disabled since at least 1999 from lookup_struct_elt_type.
Date: Sat, 09 Feb 2019 00:50:00 -0000	[thread overview]
Message-ID: <be4bd549ff488c6a8d7407997bb5454457d3431d.1549672588.git.jhb@FreeBSD.org> (raw)
In-Reply-To: <cover.1549672588.git.jhb@FreeBSD.org>

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.
---
 gdb/ChangeLog  |  5 +++++
 gdb/gdbtypes.c | 21 +++------------------
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 621b9af800..cebd63bcb5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-08  John Baldwin  <jhb@FreeBSD.org>
+
+	* gdbtypes.c (lookup_struct_elt_type): Update comment and
+	remove disabled code block.
+
 2019-02-08  John Baldwin  <jhb@FreeBSD.org>
 
 	* gdbarch.sh (get_thread_local_address): New method.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d1ca304a92..e4acb0e985 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);
-- 
2.19.2


  parent reply	other threads:[~2019-02-09  0:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-09  0:42 [PATCH v2 00/11] Support for thread-local variables on FreeBSD John Baldwin
2019-02-09  0:42 ` [PATCH v2 07/11] Add a helper function to resolve TLS variable addresses for FreeBSD John Baldwin
2019-03-07 16:18   ` Simon Marchi
2019-02-09  0:42 ` [PATCH v2 01/11] Support the fs_base and gs_base registers on i386 John Baldwin
2019-02-09  0:42 ` [PATCH v2 08/11] Support TLS variables on FreeBSD/amd64 John Baldwin
2019-02-09  0:42 ` [PATCH v2 02/11] Support fs_base and gs_base on FreeBSD/i386 John Baldwin
2019-02-09  0:42 ` [PATCH v2 06/11] Add a more general version of lookup_struct_elt_type John Baldwin
2019-02-09  1:08   ` John Baldwin
2019-02-11 10:27     ` Philipp Rudo
2019-02-11 17:44       ` John Baldwin
2019-03-07 15:53   ` Simon Marchi
2019-03-08  0:04     ` John Baldwin
2019-03-08  0:32       ` Pedro Alves
2019-03-08 18:39         ` John Baldwin
2019-02-09  0:42 ` [PATCH v2 11/11] Support TLS variables on FreeBSD/powerpc John Baldwin
2019-03-07 16:26   ` Simon Marchi
2019-02-09  0:42 ` [PATCH v2 03/11] Handle an edge case for minisym TLS variable lookups John Baldwin
2019-02-09  0:42 ` [PATCH v2 09/11] Support TLS variables on FreeBSD/i386 John Baldwin
2019-02-09  0:50 ` John Baldwin [this message]
2019-03-07 16:25   ` [PATCH v2 05/11] Remove code disabled since at least 1999 from lookup_struct_elt_type Simon Marchi
2019-02-09  0:50 ` [PATCH v2 10/11] Support TLS variables on FreeBSD/riscv John Baldwin
2019-02-09  0:50 ` [PATCH v2 04/11] Add a new gdbarch method to resolve the address of TLS variables John Baldwin
2019-03-07 16:08   ` Simon Marchi
2019-03-07 23:50     ` John Baldwin
2019-03-08  2:55       ` Simon Marchi
2019-03-08 18:39         ` John Baldwin
2019-02-22 17:22 ` [PING][PATCH v2 00/11] Support for thread-local variables on FreeBSD John Baldwin
2019-03-12 20:21   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be4bd549ff488c6a8d7407997bb5454457d3431d.1549672588.git.jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox