From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13747 invoked by alias); 2 May 2012 21:26:48 -0000 Received: (qmail 13735 invoked by uid 22791); 2 May 2012 21:26:47 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 May 2012 21:26:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 466CE1C69D6; Wed, 2 May 2012 17:26:23 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yAZResDi-GUE; Wed, 2 May 2012 17:26:23 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0AFDC1C69C8; Wed, 2 May 2012 17:26:23 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DBD39145616; Wed, 2 May 2012 14:26:12 -0700 (PDT) Date: Wed, 02 May 2012 21:26:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: Invalid segment resister value on x86_64-windows Message-ID: <20120502212612.GB15555@adacore.com> References: <1335913461-1628-1-git-send-email-brobecker@adacore.com> <201205021009.q42A9G4s021744@glazunov.sibelius.xs4all.nl> <20120502175724.GW10958@adacore.com> <201205022044.q42KiQLc021611@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201205022044.q42KiQLc021611@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00032.txt.bz2 > Hmm, it should be possible to do this without changing any of the > -tdep.c code, but if you prefer to do it this way, can you rename the > new field into cs_regnum, change the comment into "Register number for > %cs", and move it somewhere around the other _regnum variables that > are already part of the struct? That makes things a bit more > consistent. If you prefer, I can do something similar to what we do to handle the register mapping. Attached is a patch that does that, and only touches windows *-nat code. Untested for now; will test and add a ChangeLog if this is your prefered approach. This can be simplified a little further and have everything done in windows-nat.c, but it would probably be considered uglier: include "i386-tdep.h" and "amd64-tdep.h" in windows-nat.c, and then have a quick check to determine which platform we are, and then set then implement the segment_register_p function using either a check on sizeof (void *), or a #ifdef [...] #else [...]... -- Joel