From: Jakub Jelinek <jakub@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: dwz@sourceware.org
Subject: Re: [PATCH 1/4] Calculate size and write correct DWARF5 header
Date: Fri, 25 Sep 2020 18:39:36 +0200 [thread overview]
Message-ID: <20200925163936.GA2176@tucnak> (raw)
In-Reply-To: <0cad96489340d16298a27c8e9971606e6c53084a.camel@klomp.org>
On Fri, Sep 25, 2020 at 06:35:43PM +0200, Mark Wielaard wrote:
> > > - unsigned int headersz = cu->cu_kind == CU_TYPES ? 23 : 11;
> > > + unsigned int headersz = (cu->cu_kind == CU_TYPES
> > > + ? 23 : (cu->cu_version >= 5 ? 12 : 11));
> >
> > Is the DWARF 5 .debug_info types header also 23 bytes long?
>
> DW_UT_type units are length (4) + version (2) + unit_type (1) +
> ptr_size (1) + abbrev_off (4) + signature (8) + type_off (4) = 28 bytes
> long. But we don't support those yet. When we do we need to distinguish
> between CU_TYPES_4 and CU_TYPES_5 because they can be both present.
>
> For my first pass of adding DWARF5 support I was not planning on doing
> CU_TYPES_5 because as far as I know nothing produces it at the moment.
> But it shouldn't be too hard to add it at the same level that dwz
> supports CU_TYPES_4.
>
> Is the patch (with the above fix) as attached for just compile and
> partial DWARF5 unit headers OK for now?
Ok, thanks.
> From c2cf77e0cdf05611bb0aa6ee6261acb13dff5634 Mon Sep 17 00:00:00 2001
> From: Mark Wielaard <mark@klomp.org>
> Date: Wed, 23 Sep 2020 01:48:39 +0200
> Subject: [PATCH] Calculate size and write correct DWARF5 compile and partial
> unit headers.
>
> * dwz.c (try_debug_info): Add header size check for cu_version 5.
> (read_debug_info): Likewise.
> (partition_dups_1): Add 1 to pu_size for cu_version 5.
> (create_import_tree): Include header_size, 13 or 14 depending on
> cu_version, in cost comparision.
> (compute_abbrevs): Adjust headersz depending on cu_version.
> (recompute_abbrevs): Likewise.
> (write_info): Write cu_version 5 unit type.
Jakub
next prev parent reply other threads:[~2020-09-25 16:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 16:25 Read and write DWARF5 units and forms Mark Wielaard
2020-09-24 16:25 ` [PATCH 1/4] Calculate size and write correct DWARF5 header Mark Wielaard
2020-09-24 19:39 ` Jakub Jelinek
2020-09-25 16:35 ` Mark Wielaard
2020-09-25 16:39 ` Jakub Jelinek [this message]
2020-09-24 16:25 ` [PATCH 2/4] Handle DW_FORM_data16 Mark Wielaard
2020-09-24 19:43 ` Jakub Jelinek
2020-09-24 21:53 ` Jakub Jelinek
2020-09-25 16:42 ` Mark Wielaard
2020-09-24 16:25 ` [PATCH 3/4] Handle DW_FORM_line_strp by not moving DIE Mark Wielaard
2020-09-24 19:45 ` Jakub Jelinek
2020-09-24 16:25 ` [PATCH 4/4] Handle DW_FORM_implicit_const [experiment] Mark Wielaard
2020-09-24 19:57 ` Jakub Jelinek
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=20200925163936.GA2176@tucnak \
--to=jakub@redhat.com \
--cc=dwz@sourceware.org \
--cc=mark@klomp.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).