public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30204] New: RFE add an option to to ptype to print the decl file and decl line for a type
@ 2023-03-06 18:32 woodard at redhat dot com
  2023-03-07 14:13 ` [Bug gdb/30204] " tromey at sourceware dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: woodard at redhat dot com @ 2023-03-06 18:32 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30204
           Summary: RFE add an option to to ptype to print the decl file
                    and decl line for a type
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: woodard at redhat dot com
  Target Milestone: ---

Sometimes when you are looking at a type it is hard to figure out where that
declaration actually came from. This is included in the DWARF, can you print it
out. Maybe add a flag to ptype that does this:

(gdb) help ptype
Print definition of type TYPE.
Usage: ptype[/FLAGS] TYPE | EXPRESSION
Argument may be any type (for example a type name defined by typedef,
or "struct STRUCT-TAG" or "class CLASS-NAME" or "union UNION-TAG"
or "enum ENUM-TAG") or an expression.
The selected stack frame's lexical context is used to look up the name.
Contrary to "whatis", "ptype" always unrolls any typedefs.

Available FLAGS are:
  /r    print in "raw" form; do not substitute typedefs
  /m    do not print methods defined in a class
  /M    print methods defined in a class
  /t    do not print typedefs defined in a class
  /T    print typedefs defined in a class
  /o    print offsets and sizes of fields in a struct (like pahole)

like /l include declaration file and line

according to fche this could probably be added to whatis_exp() in typeprint.c
if gdb's struct type in gdbtypes.h was modified to add the declfile and the
declline attributes.

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

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

end of thread, other threads:[~2023-03-08  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06 18:32 [Bug gdb/30204] New: RFE add an option to to ptype to print the decl file and decl line for a type woodard at redhat dot com
2023-03-07 14:13 ` [Bug gdb/30204] " tromey at sourceware dot org
2023-03-07 15:34 ` ssbssa at sourceware dot org
2023-03-08  0:54 ` woodard at redhat dot com

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