From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [committed] Fix gcore crashes on s390
Date: Sat, 06 May 2006 01:18:00 -0000 [thread overview]
Message-ID: <200605060118.k461IpKO009920@d12av02.megacenter.de.ibm.com> (raw)
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
next reply other threads:[~2006-05-06 1:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-06 1:18 Ulrich Weigand [this message]
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
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=200605060118.k461IpKO009920@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
/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