From: Richard Earnshaw <rearnsha@arm.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: Julian Brown <julian@codesourcery.com>,
gdb-patches@sourceware.org,
Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: [PATCH] Interpret DW_TAG_unspecified_type as void
Date: Mon, 19 Jun 2006 12:58:00 -0000 [thread overview]
Message-ID: <1150721856.6312.8.camel@pc960.cambridge.arm.com> (raw)
In-Reply-To: <200606180114.k5I1E5nu017691@elgar.sibelius.xs4all.nl>
On Sun, 2006-06-18 at 02:14, Mark Kettenis wrote:
> > Date: Fri, 09 Jun 2006 13:29:38 +0100
> > From: Julian Brown <julian@codesourcery.com>
> >
> > Hi,
> >
> > This is part of a series of patches from a CodeSourcery branch which
> > enable the output of ARM's RVCT 2.2 compiler to be debugged with gdb.
> >
> > This patch handles the C/C++ interpretation of the DWARF 3 construct
> > DW_TAG_unspecified_type as void. This is used in representing e.g.
> > pointer-to-void types. Other languages will currently be handled in
> > exactly the same way; though I'm not entirely sure if that's a sensible
> > default, I don't know what would be better. (Re: section 5.2 of the
> > DWARF 3 doc.)
> >
> > Tested natively on x86_64-unknown-linux-gnu and cross to arm-none-eabi
> > with no change in results. Tests against the ARM compiler are improved
> > somewhat.
> >
> > OK to apply?
>
> I haven't looked into what the DWARF spec actually says, but
> traditionally unspecified types in C default to 'int', not 'void'.
5.2 Unspecified Type Entries
Some languages have constructs in which a type may be left
unspecified or the absence of a type may be explicitly
indicated.
An unspecified (implicit, unknown, ambiguous or nonexistent)
type is represented by a debugging information entry with the
tag DW_TAG_unspecified_type. If a name has been given to the
type, then the corresponding unspecified type entry has a
DW_AT_name attribute whose value is a null-terminated string
containing the name as it appears in the source program.
The interpretation of this debugging information entry is
intentionally left flexible to allow it to be interpreted
appropriately in different languages. For example, in C and C++
the language implementation can provide an unspecified type
entry with the name "void" which can be referenced by the type
attribute of pointer types and typedef declarations for 'void'
(see Sections 5.3 and 5.4, respectively). As another example, in
Ada such an unspecified type entry can be referred to by the
type attribute of an access type where the denoted type is
incomplete (the name is declared as a type but the definition is
deferred to a separate compilation unit).
So in this case we do mean void (in particular void* means pointer to
unspecified type). The 'defaults to int' is more an implicit type than
an unspecified type, and the third paragraph above makes it cleat that
void is what is meant for C.
R.
prev parent reply other threads:[~2006-06-19 12:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 12:32 Julian Brown
2006-06-13 23:42 ` Jim Blandy
2006-06-13 23:47 ` Daniel Jacobowitz
2006-06-18 1:16 ` Mark Kettenis
2006-06-19 12:58 ` Richard Earnshaw [this message]
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=1150721856.6312.8.camel@pc960.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=julian@codesourcery.com \
--cc=mark.kettenis@xs4all.nl \
/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