From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24325 invoked by alias); 1 May 2012 23:04:46 -0000 Received: (qmail 24312 invoked by uid 22791); 1 May 2012 23:04:45 -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,T_RP_MATCHES_RCVD 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; Tue, 01 May 2012 23:04:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 23ECE1C627A for ; Tue, 1 May 2012 19:04:31 -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 ybo7bTOGZaqC for ; Tue, 1 May 2012 19:04:31 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E86061C6278 for ; Tue, 1 May 2012 19:04:30 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B01FE145616; Tue, 1 May 2012 16:04:22 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Invalid segment resister value on x86_64-windows Date: Tue, 01 May 2012 23:04:00 -0000 Message-Id: <1335913461-1628-1-git-send-email-brobecker@adacore.com> 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/msg00006.txt.bz2 Hello, One of our customers noticed that GDB was displaying invalid values for the ss & gs register. It's obviously invalid because the value was wider than the registers' size (16 bits). I noticed that the XML files define these register as being 32bit, which I am assuming was an oversight (?). As a result of the 32bit size, GDB was reading the value of these registers as 4 bytes, instead of just 2. On GNU/Linux, I did not check the kernel sources, but it appears that it was harmless, because the extra bytes were always zero. But on some Windows systems, we werent' that lucky. The extra 2 bytes were not null, and thus we ended up with a polluted value. This patch series first regenerates the .c files in features/i386, because I noticed a difference between the current files and the generated version. And the second patch changes the size of all segment registers to match the size found in the various reference manuals. The series was tested on x86_64-linux, standalone and then with gdbserver. I also checked by hand that the new GDB is still able to work with an older GDBserver (thanks to the fact that GDBserver sends the target description to GDB). And I also tested this patch on x86_64-windows, using AdaCore's testsuite.