public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to implement an abbreviated view of a class type
@ 2023-05-24 18:07 Mary Ma
  2023-05-24 18:27 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Mary Ma @ 2023-05-24 18:07 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Dear all,

I am currently working on implementing pretty printing views for some class types in both GUI-based GDB, such as VS Code, and GDB command line interface. These types contain nested classes and multiple levels of inheritance.

However, the challenge I'm facing is that the command line interface displays all the information of a class type at once including inheritance, properties, subclasses. This makes the output overwhelming for developers, especially when encountering cyclic structures.

For instance, it's possible that Type A points to Type B and vice versa, creating a cyclic relationship that makes the view look messy.

I am wondering if there are ways to present an abbreviated view of a type and allow developers to have further control over the amount of detail in the output, depending on what developers want to see.

I would greatly appreciate any suggestions or ideas from you. Thank you in advance!

Best regards,
Mary

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to implement an abbreviated view of a class type
  2023-05-24 18:07 How to implement an abbreviated view of a class type Mary Ma
@ 2023-05-24 18:27 ` Eli Zaretskii
  2023-05-25 13:42   ` Mary Ma
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-05-24 18:27 UTC (permalink / raw)
  To: Mary Ma; +Cc: gdb

> Date: Wed, 24 May 2023 18:07:06 +0000
> From: Mary Ma via Gdb <gdb@sourceware.org>
> 
> However, the challenge I'm facing is that the command line interface displays all the information of a class type at once including inheritance, properties, subclasses. This makes the output overwhelming for developers, especially when encountering cyclic structures.
> 
> For instance, it's possible that Type A points to Type B and vice versa, creating a cyclic relationship that makes the view look messy.
> 
> I am wondering if there are ways to present an abbreviated view of a type and allow developers to have further control over the amount of detail in the output, depending on what developers want to see.

Did you try using the 'explore' command?

There are also several settings for the 'print' command, all of them
starting with "set print type".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: How to implement an abbreviated view of a class type
  2023-05-24 18:27 ` Eli Zaretskii
@ 2023-05-25 13:42   ` Mary Ma
  0 siblings, 0 replies; 3+ messages in thread
From: Mary Ma @ 2023-05-25 13:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb

Hello Eli,

Thank you for your help.

The interactive feature of the 'explore' command is exactly what we are looking for. However, based on my investigation, it appears that I can only explore the default view of a type using the 'explore' command. Is it possible to explore the custom view defined by pretty printing function?

Please let me know if this is feasible and if there are any additional steps needed to achieve this. I appreciate your assistance.

Best regards,
Mary

-----Original Message-----
From: Eli Zaretskii <eliz@gnu.org> 
Sent: Wednesday, May 24, 2023 2:27 PM
To: Mary Ma <maryma@mathworks.com>
Cc: gdb@sourceware.org
Subject: Re: How to implement an abbreviated view of a class type

> Date: Wed, 24 May 2023 18:07:06 +0000
> From: Mary Ma via Gdb <gdb@sourceware.org>
> 
> However, the challenge I'm facing is that the command line interface displays all the information of a class type at once including inheritance, properties, subclasses. This makes the output overwhelming for developers, especially when encountering cyclic structures.
> 
> For instance, it's possible that Type A points to Type B and vice versa, creating a cyclic relationship that makes the view look messy.
> 
> I am wondering if there are ways to present an abbreviated view of a type and allow developers to have further control over the amount of detail in the output, depending on what developers want to see.

Did you try using the 'explore' command?

There are also several settings for the 'print' command, all of them starting with "set print type".


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-25 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 18:07 How to implement an abbreviated view of a class type Mary Ma
2023-05-24 18:27 ` Eli Zaretskii
2023-05-25 13:42   ` Mary Ma

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).