From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28724 invoked by alias); 18 Mar 2002 16:20:01 -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 28611 invoked from network); 18 Mar 2002 16:19:56 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 18 Mar 2002 16:19:56 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16mzrC-0000Pu-00; Mon, 18 Mar 2002 11:19:34 -0500 Date: Mon, 18 Mar 2002 08:20:00 -0000 From: Daniel Jacobowitz To: Greg Alexander Cc: gdb-patches@sources.redhat.com, David Rivers , barrow_dj@yahoo.com Subject: Re: *gregset_t misuse (was Re: S390 GDB patch for Dignus Linux/390 compiler support) Message-ID: <20020318111934.A1499@nevyn.them.org> Mail-Followup-To: Greg Alexander , gdb-patches@sources.redhat.com, David Rivers , barrow_dj@yahoo.com References: <20020315165715.A19306@nevyn.them.org> <200203181558.g2IFwG087850@greg.dignus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200203181558.g2IFwG087850@greg.dignus.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00310.txt.bz2 On Mon, Mar 18, 2002 at 10:58:16AM -0500, Greg Alexander wrote: > I'm having a hard time figuring out how exactly the ps_l{get,set}regs() > and thread_db_{fetch,store}_registers() functions get used, but my > proposal would be for them to use gdb_gregset_t instead of prgregset_t > (so that gdb_gregset_t can be defined to a pointer type if necessary -- > prgregset_t is really an arch-specific type and should only be referenced > inside of arch-aware files). I also propose that fill_gregset() and No. ps_lgetregs is not a gdb-called function. It's called from libthread_db.so, which is provided by the system. Its argument must be a prgregset_t. Therefore prgregset_t must also be a pointer or array type. > It all comes down to the fact that gdb_gregset_t will probably be typedefed > to prgregset_t or prgregset_t*, but never both! Remember what I said? From an i386-linux : /* And the whole bunch of them. We could have used `struct user_regs_struct' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; S/390 needs to do the same thing. It's very hard to compensate for an incorrect prgregset_t, because of some peculiarities in the type system of C w.r.t. arrays and pointer decay. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer