Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [WIP] New dwarf2 reader - updated 07-02-2001
Date: Mon, 30 Jul 2001 17:07:00 -0000	[thread overview]
Message-ID: <npn15m7yfi.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <878zi7dymh.fsf@cgsoftware.com>

(I moved last week; finally have time to look at the new reader.)

Here are some questions that came to mind on first reading.  I haven't
read everything thoroughly yet, so I could well be just
misunderstanding what's going on.

- MD5 generates a 128-bit checksum.  Any reason you only use the first
  32 bits in your hash?  It looks like checksum_die and
  checksum_partial_die both cut it off at eight digits.

- Why are you using a splay tree keyed by MD5 hash values, instead of
  a hash table?  The only advantage of a splay over a hash table is
  ordered retrieval, but your keys don't have any meaningful order.

- By using the MD5 checksum as your search key, you're guaranteed to
  lose if you get an MD5 collision.  I agree that a collision is very
  unlikely (or would be, if you were using all 128 bits), but it seems
  icky.

- Assuming MD5 is perfect, you don't checksum all attribute forms
  (DW_FORM_flag, for example).  This means that you can get false
  duplicates, if two dies differ only in (say) a flag's value.  How is
  read_comp_unit_dies set up to tolerate that?

- You never clear dwarf2_symbol_splay.  This might be okay if you
  checksummed the complete contents of the die (I'm not sure about
  that), but you don't include block contents in the checksum ---
  process_attribute includes the pointer to the `struct dwarf2_block'
  in the checksum, not the block's actual contents.  So if we have two
  dies which differ only in their block contents, and the `struct
  dwarf2_block' objects which hold those contents happen to get
  allocated at the same address, by different calls to
  dwarf2_psymtab_to_symtab, you'll get a false match again.

- In read_comp_unit_dies, when you find a duplicate die, you skip to
  its sibling.  What if the parent die is identical, but the children
  dies differ?

Can you set me straight on this stuff?


  parent reply	other threads:[~2001-07-30 17:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-02 10:34 Daniel Berlin
2001-07-02 10:56 ` Daniel Berlin
2001-07-30 17:07 ` Jim Blandy [this message]
2001-07-30 23:06   ` Daniel Berlin
2001-07-31 13:35     ` Jim Blandy
2001-07-31 13:45       ` Daniel Berlin
2001-07-31 16:11         ` Jim Blandy
2001-07-31 16:31           ` Daniel Berlin
2001-07-31 15:16 David B Anderson
2001-07-31 23:13 ` Daniel Berlin

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=npn15m7yfi.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=dan@cgsoftware.com \
    --cc=gdb-patches@sources.redhat.com \
    /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