From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9256 invoked by alias); 23 Apr 2015 18:55:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 9245 invoked by uid 89); 23 Apr 2015 18:55:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Apr 2015 18:55:56 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YlMHx-0004M7-3S from Sandra_Loosemore@mentor.com ; Thu, 23 Apr 2015 11:55:53 -0700 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Thu, 23 Apr 2015 11:55:54 -0700 Message-ID: <55393FFE.80009@codesourcery.com> Date: Thu, 23 Apr 2015 18:55:00 -0000 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: , Yao Qi Subject: [patch 2/3, nios2] use PTRACE_GETREGSET/SETREGSET in gdbserver References: <55393E8C.8090804@codesourcery.com> In-Reply-To: <55393E8C.8090804@codesourcery.com> Content-Type: multipart/mixed; boundary="------------090900040006020105050501" X-SW-Source: 2015-04/txt/msg00906.txt.bz2 --------------090900040006020105050501 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 323 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 --------------090900040006020105050501 Content-Type: text/x-log; name="gdb-regset.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-regset.log" Content-length: 275 2015-04-23 Sandra Loosemore 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. --------------090900040006020105050501 Content-Type: text/x-patch; name="gdb-regset.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-regset.patch" Content-length: 1474 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 #include #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 } }; --------------090900040006020105050501--