From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZEk0NM3tsmnAMiYAWB0awg (envelope-from ) for ; Thu, 12 Mar 2026 12:46:05 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EHraxwrr; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BAD6B1E089; Thu, 12 Mar 2026 12:46:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8E3CC1E089 for ; Thu, 12 Mar 2026 12:46:01 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 38C274BBC089 for ; Thu, 12 Mar 2026 16:46:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38C274BBC089 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EHraxwrr Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id ED1574BA23D0 for ; Thu, 12 Mar 2026 16:45:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED1574BA23D0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED1574BA23D0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773333933; cv=none; b=Mt9htX2PtvjMGort9dz4jgIWkdYUDvjgPaHqw6o+cMxp+G5QSt74y3qjdogflZZAqWIbeyM8/pBkxWtEnS+nFa4iIRSdNBRTIepN+xKFz8qehEsdUdI8VPtughbRSytfk/HXUIneIC/kwTTHA402+RlRxeTenhrN/r+hntrjrPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773333933; c=relaxed/simple; bh=hPIGD9eXTQN/NeR89lFjF6wFYhPrDCzfDaAwOryE67k=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=I1ibWtMp5TcmMDVBMCvvcIRRut35cquT9Og7fo6QzQIx+Kh0zbPXGRSDkSnLGAuQXq+cpfUzKn9b4wmKAH/5QQhRLbFVIItTxtoX6ugeiD9aj26EPZIuVXvwawnEMjNvrp9d9zJJLFPO3PhPRkS+/OClkiKD17PI9GLmJ5h/770= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED1574BA23D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773333932; 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=iYscjhPu6OfNpYZ+EqqrKRGN5Lv8dMQJQYMI2AfMX9Q=; b=EHraxwrrF01NJmXGznMT68R15u77cEaa+3aGbl094x+mjiYVkpJ3T3oeAxc+4HGpPlEwMP 3JMWp6e+bIEFoVDH/9GIC55juWTI5S2MHq+KzBOoQR1Mh1sQc3SzDzPWEe249twxetU+ZC bI6kBzj2kozHo3R5ypDft01tBqwU3gw= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-50-CfaVFpWgNOqg7PhhTn7NlQ-1; Thu, 12 Mar 2026 12:45:31 -0400 X-MC-Unique: CfaVFpWgNOqg7PhhTn7NlQ-1 X-Mimecast-MFC-AGG-ID: CfaVFpWgNOqg7PhhTn7NlQ_1773333931 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cd7ea0bb20so675058485a.3 for ; Thu, 12 Mar 2026 09:45:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773333930; x=1773938730; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iYscjhPu6OfNpYZ+EqqrKRGN5Lv8dMQJQYMI2AfMX9Q=; b=e13R4jbEmAJhTnA7R+7DD7kzX/cWoFzX5ZRuEt64ao8MTrQBn0M4g1qYK/QAYyKTxB oHZkKUgvdJSd8XmiOsDy7aCx4uDkt2X0ovLRqwPFW34uFQIELL3izNJ/6p2PWyN/vNsk +i5sSvqRGTW+4iclMRsAnOKTRMKzauZgtnQ+bc8DjIwr94D0S3EMdCVxV13FOVPJ2Acz lZM87hKtGGOcyK0ATg2fA24BdOZE8irThgNkDU4OkmOYq1F1nU9fObJY66My2ZH3AHRU nVQDyhZRwQYw5u9JgxSc1fa7YPqvfhIVyOFJHeBgGMcWW4i2AUqKudzI+5GRF53NEE4d 2quA== X-Forwarded-Encrypted: i=1; AJvYcCU89iyLTZEgomQE/7S1hFiQA4cQOOwkAl2AncQS1yQJKtJrGTGoOv8sdB7h0vpIuWziY66IjHi2+Fk8vw==@sourceware.org X-Gm-Message-State: AOJu0YxcWPY8Cv/rgbx0RMDKFrKEtv03PYzSFdVtDMgCIwve/oI6C5QQ eMEh4IQfsUFNqFHKkn1K6+bf0KlfGjNOWOOiTqsDVb4BYqx1lxY9Hp24VxyBAXluaEaH3vpZdCi 68EVv9WNrsDVSWsM5YOJdZgOHm37gJa4I8rvcveLb0Ou7fSz8xXy8CkMZrW1G+RcVjt5JDgg= X-Gm-Gg: ATEYQzzdFOcxpxbDAwn1NPf6bwO0ME+CFUmd7TIHwxJ+IkSPGC3tblNVd0o9jMgr+D8 zQZFWkLJa8L0NlLLKNQvAdQsllPyfDayLtqiePvFvSHzxq9cpjj1um/CU06Lgz8VY2ZaBRJh5p4 ktVOvW51MEfwxcgRa7ToBaObfMu4R/jyzcXIIUbHIYydE2xp1/GYCREXSPjKKW7UTu3y4hfSFek 6dsqKtUqOttp+UFTlTqgpWFe/fAmQvdmg8NipzaIa2PzmtcgMLQsic/XhHPJpbo4RCEUlVEWnex Vw6vDSRsefXPgob72HzFrey/6DEfElhWJ8Tm7BJ0i6vVCLGe4q6i7nAR4EeYtHqMAje4hpSTmHR GwJRbaY2JFzNR9SgXTbpqUAg5PTfv X-Received: by 2002:a05:620a:6919:b0:8cd:8938:f01d with SMTP id af79cd13be357-8cdb5a54987mr63131385a.3.1773333930587; Thu, 12 Mar 2026 09:45:30 -0700 (PDT) X-Received: by 2002:a05:620a:6919:b0:8cd:8938:f01d with SMTP id af79cd13be357-8cdb5a54987mr63125485a.3.1773333930044; Thu, 12 Mar 2026 09:45:30 -0700 (PDT) Received: from [150.1.200.157] ([172.56.108.219]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cda1fc474dsm408165185a.6.2026.03.12.09.45.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Mar 2026 09:45:29 -0700 (PDT) Message-ID: <94042716-41c6-40e4-8064-680aecb9db20@redhat.com> Date: Thu, 12 Mar 2026 09:45:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] infcall: Add support for integer literals as reference function parameters To: Tom de Vries , gdb-patches@sourceware.org References: <92575c2eb6805095b41ebbe62ba99b81e4e5dd63.1760629738.git.keiths@redhat.com> From: Keith Seitz In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lNPFSrGryZFsUzGD3phwqmpW8ywnHsZXeSZMOOmqgxY_1773333931 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, On 3/12/26 9:23 AM, Tom de Vries wrote: > On 3/12/26 3:14 PM, Keith Seitz wrote: >> This is v5 of my attempt to add simple integer literal support for >> refernece > > Hi Keith, > > refernece -> reference Wowser. I'm blaming a lack of caffeine on all of this. Please ignore this revision -- I will repost with all the typos fixed. [And I noticed I forgot to revert some additional changes to value_arg_coerce...] > Also, I applied the test-case from this patch ( https://sourceware.org/ > pipermail/gdb-patches/2024-November/213340.html ) and confirmed that it > also passes with this patch. > > I'm not sure if that means that you can claim the corresponding PR as > well, or if it means that the test-case I wrote was not representive of > the PR. I am sorry I completely missed that. We seem to have come to two different solutions. I will investigate and follow-up in my v6 repost. > >> how a user (or their program) handles any of these values. >> >> Keith >> >> Changes in v5 >> - Return to heap allocation >> >> Changes in v4 >> - Allocate to stack instead of heap >> - Use value::force_lval to simply copying to inferior memory >> - Add some addition tests >> >> Changes in v3 >> - Move logic to value_arg_coerce >> - Add some attempt to limit copying to trivially copyable types >> >> ----- >> >> This patch attempts to mitigate the shortcomings of passing literals >> to inferior function calls requiring references.  The specific use >> case here >> is std::map's operator[]: >> >> std::map int_map; >> int_map[1] = 10; >> (gdb) print int_map[1] >> Attempt to take address of value not located in memory. >> >> This is occurring because while value_coerce_to_target understands >> that some values need to be allocated and copied to the inferior's >> memory, it only considers the actual parsed type of the argument value, >> ignoring the actual type of the function parameter. That is, > >> Changes in v5 >> - After reconsideration, return to heap allocation >> >> Changes in v4 >> - Allocate to stack instead of heap >> - Use value::force_lval to simply copying to inferior memory >> - Add some addition tests >> >> Changes in v3 >> - Move logic to value_arg_coerce >> - Add some attempt to limit copying to trivially copyable types > > Is this a pasto?  The list seems to be in the middle of some text. It certainly is. Thank you for taking a look! Keith