public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/31569] New: "finish" command loses typedef
Date: Thu, 28 Mar 2024 14:28:06 +0000	[thread overview]
Message-ID: <bug-31569-4717@http.sourceware.org/bugzilla/> (raw)

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.

                 reply	other threads:[~2024-03-28 14:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-31569-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).