summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2015-05-08 12:32:43 -0700
committerSandra Loosemore <sandra@codesourcery.com>2015-05-08 12:32:43 -0700
commit21e94bd9f0888034c094e02c75d382d75340326c (patch)
tree6988b652ed3e9630d69b1203527caeceae3ff3a4
parentb73c49b7f6691cf1debb14dbce5b3222a7190314 (diff)
downloadbinutils-gdb-21e94bd9f0888034c094e02c75d382d75340326c.tar.gz
Use PTRACE_GETREGSET/SETREGSET in nios2 gdbserver.
2015-05-08 Sandra Loosemore <sandra@codesourcery.com> gdb/gdbserver/ * linux-nios2-low.c: Include elf/common.h. Adjust comments. Remove HAVE_PTRACE_GETREGS conditionals. (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET instead of PTRACE_GETREGS and PTRACE_SETREGS.
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/linux-nios2-low.c11
2 files changed, 11 insertions, 7 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 191c90e8b02..c33f90a10c3 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-08 Sandra Loosemore <sandra@codesourcery.com>
+
+ * linux-nios2-low.c: Include elf/common.h. Adjust comments.
+ Remove HAVE_PTRACE_GETREGS conditionals.
+ (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
+ instead of PTRACE_GETREGS and PTRACE_SETREGS.
+
2015-05-08 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_supports_conditional_breakpoints): New
diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c
index e2fbb8938cd..7bd3c9795d3 100644
--- a/gdb/gdbserver/linux-nios2-low.c
+++ b/gdb/gdbserver/linux-nios2-low.c
@@ -21,6 +21,7 @@
#include "server.h"
#include "linux-low.h"
+#include "elf/common.h"
#include <sys/ptrace.h>
#include <endian.h>
#include "gdb_proc_service.h"
@@ -32,7 +33,7 @@
/* The following definition must agree with the number of registers
defined in "struct user_regs" in GLIBC
- (ports/sysdeps/unix/sysv/linux/nios2/sys/user.h), and also with
+ (sysdeps/unix/sysv/linux/nios2/sys/user.h), and also with
NIOS2_NUM_REGS in GDB proper. */
#define nios2_num_regs 49
@@ -163,8 +164,6 @@ ps_get_thread_area (const struct ps_prochandle *ph,
return PS_OK;
}
-#ifdef HAVE_PTRACE_GETREGS
-
/* Helper functions to collect/supply a single register REGNO. */
static void
@@ -205,14 +204,12 @@ nios2_store_gregset (struct regcache *regcache, const void *buf)
for (i = 0; i < nios2_num_regs; i++)
nios2_supply_register (regcache, i, regset + i);
}
-#endif /* HAVE_PTRACE_GETREGS */
static struct regset_info nios2_regsets[] =
{
-#ifdef HAVE_PTRACE_GETREGS
- { PTRACE_GETREGS, PTRACE_SETREGS, 0, nios2_num_regs * 4, GENERAL_REGS,
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS,
+ nios2_num_regs * 4, GENERAL_REGS,
nios2_fill_gregset, nios2_store_gregset },
-#endif /* HAVE_PTRACE_GETREGS */
{ 0, 0, 0, -1, -1, NULL, NULL }
};