aboutsummaryrefslogtreecommitdiff
path: root/gdb/trad-frame.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-10-08 14:47:33 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2018-10-08 14:47:33 -0700
commit498f740792fe0edd2955c5cee6bb864f60a5b173 (patch)
tree56db02e95c7d485ce96880dfb7069ca6803a4e27 /gdb/trad-frame.h
parent9f6b697b0efd4ba4e2cb21ac17d2b18a23f81abd (diff)
downloadfsf-binutils-gdb-498f740792fe0edd2955c5cee6bb864f60a5b173.zip
fsf-binutils-gdb-498f740792fe0edd2955c5cee6bb864f60a5b173.tar.gz
fsf-binutils-gdb-498f740792fe0edd2955c5cee6bb864f60a5b173.tar.bz2
Add a helper function to trad_frame to support register cache maps.
Currently, signal frame handlers require explicitly coded calls to trad_frame_set_reg_addr() to describe the location of saved registers within a signal frame. This change permits the regcache_map_entry arrays used with regcache::supply_regset and regcache::collect_regset to be used to describe a block of saved registers given an initial address for the register block. Some systems use the same layout for registers in core dump notes, native register sets with ptrace(), and the register contexts saved in signal frames. On these systems, a single register map can now be used to describe the layout of registers in all three places. If a register map entry's size does not match the native size of a register, try to match the semantics used by regcache::transfer_regset. If a register slot is too large, assume that the register's value is stored in the first N bytes and ignore the remaning bytes. If the register slot is smaller than the register, assume the slot holds the low N bytes of the register's value. Read these low N bytes from the target and zero-extend them to generate a register value. While here, document the semantics for both regcache::transfer_regset and trad_frame with respect to register slot's whose size does not match the register's size. gdb/ChangeLog: * regcache.h (struct regcache_map_entry): Note that this type can be used with traditional frame caches. * trad-frame.c (trad_frame_set_reg_regmap): New. * trad-frame.h (trad_frame_set_reg_regmap): New.
Diffstat (limited to 'gdb/trad-frame.h')
-rw-r--r--gdb/trad-frame.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h
index a11a2c2..0d04bf4 100644
--- a/gdb/trad-frame.h
+++ b/gdb/trad-frame.h
@@ -23,6 +23,7 @@
#include "frame.h" /* For "struct frame_id". */
struct frame_info;
+struct regcache_map_entry;
struct trad_frame_cache;
/* A simple, or traditional frame cache.
@@ -45,6 +46,9 @@ void trad_frame_set_reg_realreg (struct trad_frame_cache *this_trad_cache,
int regnum, int realreg);
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);
void trad_frame_set_reg_value (struct trad_frame_cache *this_cache,
int regnum, LONGEST val);