]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
trad_frame_set_reg_regmap: Permit a non-zero register base.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 14 Jul 2022 23:42:43 +0000 (16:42 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:43:06 +0000 (16:43 -0700)
Similar to the register base used with
regcache::collect/supply_regset, this value is added to the register
number in valid register map entries.

gdb/trad-frame.c
gdb/trad-frame.h

index 9d4f23a851f9a59dcc5863c9aa98c6fea95f7c36..fece3461be8e8a6aa2db710802a34f08184005d3 100644 (file)
@@ -116,7 +116,7 @@ trad_frame_set_reg_addr (struct trad_frame_cache *this_trad_cache,
 void
 trad_frame_set_reg_regmap (struct trad_frame_cache *this_trad_cache,
                           const struct regcache_map_entry *regmap,
-                          CORE_ADDR addr, size_t size)
+                          CORE_ADDR addr, size_t size, int regbase)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_trad_cache->this_frame);
   int offs = 0, count;
@@ -126,6 +126,9 @@ trad_frame_set_reg_regmap (struct trad_frame_cache *this_trad_cache,
       int regno = regmap->regno;
       int slot_size = regmap->size;
 
+      if (regno != REGCACHE_MAP_SKIP)
+       regno += regbase;
+
       if (slot_size == 0 && regno != REGCACHE_MAP_SKIP)
        slot_size = register_size (gdbarch, regno);
 
index 09a8133d362de958dc48996e212ef4b6afba4a1d..8e12f30c01a3d7f5cf7e6aa01656ea5a4ad181e1 100644 (file)
@@ -48,7 +48,7 @@ void trad_frame_set_reg_addr (struct trad_frame_cache *this_trad_cache,
                              int regnum, CORE_ADDR addr);
 void trad_frame_set_reg_regmap (struct trad_frame_cache *this_trad_cache,
                                const struct regcache_map_entry *regmap,
-                               CORE_ADDR addr, size_t size);
+                               CORE_ADDR addr, size_t size, int regbase = 0);
 void trad_frame_set_reg_value (struct trad_frame_cache *this_cache,
                               int regnum, LONGEST val);