From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17125 invoked by alias); 23 Apr 2003 21:44:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 17072 invoked from network); 23 Apr 2003 21:44:37 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 23 Apr 2003 21:44:37 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3p2/8.9.3) with ESMTP id RAA22859; Wed, 23 Apr 2003 17:43:05 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id RAA09291; Wed, 23 Apr 2003 17:44:36 -0400 Message-ID: <0cbf01c309e1$8bb32190$0202040a@catdog> From: "Kris Warkentin" To: "Kris Warkentin" , "Daniel Jacobowitz" Cc: References: <076701c308f6$2f017eb0$0202040a@catdog> <20030422174522.GA728@nevyn.them.org> <080801c30903$2dc0ae60$0202040a@catdog> <081f01c30904$ea5b7f90$0202040a@catdog> <20030422193013.GA25488@nevyn.them.org> <096e01c3099d$ba1f3a30$0202040a@catdog> <20030423211716.GA25678@nevyn.them.org> <0ca901c309de$a262f5d0$0202040a@catdog> Subject: Re: long long considered harmful? Date: Wed, 23 Apr 2003 21:44:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-04/txt/msg00274.txt.bz2 Inquiry: All of our register structures in debug.h are unioned with basic arrays guaranteed to be of sufficient size for storage. Would it be acceptable to leave the structures with all the registers in them so that others can look and see how things are structured in Neutrino as long as the -nto-tdep.c files do what I do below with the offsets? That way debug.h still matches our system headers but there is no code actually relying on how the compiler organizes those structures. Kris > > Was that really so hard? And it's a lot clearer. > > Well, it's not really that hard. I'm just being grumpy because it's snowing > outside and I really want to get this stuff committed one of these days. > I'd already done that to our i386 stuff both to remove the dependency on the > structure and to account for our weird ordering of registers. See snippet > below: > > Kris > > /* Why 13? Look in our debug.h header at the x86_cpu_registers structure > and you'll see an 'exx' junk register that is just filler. Don't ask > me, ask the kernel guys. */ > #define NUM_GPREGS 13 > > /* Map a GDB register number to an offset in the reg structure. */ > static int regmap[] = { > (7 * 4), /* %eax */ > (6 * 4), /* %ecx */ > (5 * 4), /* %edx */ > (4 * 4), /* %ebx */ > (11 * 4), /* %esp */ > (2 * 4), /* %epb */ > (1 * 4), /* %esi */ > (0 * 4), /* %edi */ > (8 * 4), /* %eip */ > (10 * 4), /* %eflags */ > (9 * 4), /* %cs */ > (12 * 4), /* %ss */ > (-1 * 4) /* filler */ > }; > > /* Perform mapping of gdb registers onto Neutrino registers. > Actually works in reverse too which is why we make sure to > return -1 if we're out of range. */ > int > gdb_to_os (int regno) > { > return (regno >= 0 && regno < NUM_GPREGS) ? regmap[regno] >> 2 : -1; > } > > void > nto_supply_gregset (char *gpregs) > { > unsigned regno; > > for (regno = 0; regno < NUM_GPREGS - 1; regno++) > { > supply_register (regno, gpregs + regmap[regno]); > } > } > > >