From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] gdb: include allocated/associated properties in 'maint print type'
Date: Wed, 23 Dec 2020 23:53:54 +0000 [thread overview]
Message-ID: <a24f5607c4bd222d2da3cf7763fa171f526df9b2.1608767467.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1608767467.git.andrew.burgess@embecosm.com>
Adds the allocated and associated dynamic properties into the output
of the 'maintenance print type' command.
gdb/ChangeLog:
* gdbtypes (recursive_dump_type): Include allocated and associated
properties.
---
gdb/ChangeLog | 5 +++++
gdb/gdbtypes.c | 18 ++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 569e7a3e659..8e90c4b108b 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5269,6 +5269,24 @@ recursive_dump_type (struct type *type, int spaces)
}
puts_filtered ("\n");
printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ());
+ if (TYPE_ASSOCIATED_PROP (type) != nullptr
+ || TYPE_ALLOCATED_PROP (type) != nullptr)
+ {
+ printf_filtered ("%*s", spaces, "");
+ if (TYPE_ASSOCIATED_PROP (type) != nullptr)
+ {
+ printf_filtered ("associated ");
+ dump_dynamic_prop (*TYPE_ASSOCIATED_PROP (type));
+ }
+ if (TYPE_ALLOCATED_PROP (type) != nullptr)
+ {
+ if (TYPE_ASSOCIATED_PROP (type))
+ printf_filtered (" ");
+ printf_filtered ("allocated ");
+ dump_dynamic_prop (*TYPE_ALLOCATED_PROP (type));
+ }
+ printf_filtered ("\n");
+ }
gdb_print_host_address (type->fields (), gdb_stdout);
puts_filtered ("\n");
for (idx = 0; idx < type->num_fields (); idx++)
--
2.25.4
next prev parent reply other threads:[~2020-12-23 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-23 23:53 [PATCH 0/2] Avoid resolving dynamic properties for non-allocated arrays Andrew Burgess
2020-12-23 23:53 ` Andrew Burgess [this message]
2020-12-24 5:41 ` [PATCH 1/2] gdb: include allocated/associated properties in 'maint print type' Simon Marchi via Gdb-patches
2020-12-23 23:53 ` [PATCH 2/2] gdb: avoid resolving dynamic properties for non-allocated arrays Andrew Burgess
2020-12-24 14:46 ` Simon Marchi via Gdb-patches
2020-12-24 17:04 ` Andrew Burgess
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=a24f5607c4bd222d2da3cf7763fa171f526df9b2.1608767467.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--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