public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "asmwarrior at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/29079] Python pretty printer does not work for class members
Date: Thu, 21 Apr 2022 03:02:49 +0000	[thread overview]
Message-ID: <bug-29079-4717-Al34DeVe2I@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29079-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29079

--- Comment #1 from asmwarrior <asmwarrior at gmail dot com> ---
ssbssa wrote a patch to fix this issue:

Here is the patch:

================
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 6b1531ef442..f540c681403 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1028,16 +1028,6 @@ common_val_print (struct value *value, struct ui_file
*stream, int recurse,

   QUIT;

-  /* Ensure that the type is complete and not just a stub.  If the type is
-     only a stub and we can't find and substitute its complete type, then
-     print appropriate string and return.  */
-
-  if (real_type->is_stub ())
-    {
-      fprintf_styled (stream, metadata_style.style (), _("<incomplete
type>"));
-      return;
-    }
-
   if (!valprint_check_validity (stream, real_type, 0, value))
     return;

@@ -1048,6 +1038,16 @@ common_val_print (struct value *value, struct ui_file
*stream, int recurse,
        return;
     }

+  /* Ensure that the type is complete and not just a stub.  If the type is
+     only a stub and we can't find and substitute its complete type, then
+     print appropriate string and return.  */
+
+  if (real_type->is_stub ())
+    {
+      fprintf_styled (stream, metadata_style.style (), _("<incomplete
type>"));
+      return;
+    }
+
   /* Handle summary mode.  If the value is a scalar, print it;
      otherwise, print an ellipsis.  */
   if (options->summary && !val_print_scalar_type_p (type))

=======================================

For more details, you can see the discussion here:

Re: [solved] Creating a gdb Pretty-Printer for wxIPV4address —
https://forums.wxwidgets.org/viewtopic.php?p=211799#p211799

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2022-04-21  3:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 23:24 [Bug python/29079] New: " asmwarrior at gmail dot com
2022-04-21  3:02 ` asmwarrior at gmail dot com [this message]
2023-12-08 17:22 ` [Bug python/29079] " cvs-commit at gcc dot gnu.org
2023-12-08 17:23 ` ssbssa at sourceware dot org
2023-12-09  9:03 ` asmwarrior at gmail dot com

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=bug-29079-4717-Al34DeVe2I@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).