This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/6.7] Enable bi-arch core file generation on s390
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 2 Oct 2007 21:27:35 +0200 (CEST)
- Subject: [commit/6.7] Enable bi-arch core file generation on s390
Hello,
bi-arch generate-core-file (generating 32-bit core files on a 64-bit
system) didn't work on s390, as linux-nat.c always uses the default
gregset size (in this case 64-bit) as input to the regset_from_core_section
call, which the 32-bit s390_regset_from_core_section would reject.
Fixed by relaxing the check in s390_regset_from_core_section. (Note
that on ppc, where bi-arch core file generation works, there is no
size check at all ...) In the future, I guess it might make more sense
to have the gdbarch callback *return* the correct section size, so that
linux-nat.c can allocate the appropriate amount of space ...
Tested on s390-ibm-linux and s390x-ibm-linux.
Committed to mainline and 6.7 branch.
Bye,
Ulrich
ChangeLog:
* s390-tdep.c (s390_regset_from_core_section): Allow excess section
size to enable bi-arch generate-core-file support.
Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.162
diff -c -p -r1.162 s390-tdep.c
*** gdb/s390-tdep.c 23 Aug 2007 18:08:37 -0000 1.162
--- gdb/s390-tdep.c 2 Oct 2007 18:39:14 -0000
*************** s390_regset_from_core_section (struct gd
*** 425,434 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
return tdep->gregset;
! if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
return tdep->fpregset;
return NULL;
--- 425,434 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! if (strcmp (sect_name, ".reg") == 0 && sect_size >= tdep->sizeof_gregset)
return tdep->gregset;
! if (strcmp (sect_name, ".reg2") == 0 && sect_size >= tdep->sizeof_fpregset)
return tdep->fpregset;
return NULL;
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com