From patchwork Fri Feb 27 08:49:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 5334 Received: (qmail 17894 invoked by alias); 27 Feb 2015 08:49:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17885 invoked by uid 89); 27 Feb 2015 08:49:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 27 Feb 2015 08:49:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5A39E1163AD; Fri, 27 Feb 2015 03:49:47 -0500 (EST) 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 E6Z5MyqP2mS9; Fri, 27 Feb 2015 03:49:47 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2C539116371; Fri, 27 Feb 2015 03:49:47 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id D5AFF40EAD; Fri, 27 Feb 2015 09:49:45 +0100 (CET) Date: Fri, 27 Feb 2015 09:49:45 +0100 From: Joel Brobecker To: Jon TURNEY Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Retrieve segment registers on Windows amd64 Message-ID: <20150227084945.GG31815@adacore.com> References: <1424435625-3708-1-git-send-email-jon.turney@dronecode.org.uk> <20150226092333.GB31815@adacore.com> <54EF26B8.8030602@dronecode.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54EF26B8.8030602@dronecode.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) > Thanks for taking a look. > > Patch with ChangeLog amended as you suggest attached. Excellent. Checked in with a small adjustment, as I noticed that one of the lines ended up being too long, and I missed that during the first review (I was more worried about the portability across Windows versions)... Attached is what I just pushed. > Hopefully, I will have a few more patches, so yes please. I'll send it to you privately. From f0666312fd86272e0234d5f7c92d8f65d5c6505e Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 18 Feb 2015 23:13:47 +0000 Subject: [PATCH] Retrieve segment registers on Windows amd64 For amd64, CONTEXT_FULL does not contain CONTEXT_SEGMENTS, which seems to be needed to retrieve all the segment registers. Add it explicitly, with a little de-cruftification. The value of the segment registers isn't terribly useful on amd64, but at least this makes the output of 'info registers' correct. Before: (gdb) i r cs ss ds es fs gs cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 After: (gdb) i r cs ss ds es fs gs cs 0x33 51 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x53 83 gs 0x2b 43 gdb/ChangeLog 2015-02-27 Jon TURNEY * windows-nat.c (CONTEXT_DEBUGGER): Remove. (CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. Incorporate flags from CONTEXT_DEBUGGER. --- gdb/ChangeLog | 6 ++++++ gdb/windows-nat.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fac8b37..ff0e72d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2015-02-27 Jon TURNEY + + * windows-nat.c (CONTEXT_DEBUGGER): Remove. + (CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. Incorporate flags + from CONTEXT_DEBUGGER. + 2015-02-26 Doug Evans * gdbtypes.c (internal_type_vptr_fieldno): Add missing call to diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 9c2dca1..107bdf2 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -130,7 +130,6 @@ static CONTEXT saved_context; /* Containes the saved context from a enum { FLAG_TRACE_BIT = 0x100, - CONTEXT_DEBUGGER = (CONTEXT_FULL | CONTEXT_FLOATING_POINT) }; #endif @@ -140,8 +139,9 @@ enum #define CONTEXT_EXTENDED_REGISTERS 0 #endif -#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \ - | CONTEXT_EXTENDED_REGISTERS +#define CONTEXT_DEBUGGER_DR CONTEXT_FULL | CONTEXT_FLOATING_POINT \ + | CONTEXT_SEGMENTS | CONTEXT_DEBUG_REGISTERS \ + | CONTEXT_EXTENDED_REGISTERS static uintptr_t dr[8]; static int debug_registers_changed; -- 1.9.1