From: Tom Tromey <tom@tromey.com>
To: tdevries via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, tdevries <tdevries@suse.de>
Subject: Re: [PATCH] Add initializers to comp_unit_head
Date: Sun, 25 Dec 2022 08:33:19 -0700 [thread overview]
Message-ID: <87sfh3cxc0.fsf@tromey.com> (raw)
In-Reply-To: <71d0815665fb2b2c4904264b023840d1@suse.de> (tdevries via Gdb-patches's message of "Sun, 25 Dec 2022 08:06:53 +0000")
>>>>> tdevries via Gdb-patches <gdb-patches@sourceware.org> writes:
> FWIW, I've rebased the patch attached to the PR on your patch, and I'm
> left with the patch below, which makes the length field of
> comp_unit_head private.
> /* Return the total length of the CU described by this header. */
> - unsigned int get_length () const
> + unsigned int get_length (bool include_initial = true) const
> {
> - return initial_length_size + length;
> + unsigned int res = m_length;
> + if (include_initial)
> + res += initial_length_size;
> + return res;
I think that since the callers all statically decide which length they
want, there should probably just be two methods with different names.
Tom
next prev parent reply other threads:[~2022-12-25 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 22:44 Tom Tromey
2022-12-25 8:06 ` tdevries
2022-12-25 15:33 ` Tom Tromey [this message]
2022-12-25 17:56 ` tdevries
2022-12-26 17:59 ` Tom Tromey
2022-12-30 12:58 ` [pushed] [gdb/symtab] Make comp_unit_head.length private Tom de Vries
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=87sfh3cxc0.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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).