Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Greg Alexander <greg@dignus.com>
Cc: gdb-patches@sources.redhat.com, David Rivers <rivers@dignus.com>,
	djbarrow@de.ibm.com
Subject: Re: S390 GDB patch for Dignus Linux/390 compiler support
Date: Fri, 15 Mar 2002 13:57:00 -0000	[thread overview]
Message-ID: <20020315165715.A19306@nevyn.them.org> (raw)
In-Reply-To: <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


  reply	other threads:[~2002-03-15 21:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 13:11 Greg Alexander
2002-03-15 13:57 ` Daniel Jacobowitz [this message]
2002-03-18  7:58   ` *gregset_t misuse (was Re: S390 GDB patch for Dignus Linux/390 compiler support) Greg Alexander
2002-03-18  8:20     ` Daniel Jacobowitz
2002-03-22 12:14     ` Michael Snyder
2002-04-07  9:28 ` S390 GDB patch for Dignus Linux/390 compiler support Andrew Cagney

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=20020315165715.A19306@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=djbarrow@de.ibm.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=greg@dignus.com \
    --cc=rivers@dignus.com \
    /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