From: Tom Tromey <tom@tromey.com>
To: Caroline Tice via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>,
Caroline Tice <cmtice@google.com>,
Eric Christopher <echristo@google.com>,
Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH, v3] Add code for processing version 5 DWP files (for use with DWARF v5)
Date: Wed, 05 Aug 2020 14:14:47 -0600 [thread overview]
Message-ID: <873650onns.fsf@tromey.com> (raw)
In-Reply-To: <CABtf2+QfcdYt0B7pm7x9=s-VKQcHMCXN2qcgdKScdbrS1M4OgA@mail.gmail.com> (Caroline Tice via Gdb-patches's message of "Wed, 29 Jul 2020 14:05:03 -0700")
>>>>> "Caroline" == Caroline Tice via Gdb-patches <gdb-patches@sourceware.org> writes:
Caroline> The changes to include/dwarf2.h were accepted by binutils and have
Caroline> gone in, so I've removed those changes from this patch.
Thank you for the patch.
I read it and I have a few minor nits, plus one actual bug.
Caroline> - if (version == 2)
Caroline> + if ((version == 2) || (version == 5))
Please remove the extra parentheses on this line.
Caroline> + else // version == 5
gdb still only uses /* */-style comments.
Caroline> + int i;
This should be local to the for loop:
Caroline> + for (i = 0; i < nr_columns; ++i)
... for (int i = ...)
Caroline> + htab->section_pool.v5.sizes =
Caroline> + htab->section_pool.v5.offsets + (sizeof (uint32_t)
The '=' should go at the start of the second line here.
Caroline> +static struct dwo_unit *
Caroline> +create_dwo_unit_in_dwp_v5 (struct dwarf2_per_objfile *dwarf2_per_objfile,
Caroline> + struct dwp_file *dwp_file,
Caroline> + uint32_t unit_index,
Caroline> + const char *comp_dir,
Caroline> + ULONGEST signature, int is_debug_types)
Caroline> +{
...
Caroline> + const struct dwp_hash_table *dwp_htab =
Caroline> + is_debug_types ? dwp_file->tus : dwp_file->cus;
'=' on the wrong line.
Caroline> + int i;
This should also be in the 'for' loop below.
Caroline> + memset (§ions, 0, sizeof (sections));
Can this just be
struct virtual_v2_or_v5_dwo_sections sections {};
?
gdb is moving more to a C++-y style where variables are declared near
their first use.
Caroline> + dwo_file->dwo_name = obstack_strdup (&objfile->objfile_obstack,
Caroline> + virtual_dwo_name);
Here we use objfile::intern now instead. This matters because it puts
the string into the per-BFD object rather than the objfile obstack, so
that sharing works correctly. I suspect this approach could cause
crashes in some multi-inferior scenarios.
Caroline> + dwo_unit = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwo_unit);
These were also moved to the per-BFD obstack during the big sharing
series. The other site doing this now looks like:
dwo_unit = OBSTACK_ZALLOC (&per_objfile->per_bfd->obstack, struct dwo_unit);
Caroline> + dwo_unit->section =
Caroline> + XOBNEW (&objfile->objfile_obstack, struct dwarf2_section_info);
Likewise.
Caroline> + else // version == 5
Comment style.
Tom
next prev parent reply other threads:[~2020-08-05 20:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 4:06 [PATCH, v1] " Caroline Tice
2020-07-22 13:04 ` Simon Marchi
2020-07-28 19:22 ` [PATCH, v2] " Caroline Tice
2020-07-29 21:05 ` [PATCH, v3] " Caroline Tice
2020-08-05 15:57 ` Caroline Tice
2020-08-05 20:14 ` Tom Tromey [this message]
2020-08-06 17:58 ` [PATCH, v4] " Caroline Tice
2020-08-06 19:25 ` 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=873650onns.fsf@tromey.com \
--to=tom@tromey.com \
--cc=cmtice@google.com \
--cc=echristo@google.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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