From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yOqNAlWKUmRLxj0AWB0awg (envelope-from ) for ; Wed, 03 May 2023 12:22:45 -0400 Received: by simark.ca (Postfix, from userid 112) id F032D1E11B; Wed, 3 May 2023 12:22:44 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=X39O/bJU; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9EB371E0D6 for ; Wed, 3 May 2023 12:22:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5435D3858C50 for ; Wed, 3 May 2023 16:22:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5435D3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683130963; bh=2YHVzy87MMvwEei+A4qR6qzqZehVv8Ev+rtzGb8sjN4=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=X39O/bJUw1Z0SbHrqXd8ElDSYf9pfZJZyldy+v/QvH8U+uWY2IqamKILTDECMZpZP LbjI/Ibu7rT+UndKUyN3swPCRt0rMbXmmxWi2GyFBYElS3QaskMI5/JSbmYOcjaUtX pZ5tshd+5bs/TRGcKs/2PKWt8V4U1+cfrPwsywtc= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 1A1963858D28 for ; Wed, 3 May 2023 16:22:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A1963858D28 Received: from [10.0.0.170] (unknown [167.248.160.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 774DA1E0D6; Wed, 3 May 2023 12:22:20 -0400 (EDT) Message-ID: Date: Wed, 3 May 2023 12:22:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v5 02/19] gdb: Store an x86_xsave_layout in i386_gdbarch_tdep. Content-Language: fr To: John Baldwin , gdb-patches@sourceware.org References: <20230427210113.45380-1-jhb@FreeBSD.org> <20230427210113.45380-3-jhb@FreeBSD.org> In-Reply-To: <20230427210113.45380-3-jhb@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 4/27/23 17:00, John Baldwin wrote: > This structure is fetched from the current target in i386_gdbarch_init > via a new "fetch_x86_xsave_layout" target method. I got: Applying: gdb: Store an x86_xsave_layout in i386_gdbarch_tdep. .git/rebase-apply/patch:147: new blank line at EOF. + warning: 1 line adds whitespace errors. > --- > gdb/i386-tdep.c | 19 ++++++++++++++++++- > gdb/i386-tdep.h | 4 ++++ > gdb/target-debug.h | 20 ++++++++++++++++++++ > gdb/target-delegates.c | 27 +++++++++++++++++++++++++++ > gdb/target.c | 6 ++++++ > gdb/target.h | 7 +++++++ > 6 files changed, 82 insertions(+), 1 deletion(-) > > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index 1ab9fc0e87d..43f2ae6c14e 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -8504,8 +8504,24 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > int bnd0_regnum; > int num_bnd_cooked; > > + x86_xsave_layout xsave_layout = target_fetch_x86_xsave_layout (); > + > /* If there is already a candidate, use it. */ > - arches = gdbarch_list_lookup_by_info (arches, &info); > + for (arches = gdbarch_list_lookup_by_info (arches, &info); > + arches != NULL; > + arches = gdbarch_list_lookup_by_info (arches->next, &info)) > + { > + /* Check that the XSAVE layout of ARCHES matches the layout for > + the current target. */ > + i386_gdbarch_tdep *other_tdep > + = gdbarch_tdep (arches->gdbarch); > + > + if (other_tdep->xsave_layout != xsave_layout) > + continue; > + > + break; > + } > + > if (arches != NULL) > return arches->gdbarch; I think that returningd from the loop would be a tiny bit simpler (replacing the break with `return arches->gdbarch`. You could drop this if. Other than that: Approved-By: Simon Marchi Simon