public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add support for threads in vax_bsd_nat_target
@ 2020-03-14 12:54 Kamil Rytarowski
  0 siblings, 0 replies; only message in thread
From: Kamil Rytarowski @ 2020-03-14 12:54 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6227b330d563add042066259e5f933c89a85b3b5

commit 6227b330d563add042066259e5f933c89a85b3b5
Author: Kamil Rytarowski <n54@gmx.com>
Date:   Sat Mar 14 13:38:30 2020 +0100

    Add support for threads in vax_bsd_nat_target
    
    ptrace(2) PT_GETREGS/PT_SETREGS accepts thread id (LWP) as the 4th
    argument for threads.
    
    gdb/ChangeLog:
    
            * vax-bsd-nat.c (vaxbsd_supply_gregset): New variable lwp and pass
            it to the ptrace call.
            * vax-bsd-nat.c (vaxbsd_collect_gregset): Likewise.

Diff:
---
 gdb/ChangeLog     | 9 ++++++++-
 gdb/vax-bsd-nat.c | 8 +++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c148626b332..34212357c84 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,13 @@
 2020-03-14  Kamil Rytarowski  <n54@gmx.com>
 
-	* vax-bsd-nat.c (vaxbsd_supply_gregset): Cast gregs to const gdb_byte *.
+	* vax-bsd-nat.c (vaxbsd_supply_gregset): New variable lwp and pass
+	it to the ptrace call.
+	* vax-bsd-nat.c (vaxbsd_collect_gregset): Likewise.
+
+2020-03-14  Kamil Rytarowski  <n54@gmx.com>
+
+	* vax-bsd-nat.c (vaxbsd_supply_gregset): Cast gregs to const
+	gdb_byte *.
 	* vax-bsd-nat.c (vaxbsd_collect_gregset): Cast gregs to void *.
 
 2020-03-14  Kamil Rytarowski  <n54@gmx.com>
diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c
index 9b1351d9b14..1ca1f7bb1e8 100644
--- a/gdb/vax-bsd-nat.c
+++ b/gdb/vax-bsd-nat.c
@@ -78,8 +78,9 @@ vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 {
   struct reg regs;
   pid_t pid = regcache->ptid ().pid ();
+  int lwp = regcache->ptid ().lwp ();
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, lwp) == -1)
     perror_with_name (_("Couldn't get registers"));
 
   vaxbsd_supply_gregset (regcache, &regs);
@@ -93,13 +94,14 @@ vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
 {
   struct reg regs;
   pid_t pid = regcache->ptid ().pid ();
+  int lwp = regcache->ptid ().lwp ();
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, lwp) == -1)
     perror_with_name (_("Couldn't get registers"));
 
   vaxbsd_collect_gregset (regcache, &regs, regnum);
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, lwp) == -1)
     perror_with_name (_("Couldn't write registers"));
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-14 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-14 12:54 [binutils-gdb] Add support for threads in vax_bsd_nat_target Kamil Rytarowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).