public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Christian Walther <walther@indel.ch>
To: gdb-patches@sourceware.org
Cc: Christian Walther <walther@indel.ch>
Subject: [PATCH v2 2/2] Move a comment to a less confusing place
Date: Wed, 22 Jun 2022 17:37:40 +0200	[thread overview]
Message-ID: <20220622153740.176590-2-walther@indel.ch> (raw)
In-Reply-To: <20220622153740.176590-1-walther@indel.ch>

Make it clearer that this comment (from 2024f65) does not apply to the
call to check_typedef further down, which is not on the return value of
get_target_type.
---
 gdb/c-varobj.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c
index 64c3a9ebf1c..acda879bfeb 100644
--- a/gdb/c-varobj.c
+++ b/gdb/c-varobj.c
@@ -86,6 +86,9 @@ adjust_value_for_child_access (struct value **value,
   if ((*type)->code () == TYPE_CODE_PTR)
     {
       struct type *target_type = get_target_type (*type);
+      /* The 'get_target_type' function calls check_typedef on
+	 result, so we can immediately check type code.  No
+	 need to call check_typedef here.  */
       if (target_type->code () == TYPE_CODE_STRUCT
 	  || target_type->code () == TYPE_CODE_UNION)
 	{
@@ -108,10 +111,6 @@ adjust_value_for_child_access (struct value **value,
 	}
     }
 
-  /* The 'get_target_type' function calls check_typedef on
-     result, so we can immediately check type code.  No
-     need to call check_typedef here.  */
-
   /* Access a real type of the value (if necessary and possible).  */
   if (value && *value && lookup_actual_type)
     {
-- 
2.25.1


  reply	other threads:[~2022-06-22 15:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21  8:18 [PATCH] Fix number of children of varobj with stub debug info Christian Walther
2022-06-21 14:24 ` Bruno Larsen
2022-06-22 12:58   ` Christian Walther
2022-06-22 13:40     ` Bruno Larsen
2022-06-22 15:37       ` [PATCH v2 1/2] " Christian Walther
2022-06-22 15:37         ` Christian Walther [this message]
2022-07-25 12:52         ` [PING][PATCH " Christian Walther
2022-06-22 15:43       ` [PATCH] " Christian Walther

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=20220622153740.176590-2-walther@indel.ch \
    --to=walther@indel.ch \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).