public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31569] New: "finish" command loses typedef
@ 2024-03-28 14:28 tromey at sourceware dot org
  0 siblings, 0 replies; only message in thread
From: tromey at sourceware dot org @ 2024-03-28 14:28 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31569
           Summary: "finish" command loses typedef
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

gcc has a "tree" typedef and a pretty-printer that
recognizes it.

While debugging gcc, I used "finish" and got:

(gdb) fini
Run till exit from #0  get_global_context () at
../../gcc/gcc/ada/gcc-interface/utils.cc:812
0x0000000001b0e800 in gnat_push_namespace (ns=<namespace_decl 0x7fffe9c32980
pck>) at ../../gcc/gcc/ada/gcc-interface/utils.cc:820
Value returned is $26 = (tree_node *) 0x7fffe9c0c168


However, this function is actually defined as:

static tree
get_global_context (void)
{
...


If I cast that value back to a tree, I get the pretty-printer output:

(gdb) p (tree) $
$28 = <translation_unit_decl 0x7fffe9c0c168 pck.ads>


I think this is a bug -- "finish" should result in a value that
uses the function's declared return type, so that pretty-printers
can see what they expect.

Arguably I guess this is a bug in gcc as well, since it should
probably recognize the underlying type and not the typedef.

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-28 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 14:28 [Bug gdb/31569] New: "finish" command loses typedef tromey at sourceware dot org

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