From: Sandra Loosemore <sandra@codesourcery.com>
To: <gdb-patches@sourceware.org>, Yao Qi <yao.qi@linaro.org>
Subject: [patch 2/3, nios2] use PTRACE_GETREGSET/SETREGSET in gdbserver
Date: Thu, 23 Apr 2015 18:55:00 -0000 [thread overview]
Message-ID: <55393FFE.80009@codesourcery.com> (raw)
In-Reply-To: <55393E8C.8090804@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
When glibc support for nios2 was submitted upstream, we were asked to
change the ptrace register query interface from
PTRACE_GETREGS/PTRACE_SETREGS to PTRACE_GETREGSET/PTRACE_SETREGSET.
This patch makes the corresponding change to gdbserver (there is no
native GDB support for this target yet).
OK to commit?
-Sandra
[-- Attachment #2: gdb-regset.log --]
[-- Type: text/x-log, Size: 275 bytes --]
2015-04-23 Sandra Loosemore <sandra@codesourcery.com>
gdb/gdbserver/
* linux-nios2-low.c: Adjust includes and comments. Remove
HAVE_PTRACE_GETREGS conditionals.
(nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
instead of PTRACE_GETREGS and PTRACE_SETREGS.
[-- Attachment #3: gdb-regset.patch --]
[-- Type: text/x-patch, Size: 1474 bytes --]
diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c
index e2fbb89..7bd3c97 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 }
};
next prev parent reply other threads:[~2015-04-23 18:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 18:49 [patch 0/3, nios2] unbreak nios2-linux-gnu GDB Sandra Loosemore
2015-04-23 18:53 ` [patch 1/3, nios2] revert to using "trap 31" for breakpoints Sandra Loosemore
2015-04-28 11:18 ` Yao Qi
2015-04-23 18:55 ` Sandra Loosemore [this message]
2015-04-28 11:29 ` [patch 2/3, nios2] use PTRACE_GETREGSET/SETREGSET in gdbserver Yao Qi
2015-04-28 11:31 ` Pedro Alves
2015-04-28 15:27 ` Sandra Loosemore
2015-04-23 19:01 ` [patch 3/3, nios2] fixes for new implementation of signal handler trampolines Sandra Loosemore
2015-04-23 19:11 ` Sandra Loosemore
2015-04-28 12:11 ` Yao Qi
2015-04-28 15:47 ` Sandra Loosemore
2015-04-28 11:15 ` [patch 0/3, nios2] unbreak nios2-linux-gnu GDB Yao Qi
2015-04-28 15:14 ` Sandra Loosemore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55393FFE.80009@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=yao.qi@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox