This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix multithread debugging problems on s390


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: gdb-5.2.1-s390-1.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]