From patchwork Thu Feb 26 13:59:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Turney X-Patchwork-Id: 5310 Received: (qmail 47613 invoked by alias); 26 Feb 2015 13:59:27 -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 47596 invoked by uid 89); 26 Feb 2015 13:59:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: out1-smtp.messagingengine.com Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Feb 2015 13:59:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 267D42090F for ; Thu, 26 Feb 2015 08:59:22 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Thu, 26 Feb 2015 08:59:23 -0500 Received: from [192.168.1.102] (unknown [31.51.205.191]) by mail.messagingengine.com (Postfix) with ESMTPA id 7572D680171; Thu, 26 Feb 2015 08:59:22 -0500 (EST) Message-ID: <54EF26B8.8030602@dronecode.org.uk> Date: Thu, 26 Feb 2015 13:59:20 +0000 From: Jon TURNEY User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Retrieve segment registers on Windows amd64 References: <1424435625-3708-1-git-send-email-jon.turney@dronecode.org.uk> <20150226092333.GB31815@adacore.com> In-Reply-To: <20150226092333.GB31815@adacore.com> On 26/02/2015 09:23, Joel Brobecker wrote: > Thanks for the patch. > > The patch looks good to me. > The ChangeLog needs to identify all the changes were made, and in > particular, it needs to mention the fact that CONTEXT_DEBUGGER's > declaration was removed. Thanks for taking a look. Patch with ChangeLog amended as you suggest attached. > Do you have a GDB copyright assignment on file. The patch is small > enough that we can take it as a "tiny patch", but if you have other > patches in the pipeline, then you'll eventually need to fill one out. > Let me know if you'd like to get started on the process, it takes > a few weeks to complete, as I understand it. Hopefully, I will have a few more patches, so yes please. From 38c4a0ebd50cbcb2630d50be633ab1f9c9107100 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-26 Jon TURNEY * windows-nat.c (CONTEXT_DEBUGGER): Remove. (CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. Incorporate flags from CONTEXT_DEBUGGER. --- gdb/windows-nat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 9c2dca1..ec11822 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,8 @@ 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;