From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124916 invoked by alias); 29 Jun 2018 12:32:17 -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 124805 invoked by uid 89); 29 Jun 2018 12:32:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=soul, array_view, pick!, CONTEXT X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Jun 2018 12:32:15 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2E5C401C7E9; Fri, 29 Jun 2018 12:32:13 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66BBD2026D68; Fri, 29 Jun 2018 12:32:13 +0000 (UTC) Subject: Re: [PATCH 2/2] x86_64-windows GDB crash due to fs_base/gs_base registers To: Joel Brobecker References: <1529952947-48942-1-git-send-email-brobecker@adacore.com> <1529952947-48942-3-git-send-email-brobecker@adacore.com> <693520df-0ffd-4486-3066-9ad314bb18ff@redhat.com> <20180626215333.GC8075@adacore.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <194adf0e-fce3-90af-6d07-93fab9e3d71a@redhat.com> Date: Fri, 29 Jun 2018 12:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180626215333.GC8075@adacore.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00713.txt.bz2 On 06/26/2018 10:53 PM, Joel Brobecker wrote: > ... and then decide whether we want to reorganize a bit the way > we get the index of each register in the CONTEXT structure. I would > say that we do want to do something. Perhaps, the path of least > resistance is to just change the mappings structure from a C array > to a gdb::array_view as you suggested. I may have a preference for > the approach I took, but it is a large diff, and it's not clear > whether it's going to be beneficial in the long run... > > You pick! ;-) I'll take care of your comments if you chose the first > patch. I'll send a new one if you prefere the gdb::array_view approach. In all honesty, I'd just leave it alone as is, this sort of array is used for other targets not just Windows (e.g., amd64fbsd64_r_reg_offset, amd64_linux_gregset32_reg_offset). If we went for safety, we likely wouldn't have noticed the unnecessary registers. On the other hand, if we're going for safely, I'm fine with your version too, I don't really mind your way vs array_view. Up to you. I do think that it would be nice if gdbserver is changed in the same way to avoid further divergence (until some brave soul spends time merging gdb's and gdbserver's windows-nat.c and win32-low.c, probably the easiest backends to merge). Thanks, Pedro Alves