From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 949D23858C66; Mon, 6 Mar 2023 18:32:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 949D23858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678127569; bh=lP0m+yRgDaQnjKw0wIIUFl/fqImY6exSdBvzHE75jiE=; h=From:To:Subject:Date:From; b=S07OH0Hakg+iHc1HvbHX66UJk9sbmGbYt065J/PMhjBIe+4JyViBMKSUrYd//2L1S GCbmrzZvw1tRpwiPG/bZzwo0UfwCe9joLY2KeEOIUl2v2VTsjQHqVMpBHsfOBoknoG NHBwvLqu+DeQ/znwuN1MHg3n/+Cgftz8yclp1fsE= From: "woodard at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/30204] New: RFE add an option to to ptype to print the decl file and decl line for a type Date: Mon, 06 Mar 2023 18:32:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: woodard at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30204 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 prin= t 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=