aboutsummaryrefslogtreecommitdiff
path: root/gdb/memory-map.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-11-14 16:42:08 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-11-14 16:42:08 -0500
commit074319087452e3a8b1a0e84279a82555dd798d69 (patch)
treee855a1d63d5fc40db713d1378b9f27e7b9c1ed48 /gdb/memory-map.c
parent06bcf5416feae129e239476ab1408e038bba171d (diff)
downloadgdb-074319087452e3a8b1a0e84279a82555dd798d69.zip
gdb-074319087452e3a8b1a0e84279a82555dd798d69.tar.gz
gdb-074319087452e3a8b1a0e84279a82555dd798d69.tar.bz2
Fix mem region parsing regression and add test
In my patch Get rid of VEC (mem_region) a664f67e50eff30198097d51cec0ec4690abb2a1 I introduced a regression, where the length of the memory region is assigned to the "hi" field. It should obviously be computed as "start + length". To my defense, no test had caught this :). As a penance, I wrote one. gdb/ChangeLog: * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add memory-map-selftests.c. (SUBDIR_UNITTESTS_OBS): Add memory-map-selftests.o. * memory-map.c (memory_map_start_memory): Fix computation of hi address. * unittests/memory-map-selftests.c: New file.
Diffstat (limited to 'gdb/memory-map.c')
-rw-r--r--gdb/memory-map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/memory-map.c b/gdb/memory-map.c
index 9582ceb..e098209 100644
--- a/gdb/memory-map.c
+++ b/gdb/memory-map.c
@@ -71,7 +71,7 @@ memory_map_start_memory (struct gdb_xml_parser *parser,
type_p
= (ULONGEST *) xml_find_attribute (attributes, "type")->value;
- data->memory_map->emplace_back (*start_p, *length_p,
+ data->memory_map->emplace_back (*start_p, *start_p + *length_p,
(enum mem_access_mode) *type_p);
}