From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Make addrmap const-correct in cooked index
Date: Fri, 27 Jan 2023 16:20:30 -0500 [thread overview]
Message-ID: <993c562b-ff57-771d-f13f-654a85701239@simark.ca> (raw)
In-Reply-To: <87cz6zptg4.fsf@tromey.com>
On 1/27/23 16:18, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
> Simon> -void *
> Simon> +const void *
> Simon> addrmap_fixed::find (CORE_ADDR addr) const
> Simon> {
> Simon> const struct addrmap_transition *bottom = &transitions[0];
>
> Actually, this is going to rely on casting away const in some spots.
>
> For example cooked_index::lookup:
>
> dwarf2_per_cu_data *lookup (CORE_ADDR addr) const
> {
> return (dwarf2_per_cu_data *) m_addrmap->find (addr);
> }
>
> Probably we can't constify dwarf2_per_cu_data all over.
I suppose in this case we can consider that it's the DWARF code that is
broken, and that it knows the risks of casting away the const. But at
least the addrmap code will be correct.
Simon
next prev parent reply other threads:[~2023-01-27 21:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 16:26 Tom Tromey
2023-01-27 19:58 ` Simon Marchi
2023-01-27 21:15 ` Tom Tromey
2023-01-27 21:18 ` Tom Tromey
2023-01-27 21:20 ` Simon Marchi [this message]
2023-01-27 21:26 ` Simon Marchi
2023-01-30 14:15 ` Tom Tromey
2023-01-27 22:00 ` Simon Marchi
2023-01-30 14:26 ` Tom Tromey
2023-01-30 15:22 ` Simon Marchi
2023-01-30 15:29 ` [PATCH v2] " Simon Marchi
2023-01-30 16:54 ` Tom Tromey
2023-01-30 16:55 ` Simon Marchi
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=993c562b-ff57-771d-f13f-654a85701239@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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).