Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: dje@google.com (Doug Evans)
Cc: gdb-patches@sourceware.org, ccoutant@google.com
Subject: Re: [RFA] comdat types
Date: Thu, 25 Jun 2009 19:47:00 -0000	[thread overview]
Message-ID: <m3y6rgf656.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090620000402.C37E5843F5@localhost> (Doug Evans's message of "Fri\, 19 Jun 2009 17\:04\:02 -0700 \(PDT\)")

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> This patch adds support for "comdat types" from dwarf4.
Doug> http://wiki.dwarfstd.org/index.php?title=COMDAT_Type_Sections

I am a fan of this.

I'm curious about one thing on this page, and I thought I'd take the
opportunity to ask.  DW_TAG_type_unit may have a DW_AT_language child.
But, the language is not mentioned in the suggested method for
computing a type's signature.  This seems strange to me: either the
language matters (in which case, it seems like it ought to be in the
signature); or the language does not matter, in which case, why
mention it?

Doug> I need to revisit them with the latest gcc (the dwarf4 branch)
Doug> as they seem like gcc issues.
Doug> [specifically gdb.cp/classes.exp, and "info type foo" doesn't print the
Doug> source location though it should]

Yeah; my view is that since this patch can't hurt anything, if the gcc
changes require gdb changes in turn, it won't matter.

Doug> Ok to check in?

I read through it.  Unfortunately, I don't think I am enough of a
dwarf2read.c expert to approve this.  So, I would appreciate it if
someone more expert could claim it.  Alternatively, if nobody has time
to do this, and they say so, I will learn more and take it on.

One concern I have is whether there is any chance that the
specification will change between now and when DWARF-4 is published.

I do have a few nits.

Doug> +  types_htab = htab_create_alloc_ex (41,
Doug> +				     hash_type_signature,
Doug> +				     eq_type_signature,
Doug> +				     NULL,
Doug> +				     &objfile->objfile_obstack,
Doug> +				     hashtab_obstack_allocate,
Doug> +				     dummy_obstack_deallocate);

This is just a side note -- I've seen a few hash tables allocated on
obstacks.  Doesn't resizing the table waste memory?

Too bad we don't have allocation pools instead of obstacks.  I suppose
in this specific case we could use the objfile data machinery to
deallocate hash tables.

Doug> +  if (dwarf2_die_debug)
Doug> +    {
Doug> +      fprintf_unfiltered (gdb_stdlog, "Signatured types:\n");
Doug> +    }

Over-bracing.  There's a fair amount of this in the patch.

Doug> +  if (this_cu->from_debug_types)
Doug> +    {
Doug> +      /* ??? How come this is for .debug_types only?  */
Doug> +      this_cu->offset = cu.header.offset;
Doug> +      this_cu->length = cu.header.length + cu.header.initial_length_size;

Daniel has asked before for "no new FIXMEs".  You can't escape this by
spelling it "???" :-)

Seriously, I think this is a valid concern and I would like some
definitive resolution to the various "???" comments.

Doug> + NotFound:

Should be "not_found".  There's a couple of these.

Tom


  reply	other threads:[~2009-06-25 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20  0:04 Doug Evans
2009-06-25 19:47 ` Tom Tromey [this message]
2009-06-25 20:28   ` Doug Evans
2009-06-25 20:49     ` Tom Tromey
2009-07-15  1:13       ` Doug Evans
2009-07-15 19:28         ` Tom Tromey
2009-07-16  1:25           ` Doug Evans
2009-07-21  0:10           ` Cary Coutant
2009-06-26  1:33     ` Daniel Jacobowitz
2009-06-26  0:01   ` Cary Coutant
2009-06-26  0:54     ` Doug Evans

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=m3y6rgf656.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=ccoutant@google.com \
    --cc=dje@google.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