public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dave Hooper" <dave@rebuzz.org>
To: <gcc@gcc.gnu.org>
Subject: No 'g' stab type generated for pointer-to-function in C/C++ - suggestion for devel.
Date: Sat, 04 Jan 2003 00:59:00 -0000	[thread overview]
Message-ID: <012a01c2b38c$10d0d4f0$0402a8c0@badsector> (raw)

I'm new to the gcc lists, so I apologise deeply if this has already been
discussed to death.  I did perform a search of the archives and found
nothing relevant.

From discussion on gdb development lists (circa Feb 2002) it appears
gdb supports the 'g' stab to convey function argument type information.  For
example,
 .stabs  "f1:G(1,1)=*(1,2)=g(0,1)(0,1)(0,1)#",32,0,0,0
is the corresponding stab for
 int (*f1)(int,int);

In fact I've tried this with gdb and a hex editor and it correctly reports
the type when I enter "whatis f1".

However gcc only emits plain 'f' stabs, such as
 .stabs  "f1:G(1,1)=*(1,2)=f(0,1)",32,0,0,0

which is equivalent to saying just
int (*f1)();

(i.e. the parameters of f1 are 'unknown').

Any two function pointers that return the same type are thus
indistinguishable, as the 'f' stab only declares return type, unlike the 'g'
stab which declares return type and the type of all function parameters.
So, gdb supports the 'g' stab but gcc doesn't ever generate it.  Has anyone
tried adding the 'g' stab output to dbxout.c ?
I've also posted a similar report to gcc-bugs

d

                 reply	other threads:[~2003-01-04  0:59 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='012a01c2b38c$10d0d4f0$0402a8c0@badsector' \
    --to=dave@rebuzz.org \
    --cc=gcc@gcc.gnu.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).