summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/linux-x86-low.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5e6fb7e105b..dfdbc219b2b 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,12 @@
2016-07-26 Pedro Alves <palves@redhat.com>
+ PR server/20414
+ * linux-x86-low.c (x86_get_pc, x86_set_pc): Use uint64_t instead
+ of unsigned long for 64-bit registers and use uint32_t instead of
+ unsigned int for 32-bit registers.
+
+2016-07-26 Pedro Alves <palves@redhat.com>
+
* linux-x86-low.c (x86_siginfo_fixup): Rename 'native' parameter
to 'ptrace'.
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 4e6dbce6a49..d6b67c1b885 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -427,13 +427,15 @@ x86_get_pc (struct regcache *regcache)
if (use_64bit)
{
- unsigned long pc;
+ uint64_t pc;
+
collect_register_by_name (regcache, "rip", &pc);
return (CORE_ADDR) pc;
}
else
{
- unsigned int pc;
+ uint32_t pc;
+
collect_register_by_name (regcache, "eip", &pc);
return (CORE_ADDR) pc;
}
@@ -446,12 +448,14 @@ x86_set_pc (struct regcache *regcache, CORE_ADDR pc)
if (use_64bit)
{
- unsigned long newpc = pc;
+ uint64_t newpc = pc;
+
supply_register_by_name (regcache, "rip", &newpc);
}
else
{
- unsigned int newpc = pc;
+ uint32_t newpc = pc;
+
supply_register_by_name (regcache, "eip", &newpc);
}
}