From: Daniel Jacobowitz <drow@false.org>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] get rid of redundant data in c++ and java
Date: Thu, 01 May 2008 19:25:00 -0000 [thread overview]
Message-ID: <20080501192532.GG22218@caradoc.them.org> (raw)
In-Reply-To: <47AD383E.7000205@qnx.com>
On Sat, Feb 09, 2008 at 12:21:02AM -0500, Aleksandar Ristovski wrote:
> Hello,
>
> Currently we synthesize typedef info for java and c++ (and ada, but I am
> not familiar with that language) for any symbol with STRUCT_DOMAIN domain.
> This can add up to a lot of redundant data. For partial symbols, we
> generate two identical names for the same symbol, once as struct second as
> typedef. The same happens with symbols, except we do not duplicate symbol
> name, but we do allocate another symbol struture.
>
> Instead of generating redundant data for symbols with STRUCT_DOMAIN domain
> in java and c++ languages, treat STRUCT_DOMAIN as equal to VAR_DOMAIN for
> these two languages when looking up symbols.
Sorry for taking so long to look at this. It's a great idea and the
patch seems correct to me. Just some cosmetic issues, and then it can
go in.
> - if (cu->language == language_cplus
> - || cu->language == language_java
> - || cu->language == language_ada)
> + if (cu->language == language_ada)
> {
> - /* For C++ and Java, these implicitly act as typedefs as well. */
> + /* FIXME: Check if Ada really
> + needs to implicitly set typedef. */
If this works for C++ and Java, it will work for Ada too. If you
can't test Ada, please post a final version of the patch and ask Joel
to run tests for you - I'm sure he won't mind getting all that memory
back for Ada too.
> -
> - /* The semantics of C++ state that "struct foo { ... }" also
> - defines a typedef for "foo". A Java class declaration also
> - defines a typedef for the class. Synthesize a typedef symbol
> - so that "ptype foo" works as expected. */
> +
Since we still need to set the typedef name here, leave the first two
sentences of the comment.
> + if (symbol_language == language_cplus
> + || symbol_language == language_java)
Only need one space there.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-05-01 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-09 5:21 Aleksandar Ristovski
2008-02-14 0:16 ` Aleksandar Ristovski
2008-02-14 1:35 ` Daniel Jacobowitz
2008-05-01 19:25 ` Daniel Jacobowitz [this message]
2008-05-02 13:43 ` Aleksandar Ristovski
2008-05-02 13:39 ` Aleksandar Ristovski
2008-05-02 14:01 ` Daniel Jacobowitz
2008-05-03 0:01 ` Joel Brobecker
2008-05-05 16:15 ` Aleksandar Ristovski
2008-05-05 15:16 ` Aleksandar Ristovski
2008-04-22 16:46 Aleksandar Ristovski
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=20080501192532.GG22218@caradoc.them.org \
--to=drow@false.org \
--cc=aristovski@qnx.com \
--cc=gdb-patches@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