Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Gerhard Tonn" <TON@de.ibm.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [Patch] Fix multithread debugging problems on s390
Date: Mon, 15 Jul 2002 07:17:00 -0000	[thread overview]
Message-ID: <OF9774FF1B.07D1310A-ONC1256BF7.00312085@de.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2454 bytes --]


Attached is the revised patch. I have made both functions more consistent.

The CR registers are not part of gregsetp but included in the register
cache. They are probably not needed at all, I will cleanup that later, when
I will have got a more detailed understanding of gdb.


diff -urN gdb-5.2/gdb/s390-nat.c gdb-5.2-s390/gdb/s390-nat.c
--- gdb-5.2/gdb/s390-nat.c    Tue Nov  6 23:18:13 2001
+++ gdb-5.2-s390/gdb/s390-nat.c     Mon Jul 15 11:48:10 2002
@@ -273,14 +273,22 @@
 void
 fill_gregset (gregset_t * gregsetp, int regno)
 {
+  int regi;
   greg_t *gregp = (greg_t *) gregsetp;

-  if (regno >= S390_FIRST_CR && regno <= S390_LAST_CR)
-    supply_register (regno, NULL);
-  else if (regno != -1)
-    supply_register (regno, (char *) &gregp[regno]);
-  else
-    supply_gregset (gregsetp);
+  if (regno < 0)
+    {
+      regcache_collect (S390_PSWM_REGNUM, &gregp[S390_PSWM_REGNUM]);
+      regcache_collect (S390_PC_REGNUM, &gregp[S390_PC_REGNUM]);
+      for (regi = 0; regi < S390_NUM_GPRS; regi++)
+        regcache_collect (S390_GP0_REGNUM + regi,
+                   &gregp[S390_GP0_REGNUM + regi]);
+      for (regi = 0; regi < S390_NUM_ACRS; regi++)
+        regcache_collect (S390_FIRST_ACR + regi,
+                   &gregp[S390_FIRST_ACR + regi]);
+    }
+  else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR)
+    regcache_collect (regno, &gregp[regno]);
 }

 /*  Given a pointer to a floating point register set in /proc format
@@ -291,12 +299,18 @@
 void
 fill_fpregset (fpregset_t * fpregsetp, int regno)
 {
-  if (regno == -1)
-    supply_fpregset (fpregsetp);
-  else
-    supply_register (regno,
-                &((char *) fpregsetp)[REGISTER_BYTE (regno) -
-                                REGISTER_BYTE (S390_FPC_REGNUM)]);
+  int regi;
+
+  if (regno < 0)
+    {
+      regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+      for (regi = 0; regi < S390_NUM_FPRS; regi++)
+        regcache_collect (S390_FP0_REGNUM + regi, &fpregsetp->fprs[regi]);
+    }
+  else if (regno == S390_FPC_REGNUM)
+    regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+  else if (regno >= S390_FP0_REGNUM && regno <= S390_FPLAST_REGNUM)
+    regcache_collect (regno, &fpregsetp->fprs[regno - S390_FP0_REGNUM]);
 }




(See attached file: gdb-5.2.1-s390-1.diff)

Regards / Mit freundlichen Gruessen
Gerhard

Gerhard Tonn, Linux for eServer Development, +(49)-7031-16-4716, Lotus
Notes: ton@ibmde,
   Internet: ton@de.ibm.com

[-- Attachment #2: gdb-5.2.1-s390-1.diff --]
[-- Type: application/octet-stream, Size: 1962 bytes --]

diff -urN gdb-5.2/gdb/s390-nat.c gdb-5.2-s390/gdb/s390-nat.c
--- gdb-5.2/gdb/s390-nat.c	Tue Nov  6 23:18:13 2001
+++ gdb-5.2-s390/gdb/s390-nat.c	Mon Jul 15 11:48:10 2002
@@ -273,14 +273,22 @@
 void
 fill_gregset (gregset_t * gregsetp, int regno)
 {
+  int regi;
   greg_t *gregp = (greg_t *) gregsetp;
 
-  if (regno >= S390_FIRST_CR && regno <= S390_LAST_CR)
-    supply_register (regno, NULL);
-  else if (regno != -1)
-    supply_register (regno, (char *) &gregp[regno]);
-  else
-    supply_gregset (gregsetp);
+  if (regno < 0) 
+    {
+      regcache_collect (S390_PSWM_REGNUM, &gregp[S390_PSWM_REGNUM]);
+      regcache_collect (S390_PC_REGNUM, &gregp[S390_PC_REGNUM]);
+      for (regi = 0; regi < S390_NUM_GPRS; regi++)
+        regcache_collect (S390_GP0_REGNUM + regi,
+			  &gregp[S390_GP0_REGNUM + regi]);
+      for (regi = 0; regi < S390_NUM_ACRS; regi++)
+        regcache_collect (S390_FIRST_ACR + regi,
+			  &gregp[S390_FIRST_ACR + regi]);
+    }
+  else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR)
+    regcache_collect (regno, &gregp[regno]);
 }
 
 /*  Given a pointer to a floating point register set in /proc format
@@ -291,12 +299,18 @@
 void
 fill_fpregset (fpregset_t * fpregsetp, int regno)
 {
-  if (regno == -1)
-    supply_fpregset (fpregsetp);
-  else
-    supply_register (regno,
-		     &((char *) fpregsetp)[REGISTER_BYTE (regno) -
-					   REGISTER_BYTE (S390_FPC_REGNUM)]);
+  int regi;
+
+  if (regno < 0) 
+    {
+      regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+      for (regi = 0; regi < S390_NUM_FPRS; regi++)
+        regcache_collect (S390_FP0_REGNUM + regi, &fpregsetp->fprs[regi]);
+    }
+  else if (regno == S390_FPC_REGNUM)
+    regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+  else if (regno >= S390_FP0_REGNUM && regno <= S390_FPLAST_REGNUM)
+    regcache_collect (regno, &fpregsetp->fprs[regno - S390_FP0_REGNUM]);
 }
 
 

             reply	other threads:[~2002-07-15 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15  7:17 Gerhard Tonn [this message]
2002-07-15 10:46 ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2002-07-12  7:57 Gerhard Tonn
2002-07-14 10:40 ` Andrew Cagney

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=OF9774FF1B.07D1310A-ONC1256BF7.00312085@de.ibm.com \
    --to=ton@de.ibm.com \
    --cc=gdb-patches@sources.redhat.com \
    /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