From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17487 invoked by alias); 20 Feb 2015 12:59:34 -0000 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 Received: (qmail 9874 invoked by uid 89); 20 Feb 2015 12:42:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: rgout01.bt.lon5.cpcloud.co.uk Received: from rgout01.bt.lon5.cpcloud.co.uk (HELO rgout01.bt.lon5.cpcloud.co.uk) (65.20.0.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Feb 2015 12:35:26 +0000 X-OWM-Source-IP: 86.179.113.106(GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090202.54E729F8.00B2,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=27/50,refid=2.7.2:2015.2.19.82124:17:27.888,ip=86.179.113.106,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __SUBJ_ALPHA_END, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, __LINES_OF_YELLING, BODY_SIZE_1700_1799, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[106.113.179.86.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_2000_LESS, BODY_SIZE_7000_LESS X-CTCH-Spam: Unknown Received: from localhost.localdomain (86.179.113.106) by rgout01.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as jonturney@btinternet.com) id 54E309F50071C36E; Fri, 20 Feb 2015 12:35:04 +0000 From: Jon TURNEY To: gdb-patches@sourceware.org Cc: Jon TURNEY Subject: [PATCH] Retrieve segment registers on Windows amd64 Date: Fri, 20 Feb 2015 12:59:00 -0000 Message-Id: <1424435625-3708-1-git-send-email-jon.turney@dronecode.org.uk> X-SW-Source: 2015-02/txt/msg00597.txt.bz2 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-19 Jon TURNEY * windows-nat.c (CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. --- 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; -- 2.1.4