From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 87P0E3TjwmTF8jAAWB0awg (envelope-from ) for ; Thu, 27 Jul 2023 17:36:52 -0400 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=GlLnS2yA; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4701E1E0C0; Thu, 27 Jul 2023 17:36:52 -0400 (EDT) Received: from server2.sourceware.org (server2.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 341981E00F for ; Thu, 27 Jul 2023 17:36:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4BB8F3858D39 for ; Thu, 27 Jul 2023 21:36:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BB8F3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690493809; bh=S+proPxitzMwSXRkY8qzbNjuxILbLL5+ai2voGLoofo=; 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=GlLnS2yAJ61nswDn4u/Oa2i/W1zZJPdLRgzLfj/YzdtJiLxJfQP6yahlyrV9XuNAO uN+h7pfG5Exus+rvuCBwIAK7RoHeAVGUGbnrIEAjzVL7yz2ykaXhktMMQG+fFM7LP+ He+DWhU13A+IJCXADYQRQ+BNKd0YxUuT/nKf8p70= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7E0383858D37 for ; Thu, 27 Jul 2023 21:36:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E0383858D37 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-JFHwrEwWNJCpUYKmY9pu0Q-1; Thu, 27 Jul 2023 17:36:24 -0400 X-MC-Unique: JFHwrEwWNJCpUYKmY9pu0Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73DAE3C0C882; Thu, 27 Jul 2023 21:36:24 +0000 (UTC) Received: from [10.22.16.32] (unknown [10.22.16.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 326A540C2063; Thu, 27 Jul 2023 21:36:24 +0000 (UTC) Message-ID: <34d98a02-e5ad-5358-ed1c-659144ab5bf1@redhat.com> Date: Thu, 27 Jul 2023 14:36:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 00/15] Handle variable XSAVE layouts To: John Baldwin , gdb-patches@sourceware.org References: <20230714155151.21723-1-jhb@FreeBSD.org> <6a412964-2a25-da39-7c3b-38050437795a@FreeBSD.org> <08cce201-d044-cfcd-4147-6ea1f0eb0fef@FreeBSD.org> <298952cf-d29e-0c58-a89c-3b29f5f9a49a@FreeBSD.org> In-Reply-To: <298952cf-d29e-0c58-a89c-3b29f5f9a49a@FreeBSD.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 7/26/23 15:31, John Baldwin wrote: > > So I have a couple of things to try here.  First, a simple fix for the crash > is this change (relative to the branch), but it does mean the core dumps generated > by gcore for a remote target will not contain extended XSAVE state like AVX, etc.: > > diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c > index c8b467a0416..a7d61f33a08 100644 > --- a/gdb/i386-linux-tdep.c > +++ b/gdb/i386-linux-tdep.c > @@ -768,7 +768,7 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, > >    cb (".reg", 68, 68, &i386_gregset, NULL, cb_data); > > -  if (tdep->xcr0 & X86_XSTATE_AVX) > +  if (tdep->xsave_layout.sizeof_xsave != 0) >      cb (".reg-xstate", tdep->xsave_layout.sizeof_xsave, >         tdep->xsave_layout.sizeof_xsave, &i386_linux_xstateregset, >         "XSAVE extended state", cb_data); > > Arguably that is more correct as it lines up with the way the rest of the x86 arches > in this series. Yeah, that does fix a lot of problems. In the vein of "perfect is the enemy of good," this LGTM. > The other change I have locally is one to generate a "fallback" layout to use in > this case that a target (such as remote) doesn't provide a layout. > > The fallback change: [snip] This causes a new regression in gdb.base/solib-display.exp: # make check RUNTESTFLAGS="--target_board native-extended-gdbserver.exp" \ TESTS=gdb.base/solib-display.exp Running /root/fsf/linux/gdb/testsuite/../../../src/gdb/testsuite/gdb.base/solib-display.exp ... FAIL: gdb.base/solib-display.exp: NO: continue two FAIL: gdb.base/solib-display.exp: IN: continue two FAIL: gdb.base/solib-display.exp: SEP: continue two === gdb Summary === # of expected passes 32 # of unexpected failures 3 The issue is the same with all three failing tests (-m32/-m64 don't matter). With this tweak, we now see: warning: Unable to display "a_local": No symbol "a_local" in current context. warning: Unable to display "a_static": No symbol "a_static" in current context. This disables the display of the two variables, and they are omitted from subsequent displays. [This happens on every x86_64 on which I've tested: Comet Lake, Raptor Lake, and Sapphire Rapids.] Keith