diff options
author | Tom de Vries <tdevries@suse.de> | 2025-08-23 06:11:41 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-08-23 06:11:41 +0200 |
commit | 20676c004435b93feee78ca37171aa0eb85c5484 (patch) | |
tree | fd16b6e4a04f7b3ad98012bf30929066ff7bb5bd | |
parent | 3c7cd14c1601c7245c867eda798a79305a28eedc (diff) | |
download | binutils-20676c004435b93feee78ca37171aa0eb85c5484.zip binutils-20676c004435b93feee78ca37171aa0eb85c5484.tar.gz binutils-20676c004435b93feee78ca37171aa0eb85c5484.tar.bz2 |
[gdb/symtab] Detect overlapping ranges in create_addrmap_from_gdb_index
In create_addrmap_from_gdb_index, use the return value of
addrmap_mutable::insert_empty to detect overlapping ranges.
Tested on x86_64-linux.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
-rw-r--r-- | gdb/dwarf2/read-gdb-index.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 7db2834..79d19a3 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 |