From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 6E2093858CDA for ; Fri, 28 Jul 2023 16:35:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E2093858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4RCCsn0DdSz4GfL; Fri, 28 Jul 2023 16:35:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RCCsm6Ws8z3mK0; Fri, 28 Jul 2023 16:35:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690562108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eM4CqqZF6WWtCR+LKmMO41cxSpoMd4C3QGfpcKCCoWY=; b=GxfOfftEs+1D/CN8cMAqTudt5JJZ/pLwiLncyXLJYkCwCcK59O9/QtjAzJUKzCSRZOTZnu vw8SoyymlxJfOAd9Chb6DSdxyhlDwh2KFzT2KWr2TNsUXpbC+fEZopScsoxZt81PcXC/1p OtHAEW9f/CXm9yhr8cFBKQG9HbMvXOidkT8i+m0rbzwhoPFvZ72v+ZjyVFV3hWtM3CYQh8 3m3EoW9IRed4Gc0NZEVK8H15T6GJunTTC0M0sJuGfjSqekze78FRSiu7P3jLsuEOyZpJyX ql4T8MSRMgq6O/RVaWefDazbT1e49WggQGYrQ+lV/Of7KIm0AAe9UBEHftd2rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690562108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eM4CqqZF6WWtCR+LKmMO41cxSpoMd4C3QGfpcKCCoWY=; b=b897ix0sxGma9hTpn9xTG1hfZ/Ykv/CAECLkJ1MIf2LI9FBcG3ZgW/eQ7eT8eZduOcv05R L7FM2obTg9wCoDdKZIjuPJWDbO4jNn9njyR7qvSPxlzsdcciGCPZgOTOe1qgQCQff6j3bS ML1oU9ER9Dpti+FNc0leOE1pI6WuzclolgX5W8xCq/5mfEiGAvwsQpPZmca5x1a2hHCXBB EBoiFuku81MitP50pwNt4wvbA09Ao03ErVK9Z3UXC/GLW5VM9EQiHSwSgz8hIFEVieq5e/ l6/Nh748t453Bg5H+/lhwVenPRaoKO+Ps/OoN4T1+WJHj0shZo2iVMZJE5e4aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690562108; a=rsa-sha256; cv=none; b=EEndDkBa9jdk0lW2psD9/tY5KLWtmAjmPU8JmkgJ/gn1S6fn0ep+2siy2wBD1CUlFYulOC dA4GhyUM48lVGMHuRgrDOD3m598ww2SMlrrosSfseSHoxCP4GXJHaN1Bbo8+RFZqwuYasz wyxLjSnUBawPuZch3Uwx4bpPnYlekkFVRMnIgFLjpB8akD7/pcu8ZqFh/nbqokJgazgGvD Vahp2z+h7ZeNuUrIwih1pCRgEbQhr44EBc2DJu5PAreqdH6zjx591UQBzb9uCI1Y7O7H3C jCUqjOzihz3zFMOpDjzClt25LTVOfeTVAecDuFj+Wr9GsAyLzZx5LNfvswVO7Q== Received: from [IPV6:2601:648:8680:16b0:9ee:246f:502:a939] (unknown [IPv6:2601:648:8680:16b0:9ee:246f:502:a939]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RCCsm3b5Fz18dT; Fri, 28 Jul 2023 16:35:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <64d96046-eb5a-8f87-6cfc-3299f0fe9a1f@FreeBSD.org> Date: Fri, 28 Jul 2023 09:35:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 00/15] Handle variable XSAVE layouts Content-Language: en-US To: Keith Seitz , 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> <34d98a02-e5ad-5358-ed1c-659144ab5bf1@redhat.com> From: John Baldwin In-Reply-To: <34d98a02-e5ad-5358-ed1c-659144ab5bf1@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 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,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 7/27/23 2:36 PM, Keith Seitz wrote: > 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. Ok. >> 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.] Humm, ok. I should be able to look at this locally in a x86-64 VM I have. I'm inclined to probably leave this off the series though for now while I figure out the right solution to gcore of a remote process. -- John Baldwin