From: Simon Marchi <simark@simark.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/5] [gdb/symtab] Detect overlapping ranges in create_addrmap_from_gdb_index
Date: Fri, 22 Aug 2025 10:57:49 -0400 [thread overview]
Message-ID: <ad47b7e0-4eb5-4a32-b030-163db68ee036@simark.ca> (raw)
In-Reply-To: <20250821133114.24091-4-tdevries@suse.de>
On 8/21/25 9:31 AM, Tom de Vries wrote:
> In create_addrmap_from_gdb_index, use the return value of
> addrmap_mutable::insert_empty to detect overlapping ranges.
>
> Tested on x86_64-linux.
> ---
> gdb/dwarf2/read-gdb-index.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
> index 7db2834f4d3..79d19a3abaa 100644
> --- a/gdb/dwarf2/read-gdb-index.c
> +++ b/gdb/dwarf2/read-gdb-index.c
> @@ -1434,7 +1434,15 @@ create_addrmap_from_gdb_index (dwarf2_per_objfile *per_objfile,
> return false;
> }
>
> - mutable_map.set_empty (lo, hi - 1, index->units[cu_index]);
> + bool full_range_p
> + = mutable_map.set_empty (lo, hi - 1, index->units[cu_index]);
> + if (!full_range_p)
> + {
> + complaint (_(".gdb_index address table has a range (%s - %s) that"
> + " overlaps with an earlier range"),
> + hex_string (lo), hex_string (hi));
> + return false;
> + }
> }
>
> index->index_addrmap
> --
> 2.43.0
>
LGTM.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
next prev parent reply other threads:[~2025-08-22 14:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 13:31 [PATCH v2 0/5] [gdb/symtab] Handle invalid .gdb_index better Tom de Vries
2025-08-21 13:31 ` [PATCH v2 1/5] [gdb/symtab] Bail out of create_addrmap_from_gdb_index on error Tom de Vries
2025-08-21 13:31 ` [PATCH v2 2/5] [gdb] Make addrmap_mutable::insert_empty return bool Tom de Vries
2025-08-22 14:54 ` Simon Marchi
2025-08-22 18:51 ` Tom Tromey
2025-08-23 4:20 ` Tom de Vries
2025-08-23 17:53 ` Simon Marchi
2025-08-29 0:20 ` Tom Tromey
2025-08-29 8:28 ` Tom de Vries
2025-08-21 13:31 ` [PATCH v2 3/5] [gdb/symtab] Detect overlapping ranges in create_addrmap_from_gdb_index Tom de Vries
2025-08-22 14:57 ` Simon Marchi [this message]
2025-08-21 13:31 ` [PATCH v2 4/5] [gdb/symtab] Improve invalid range check " Tom de Vries
2025-08-22 14:56 ` Tom de Vries
2025-08-22 15:17 ` Simon Marchi
2025-08-22 18:53 ` Tom Tromey
2025-08-23 4:33 ` Tom de Vries
2025-08-21 13:31 ` [PATCH v2 5/5] [gdb/symtab] Turn complaints in create_addrmap_from_gdb_index into warnings 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=ad47b7e0-4eb5-4a32-b030-163db68ee036@simark.ca \
--to=simark@simark.ca \
--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