From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4938 invoked by alias); 25 Jun 2018 18:55:51 -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 4923 invoked by uid 89); 25 Jun 2018 18:55:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=fragile, fs_base, gs_base, choices 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 ESMTP; Mon, 25 Jun 2018 18:55:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 71C65560E1 for ; Mon, 25 Jun 2018 14:55:48 -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 qQjuQRQ6Kiq8 for ; Mon, 25 Jun 2018 14:55:48 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 6233C560DE for ; Mon, 25 Jun 2018 14:55:48 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4233) id 5CE68454; Mon, 25 Jun 2018 14:55:48 -0400 (EDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: x86_64-windows GDB crash due to fs_base/gs_base registers Date: Mon, 25 Jun 2018 18:55:00 -0000 Message-Id: <1529952947-48942-1-git-send-email-brobecker@adacore.com> X-SW-Source: 2018-06/txt/msg00584.txt.bz2 Hello, Here are two patches aimed at fixing a crash in GDB when debugging on native windows targets. The crash only occurs when trying to access the fs_base/gs_base register, but is fairly easy to trigger, as any function call will cause that. "info reg" will also trigger it. When I saw this failure, it made me realize that I found the current code to be quite fragile, and I wasn't surprised once I understood the situation that it eventually lead to this crash. As a result, I decided to implement the register fetch/store code a bit differently. As such, I did the work in two steps, hence the two patches. [PATCH 1/2] Minor reorganization of fetch_registers/store_registers [PATCH 2/2] x86_64-windows GDB crash due to fs_base/gs_base registers Both patches were tested on x86-windows and x86_64-windows, using AdaCore's testsuite. Let me know what you think of the approach and choices taken in those two patches. Thanks! -- Joel