aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/win32-arm-low.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-08 14:33:35 -0600
committerTom Tromey <tromey@adacore.com>2020-04-08 14:47:59 -0600
commitd6225aff7a4f11c3443515c0d8dad12351b97575 (patch)
tree15a0f1a7bd457f0e21a3a2f55d5c36d79c233638 /gdbserver/win32-arm-low.cc
parent71fbdbafe07a4edb2ac88705e03e2cb14b3c77da (diff)
downloadgdb-d6225aff7a4f11c3443515c0d8dad12351b97575.zip
gdb-d6225aff7a4f11c3443515c0d8dad12351b97575.tar.gz
gdb-d6225aff7a4f11c3443515c0d8dad12351b97575.tar.bz2
Add read_pc / write_pc support to win32-low
This changes win32-low.c to implement the read_pc and write_pc methods. A subsequent patch will need these. Note that I have no way to test, or even compile, the win32-arm-low.c change. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (win32_process_target::read_pc) (win32_process_target::write_pc): Declare. * win32-low.c (win32_process_target::read_pc) (win32_process_target::write_pc): New methods. * win32-i386-low.c (i386_win32_get_pc, i386_win32_set_pc): New functions. (the_low_target): Update. * win32-arm-low.c (arm_win32_get_pc, arm_win32_set_pc): New functions. (the_low_target): Update.
Diffstat (limited to 'gdbserver/win32-arm-low.cc')
-rw-r--r--gdbserver/win32-arm-low.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdbserver/win32-arm-low.cc b/gdbserver/win32-arm-low.cc
index 78b7fd0..7720011 100644
--- a/gdbserver/win32-arm-low.cc
+++ b/gdbserver/win32-arm-low.cc
@@ -115,6 +115,27 @@ arm_arch_setup (void)
static const unsigned long arm_wince_breakpoint = 0xe6000010;
#define arm_wince_breakpoint_len 4
+/* Implement win32_target_ops "get_pc" method. */
+
+static CORE_ADDR
+arm_win32_get_pc (struct regcache *regcache)
+{
+ uint32_t pc;
+
+ collect_register_by_name (regcache, "pc", &pc);
+ return (CORE_ADDR) pc;
+}
+
+/* Implement win32_target_ops "set_pc" method. */
+
+static void
+arm_win32_set_pc (struct regcache *regcache, CORE_ADDR pc)
+{
+ uint32_t newpc = pc;
+
+ supply_register_by_name (regcache, "pc", &newpc);
+}
+
struct win32_target_ops the_low_target = {
arm_arch_setup,
sizeof (mappings) / sizeof (mappings[0]),
@@ -127,6 +148,8 @@ struct win32_target_ops the_low_target = {
NULL, /* single_step */
(const unsigned char *) &arm_wince_breakpoint,
arm_wince_breakpoint_len,
+ arm_win32_get_pc,
+ arm_win32_set_pc,
/* Watchpoint related functions. See target.h for comments. */
NULL, /* supports_z_point_type */
NULL, /* insert_point */