From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690493786; 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=S+proPxitzMwSXRkY8qzbNjuxILbLL5+ai2voGLoofo=; b=jJdljiezUAGlf1uczViFwXmr7dc6mmiOFJGVihrhEDgSAlX/9JXpJGhKwAZJPZBWeCygMj MUwXMRK7rxTj5CpXxPERGdQbrPWYfZNMOZefJyU/7GhV7QTOO6+XjyR3Wep3MPj6lLX7yM lxLfECLfgLswLAOGrQfpm2P5niMWQcE= 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> From: Keith Seitz 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 List-Id: 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