From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 00/14] Share DWARF partial symtabs between objfiles
Date: Mon, 24 Feb 2020 02:52:00 -0000 [thread overview]
Message-ID: <8b11c5f6-771f-69b5-c98c-94ced592132f@simark.ca> (raw)
In-Reply-To: <87y2ss5019.fsf@tromey.com>
On 2020-02-23 6:58 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
> Simon> I think it would be more natural and easier to understand to have :
>
> Simon> objfile -> dwarf2 objfile-specific object -> dwarf2 object shared between objfiles
>
> Simon> Many "dwarf2 objfile-specific" objects would point to one "dwarf2 object shared between
> Simon> objfiles", without special tricks. Of course, it's much easier said than done.
>
> Simon> I'd like to know: did you consider this way of doing it and chose not to do it
> Simon> because of the complexity / size of the change? Is the current patchset a stepping
> Simon> stone towards it?
>
> I was afraid of the size of the resulting patch. However, I think
> you're right that this would be better. And, I feel pretty strongly
> that we should be making the DWARF reader less awful, not more.
Yeah, as I already showed you, I started making such a patch (more details
below). I think it's worth doing this work, because in the end it's easier
to follow the code. I find that the dwarf2_enter_objfile approach is
analogous to having to set a "current context" (e.g. call switch_to_thread)
before calling a certain function, which goes against what we are trying
to do in general (for example, trying to change functions to accept a
thread / ptid rather than rely on inferior_ptid).
Since dwarf2_per_cu_data objects become objfile-independent, functions that
need to work on a dwarf2_per_cu_data in an objfile-dependent way then need
to accept an objfile or dwarf2_per_objfile object along with the
dwarf2_per_cu_data. It's a bit tedious, but in the end it forces us to pass
the objfile context all the way from the callers, and it's less likely that
we forget a spot, like we could with dwarf2_enter_objfile, since it would just
not compile.
> Probably the thing to do is reorder the series a little (some patches
> don't depend on this), then redo the "unsharing" patch, and finally
> update the subsequent patches.
>
> A few of these patches (1-3, 5, and 11) could probably go in sooner.
> What do you think of that?
#1 is already in, right?
#2: Yes, sounds like a good cleanup.
#4: Yes, good cleanup.
#3: It's only useful if we end up doing psymtabs sharing, so I would not push
it yet.
#5 and #11: I'm not sure how much of that I end up un-doing in my prototype patch,
swapping the shareable and unshareable parts. And it is also only useful in
the context of psymtab sharing, so I wouldn't push it yet.
I'm currently experimenting with what I suggested above, this is what I have for
now (this will get force-pushed as I progress):
https://github.com/simark/binutils-gdb/commits/share-psymtabs
The status is: I'm based on your patch 9/14 ("Add objfile member to DWARF batons"),
as it aims mainly to replace patch patch 10/14 ("Introduce dwarf2_enter_objfile and
use it") with the architecture I proposed. I see no regression in a simple
"make check" between it and the previous commit. I have yet to apply and adapt the
rest of your series on top of my commit. I would also like to test with the variety
of testsuite boards that Tom de Vries added, since they will test various DWARF
configurations (and I would feel bad if he had to clean up after us again).
Simon
next prev parent reply other threads:[~2020-02-24 2:52 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-15 16:54 Tom Tromey
2020-02-15 16:55 ` [PATCH 10/14] Introduce dwarf2_enter_objfile and use it Tom Tromey
2020-02-18 11:58 ` Luis Machado
2020-02-21 22:54 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 06/14] Add "objfile" parameter to two partial_symtab methods Tom Tromey
2020-02-18 11:26 ` Luis Machado
2020-02-15 16:55 ` [PATCH 07/14] Add dwarf2_per_cu_data::index Tom Tromey
2020-02-18 11:39 ` Luis Machado
2020-02-21 23:36 ` Tom Tromey
2020-02-19 4:36 ` Simon Marchi
2020-02-19 5:31 ` Simon Marchi
2020-02-21 23:41 ` Tom Tromey
2020-02-21 23:41 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 12/14] Fix a memory leak and remove an unused member Tom Tromey
2020-02-15 16:55 ` [PATCH 02/14] Simplify setting of reading_partial_symbols Tom Tromey
2020-02-15 16:55 ` [PATCH 05/14] Introduce dwarf2_unshareable and move die_type_hash Tom Tromey
2020-02-18 11:23 ` Luis Machado
2020-02-19 4:20 ` Simon Marchi
2020-02-21 22:43 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 14/14] Share DWARF partial symtabs Tom Tromey
2020-02-18 12:26 ` Luis Machado
2020-02-21 23:03 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 11/14] Split type_unit_group Tom Tromey
2020-02-18 12:08 ` Luis Machado
2020-02-22 0:40 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 03/14] Introduce dwarf2_per_objfile::obstack Tom Tromey
2020-02-19 4:13 ` Simon Marchi
2020-02-22 0:44 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 08/14] Remove symtab links from dwarf2_psymtab and dwarf2_per_cu_quick_data Tom Tromey
2020-02-18 11:50 ` Luis Machado
2020-02-19 4:47 ` Simon Marchi
2020-02-22 0:38 ` Tom Tromey
2020-02-22 0:36 ` Tom Tromey
2020-02-15 16:55 ` [PATCH 04/14] Convert IS_TYPE_UNIT_GROUP to method Tom Tromey
2020-02-15 16:55 ` [PATCH 09/14] Add objfile member to DWARF batons Tom Tromey
2020-02-15 16:55 ` [PATCH 01/14] Fix latent bug in dwarf2_find_containing_comp_unit Tom Tromey
2020-02-19 3:42 ` Simon Marchi
2020-02-19 14:08 ` Tom Tromey
2020-02-20 0:11 ` Tom Tromey
2020-02-20 0:12 ` Tom Tromey
[not found] ` <3a3f1f39-c715-58ba-06a8-2980afb82c53@simark.ca>
2020-02-20 16:50 ` Tom Tromey
2020-03-07 19:12 ` Christian Biesinger
2020-02-15 16:55 ` [PATCH 13/14] Move signatured_type::type to unshareable object Tom Tromey
2020-02-17 12:31 ` [PATCH 00/14] Share DWARF partial symtabs between objfiles Luis Machado
2020-02-17 16:59 ` Tom Tromey
2020-02-22 21:50 ` Tom de Vries
2020-02-22 22:01 ` Tom Tromey
2020-02-23 2:37 ` Simon Marchi
2020-02-23 23:58 ` Tom Tromey
2020-02-24 2:52 ` Simon Marchi [this message]
2020-02-24 3:07 ` Tom Tromey
2020-02-24 3:22 ` Tom Tromey
2020-02-24 13:42 ` Tom de Vries
2020-02-24 16:00 ` Tom de Vries
2020-02-24 17:29 ` Tom Tromey
2020-02-24 23:15 ` Tom Tromey
2020-02-24 19:18 ` Simon Marchi
2020-02-24 23:20 ` Tom Tromey
2020-02-24 22:48 ` Tom Tromey
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=8b11c5f6-771f-69b5-c98c-94ced592132f@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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