This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: S390 GDB patch for Dignus Linux/390 compiler support
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Greg Alexander <greg at dignus dot com>
- Cc: gdb-patches at sources dot redhat dot com, David Rivers <rivers at dignus dot com>,djbarrow at de dot ibm dot com
- Date: Fri, 15 Mar 2002 16:57:15 -0500
- Subject: Re: S390 GDB patch for Dignus Linux/390 compiler support
- References: <200203152111.g2FLBg081102@greg.dignus.com>
No comment on the rest, but...
On Fri, Mar 15, 2002 at 04:11:42PM -0500, Greg Alexander wrote:
>
> There is another issue which concerns me, though, when it comes to
> S390 support. The 5.1.1 sources did not compile for S390
> straight out of the box. There were four similar cases where I
> had to add an ampersand:
> proc-service.c:236 (in ps_lgetregs)
> proc-service.c:253 (in ps_lsetregs)
> thread-db.c:804 (in thread_db_fetch_registers)
> thread-db.c:837 (in thread_db_store_registers)
>
> These are all calls to fill_gregset() or supply_gregset():
> fill_gregset ((gdb_gregset_t *) gregset, -1);
> supply_gregset ((gdb_gregset_t *) gregset);
>
> It turns out, tracing back all the typedefs, that this cast is wrong.
> gregset is of type gdb_gregset_t, so casting it to gdb_gregset_t*
> doesn't make much sense. On the platforms I checked (except S390)
> the first thing these functions do is take their argument and cast
> it back to gdb_gregset_t. So overall it has no effect on the code,
> because gdb_gregset_t is, on most platforms, already a pointer type.
> However, on S390, gdb_gregset_t is a structure type, and the
> fill_gregset() and supply_gregset() (s390-nat.c) functions expect
> a pointer to the structure. The really easy/hacky fix is to add
This is a nonconformance in Linux for the S/390 then. gdb_gregset_t is
an elf_gregset_t on Linux, which -must- be an array type. If it is a
structure, that should be fixed - or at least you should hide it for
GDB by defining GDB_GREGSET_T to an appropriate-size array.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer