From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id CB3143858D38 for ; Mon, 12 Feb 2024 17:27:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB3143858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CB3143858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758876; cv=none; b=c1AZ9EufIMmD/+GTQmiRGiinduVbAQk5Sft0dHYXdTUSAgRgeeMTIbZbKa5PQvnf4NCheVebMvDmyxRcUCBhbUzuD/ONPQKQ/pjTFLQQee5ZGDfk9o/CELrJ1Nw8F39WW6nPTz2xWYU3XZpO7q6IZosgEBt6ZTGfLiLh0VgirRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707758876; c=relaxed/simple; bh=g+lUpYeFn0Q0hSvT5QzrzFFRWaT2XRH0kmeiHJALwLE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=snMw9CDFm2wX8/jC9U55ejyPyU+04mw+CDGmS//yizXCQimUc+V3sliu51BP719fEvIOnX/dFZ+X4M1pE1oPS8yLrQ2sr82Oa/vJzGD0XACWDw++g8HgWjL2kmA4iti0nDx9mg1LqNj9Ogo9tVAWAGSpeLCxMd8C6XqTG35D4AE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5005a.ext.cloudfilter.net ([10.0.29.234]) by cmsmtp with ESMTPS id Z2EprFDfhCF6GZa5traM7g; Mon, 12 Feb 2024 17:27:49 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Za5sruG3XeCqGZa5trpzIi; Mon, 12 Feb 2024 17:27:49 +0000 X-Authority-Analysis: v=2.4 cv=e8qlSrp/ c=1 sm=1 tr=0 ts=65ca5515 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=QyXUC8HyAAAA:8 a=Q136HDX6GZTnQYP9dBIA:9 a=JlEvGDnUVHgA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=++GEN6OGHIXVB/uHqBU8gXMLGjHKh9GIlPAyhYf3GxQ=; b=k0DiEU106FKS1wKm6CFBQSSBBY WXEiTolDpEpM/e1NJ7yEv64g2tp1OhO18OANjwtXMQ8b7xEXlsdZplcZtmx8f1qhxIYUKzpRp/bTe AcuGq9FX/AyxQQtW0XRtl6xfW; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:42036 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rZa5s-002fHf-1V; Mon, 12 Feb 2024 10:27:48 -0700 From: Tom Tromey To: Stephan Rohr Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/1] gdb: Fix assertion in 'value_primitive_field' References: <20240212124740.2734613-1-stephan.rohr@intel.com> <20240212124740.2734613-2-stephan.rohr@intel.com> X-Attribution: Tom Date: Mon, 12 Feb 2024 10:27:47 -0700 In-Reply-To: <20240212124740.2734613-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Mon, 12 Feb 2024 04:47:40 -0800") Message-ID: <87r0hh7fu4.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rZa5s-002fHf-1V X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net (murgatroyd) [97.122.68.157]:42036 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGscwPyyVaBT3BIMVCnJ32a2VD9MCTDULCF3rHFgxM1WuK1uM0YJfpTd/SmFx5vndGNxtw2kW74v/kjXppfaJlF3z1I8cee6ew1nCciyh7tJEB/qJL7b gts6ZtDD2/jeG/eWg6fsMgQY3yNVJkNZu+9so/pswj3twJ2yh50rV0mwAcWo3APGzYW4HGJisFhWI4/Kmq8FSVhPxPvR72T+lp4= X-Spam-Status: No, score=-3016.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Stephan" == Stephan Rohr writes: Stephan> From: "Rohr, Stephan" Stephan> GDB asserts that the data location of a value's field with a dynamic Stephan> data location is resolved when fetching the field's value in Stephan> 'value_primitive_field'. This assertion was hit because of bogus DWARF Stephan> generated by the Intel Fortran compiler. While that compiler should fix Stephan> the DWARF, we prefer GDB to error out here instead, e.g. to allow the Stephan> user to continue debugging other parts of the program. It's hard to be sure in this code, but normally if there's an assert, it means that there's a requirement that the caller do something. So maybe this is a bug somewhere else? The code does seem self-contradictory though: /* We expect an already resolved data location. */ gdb_assert (TYPE_DATA_LOCATION (type)->is_constant ()); /* For dynamic data types defer memory allocation until we actual access the value. */ v = value::allocate_lazy (type); Like how would it be resolved but also possibly dynamic. But since this is allocating a lazy value, why does is_constant even matter? What happens if you just remove that assert entirely? I think some kind of test case here would be good. Tom