From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31960 invoked by alias); 15 Mar 2002 21:57:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31874 invoked from network); 15 Mar 2002 21:57:24 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 15 Mar 2002 21:57:24 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16lzhL-00053q-00; Fri, 15 Mar 2002 16:57:15 -0500 Date: Fri, 15 Mar 2002 13:57:00 -0000 From: Daniel Jacobowitz To: Greg Alexander Cc: gdb-patches@sources.redhat.com, David Rivers , djbarrow@de.ibm.com Subject: Re: S390 GDB patch for Dignus Linux/390 compiler support Message-ID: <20020315165715.A19306@nevyn.them.org> Mail-Followup-To: Greg Alexander , gdb-patches@sources.redhat.com, David Rivers , djbarrow@de.ibm.com References: <200203152111.g2FLBg081102@greg.dignus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200203152111.g2FLBg081102@greg.dignus.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00248.txt.bz2 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