From: John Baldwin Date: Thu, 14 Jul 2022 23:42:43 +0000 (-0700) Subject: trad_frame_set_reg_regmap: Permit a non-zero register base. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7668ed9afb1ee2708dcf9abf254000d25b7d90c;p=thirdparty%2Fbinutils-gdb.git trad_frame_set_reg_regmap: Permit a non-zero register base. Similar to the register base used with regcache::collect/supply_regset, this value is added to the register number in valid register map entries. --- diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c index 9d4f23a851f..fece3461be8 100644 --- a/gdb/trad-frame.c +++ b/gdb/trad-frame.c @@ -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); diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h index 09a8133d362..8e12f30c01a 100644 --- a/gdb/trad-frame.h +++ b/gdb/trad-frame.h @@ -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);