[gdb/symtab] Implement addrmap_mutable_find
Currently addrmap_mutable_find is not implemented:
...
static void *
addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
{
/* Not needed yet. */
internal_error (__FILE__, __LINE__,
_("addrmap_find is not implemented yet "
"for mutable addrmaps"));
}
...
I implemented this because I needed it during debugging, to be able to do:
...
(gdb) p ((dwarf2_psymtab *)addrmap_find (map, addr))->filename
...
before and after a call to addrmap_set_empty.
Since this is not used otherwise, added addrmap unit test.
Build on x86_64-linux, tested by doing:
...
$ gdb -q -batch -ex "maint selftest addrmap"
Running selftest addrmap.
Ran 1 unit tests, 0 failed
...
gdb/ChangeLog:
2021-08-03 Tom de Vries <tdevries@suse.de>
* gdb/addrmap.c (addrmap_mutable_find): Implement
[GDB_SELF_TESTS] (CHECK_ADDRMAP_FIND): New macro.
[GDB_SELF_TESTS] (core_addr, addrmap_foreach_check, test_addrmap)
(_initialize_addrmap): New function.