public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Project Archer <archer@sourceware.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: Fedora 14 debug proposal
Date: Tue, 15 Jun 2010 22:26:00 -0000	[thread overview]
Message-ID: <20100615222623.1452440736@magilla.sf.frob.com> (raw)
In-Reply-To: Tom Tromey's message of  Tuesday, 15 June 2010 13:45:53 -0600 <m38w6gulji.fsf@fleche.redhat.com>

> Roland> It should be, yes.  I don't see any reason that .debug_types and
> Roland> DW_FORM_ref_sig8 need to survive final linking.  The normal reference
> Roland> forms are more efficient for consumers to use.
> 
> Why is that?  I looked at the gdb code here and nothing really stood out.

ref_sig8 is a key to match in searching through type units.  (Presumably a
hash table lookup among already-interned units, interning more linearly as
needed.)  The ref forms are direct pointers into the file.  In the case of
ref_addr (the case for any actual sharing/compression), a consumer needs to
figure out which CU it's in and intern that CU (i.e. track at least its
header details, the total of "interning" that libdw does), which is a
similar search and on-demand interning (in libdw this one is a tree-based
search to match the file-offset bounds of the CU).  For a consumer like GDB
that interns at the DIE level, it's presumably a similar lookup (hash table
or btree or whatever) keyed on the file offset to match a DIE previously
interned.  So it is simpler in theory but perhaps a wash in practice.

What might be more important is the space savings.  ref_sig8 itself uses
twice the space of ref_addr.  But beyond that, each referent must get its
own type unit, with space for the unit header, plus duplicates of the
containing DIE structure (levels of namespace, class, etc.).  In contrast,
optimal direct compression needs only as many unit headers (for the
partial_unit or compile_unit) as there are distinct sets of sharing
references.  A shared partial_unit contains many referent DIEs nested in
the single copy of the containing DIE structure, since references to
foo::bar::baz::type1 and foo::bar::baz::type2::innertype3, etc., are all
just direct pointers into different subtrees of the same larger tree.

Anyway, the proof will be in the putative pudding.  When we have
compression working and libdw capable of handling ref_sig8, then it will be
fairly straightforward to try preserving type units and ref_sig8's as they
are (along with partial_unit-based compression of everything else) and
compare that to morphing everything into direct references and compressing
that way.


Thanks,
Roland

      reply	other threads:[~2010-06-15 22:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 20:38 Tom Tromey
2010-06-09 13:54 ` Dodji Seketeli
2010-06-09 16:11   ` Tom Tromey
2010-06-11 20:31     ` Tom Tromey
2010-06-14 10:17       ` Jakub Jelinek
2010-06-11 20:39         ` Tom Tromey
2010-06-11 20:33 ` Tom Tromey
2010-06-13 10:40 ` Roland McGrath
2010-06-14 20:06   ` Tom Tromey
2010-06-15 19:46   ` Tom Tromey
2010-06-15 22:26     ` Roland McGrath [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=20100615222623.1452440736@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=archer@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=tromey@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).