From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13036 invoked by alias); 23 Apr 2003 22:09:37 -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 13029 invoked from network); 23 Apr 2003 22:09:36 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 23 Apr 2003 22:09:36 -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 SAA24110; Wed, 23 Apr 2003 18:08:05 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id SAA26764; Wed, 23 Apr 2003 18:09:36 -0400 Message-ID: <000b01c309e5$098a5f90$0202040a@catdog> From: "Kris Warkentin" To: "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> <0cbf01c309e1$8bb32190$0202040a@catdog> <20030423214740.GA3719@nevyn.them.org> Subject: Re: long long considered harmful? Date: Wed, 23 Apr 2003 22:09: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/msg00276.txt.bz2 > I'd have to see exactly what you meant, but probably not. These things > have to be an exact size, right? Barring wackiness like the 32-bit > char platforms, which I shouldn't have brought into this. So if you > run on a host with 64-bit "int", it will be wrong. It just has to be AT LEAST a certain size. If I have: typedef struct x86_cpu_registers { unsigned edi, esi, ebp, exx, ebx, edx, ecx, eax; unsigned eip, cs, efl; unsigned esp, ss; } X86_CPU_REGISTERS; typedef union _debug_gregs { ARM_CPU_REGISTERS arm; ... X86_CPU_REGISTERS x86; qnx_reg64 padding[1024]; } nto_gregset_t; Then the padding guarantees a minimum size. If I then calculate edi, esi, etc. using char offsets, the way the compiler creates the structure is completely irrelevant. The only reason for the structure is to maintain visible compatability with our system headers. I like your mips fix BTW. I think that I'd rather have the test outside of the loop although it's probably not a huge gain. static void regset_fetch (int endian, unsigned first, unsigned last, qnx_reg64 *data) { int off=endian ? 4 : 0; for (; first <= last; first++) { supply_register (first, (char *) &data[0][off]); data++; } } cheers, Kris