Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed] Fix gcore crashes on s390
@ 2006-05-06  1:18 Ulrich Weigand
  2006-05-06  1:35 ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Ulrich Weigand @ 2006-05-06  1:18 UTC (permalink / raw)
  To: gdb-patches

Hello,

since the switch of gcore to use regset_from_core_section, it
crashes on s390, because the regsets we're providing have a
NULL collect_regset function.  Fixed by the patch below.

Tested on s390-ibm-linux and s390x-ibm-linux.
Committed to mainline.

Bye,
Ulrich

ChangeLog:

	* s390-tdep.c (s390_collect_regset): New function.
	(s390_gregset, s390x_gregset, s390_fpregset): Add it.

Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.153
diff -c -p -r1.153 s390-tdep.c
*** gdb/s390-tdep.c	9 Apr 2006 01:21:15 -0000	1.153
--- gdb/s390-tdep.c	6 May 2006 00:55:38 -0000
*************** s390_supply_regset (const struct regset 
*** 444,462 ****
      }
  }
  
  static const struct regset s390_gregset = {
    s390_regmap_gregset, 
!   s390_supply_regset
  };
  
  static const struct regset s390x_gregset = {
    s390x_regmap_gregset, 
!   s390_supply_regset
  };
  
  static const struct regset s390_fpregset = {
    s390_regmap_fpregset, 
!   s390_supply_regset
  };
  
  /* Return the appropriate register set for the core section identified
--- 444,484 ----
      }
  }
  
+ /* Collect register REGNUM from the register cache REGCACHE and store
+    it in the buffer specified by REGS and LEN as described by the
+    general-purpose register set REGSET.  If REGNUM is -1, do this for
+    all registers in REGSET.  */
+ static void
+ s390_collect_regset (const struct regset *regset,
+ 		     const struct regcache *regcache,
+ 		     int regnum, void *regs, size_t len)
+ {
+   const int *offset = regset->descr;
+   int i;
+ 
+   for (i = 0; i < S390_NUM_REGS; i++)
+     {
+       if ((regnum == i || regnum == -1) && offset[i] != -1)
+ 	regcache_raw_collect (regcache, i, (char *)regs + offset[i]);
+     }
+ }
+ 
  static const struct regset s390_gregset = {
    s390_regmap_gregset, 
!   s390_supply_regset,
!   s390_collect_regset
  };
  
  static const struct regset s390x_gregset = {
    s390x_regmap_gregset, 
!   s390_supply_regset,
!   s390_collect_regset
  };
  
  static const struct regset s390_fpregset = {
    s390_regmap_fpregset, 
!   s390_supply_regset,
!   s390_collect_regset
  };
  
  /* Return the appropriate register set for the core section identified
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-05-06 23:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-06  1:18 [committed] Fix gcore crashes on s390 Ulrich Weigand
2006-05-06  1:35 ` David S. Miller
2006-05-06  1:56   ` Daniel Jacobowitz
2006-05-06  6:30     ` David S. Miller
2006-05-06 15:16       ` Daniel Jacobowitz
2006-05-06  8:31     ` Mark Kettenis
2006-05-06  8:26   ` Mark Kettenis
2006-05-06 15:19     ` Daniel Jacobowitz
2006-05-06 18:29       ` Mark Kettenis
2006-05-06 23:56         ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox