From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id L7x2IeWG9miLjAAAWB0awg (envelope-from ) for ; Mon, 20 Oct 2025 15:00:53 -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=Q4JjrBPo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 791941E047; Mon, 20 Oct 2025 15:00:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,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 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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5EA5D1E047 for ; Mon, 20 Oct 2025 15:00:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E34DC3858D35 for ; Mon, 20 Oct 2025 19:00:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E34DC3858D35 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=Q4JjrBPo 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 62B873858C51 for ; Mon, 20 Oct 2025 19:00:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62B873858C51 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 62B873858C51 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=1760986815; cv=none; b=m56nwWrk0C5rb3frGpUWzRcyxF2D9YugJGJE9IWaRs7OymQBMU6XuOAa8kWv8ubN24p6VpmBUJWGkDf0Q62XU5hsgbe66tBKfr2soMOrc5FI0EDzO4ymDASl6eWra0U0oGDQfM9Ha9j6bE0/HYXj3jIy+c7hI9yrP3twnCq2uJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760986815; c=relaxed/simple; bh=rapiX30wY0QyIi9Pk19+OVNXNXicv8svhSADXXfDLWo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=LGilWZXxsddCtuxOagZdeUA7PPdMXF06z/sQjJv+ssedmWDcOugLeHMTacEenZxFI3mwXfAiF0/TG6BOk7m8LoKEXHBqpowcqPc0GZIlojuEOVuLCPN5lUYdPGlfc1nTvyQm+K6hXuL+r5uCuWDa1o7Ki8eB1/sIH5DS57vStfU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62B873858C51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760986815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nm5qKXd+Bt3CC327dmCDGInvMFSScDRw4vjDB6Da4Yc=; b=Q4JjrBPo/mKEBjPE4qhHCx+IwGLB//9a7qw1v00XBuy8euoTrWQOA4azJlp7V1FAo6vj0Q n8M0o5afGfHBFiKF1orwY0bAMS8Qd6SyM2Hl1NZZNTeDpUOnsmfH958Yy+7DnCIRnLOllc lLrausbvzhGwqnzA2tyUaAROXfN+oGU= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-yq5m2NbyMyynYCXtiW5whw-1; Mon, 20 Oct 2025 15:00:13 -0400 X-MC-Unique: yq5m2NbyMyynYCXtiW5whw-1 X-Mimecast-MFC-AGG-ID: yq5m2NbyMyynYCXtiW5whw_1760986813 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-891504015e5so840367985a.3 for ; Mon, 20 Oct 2025 12:00:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760986813; x=1761591613; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nm5qKXd+Bt3CC327dmCDGInvMFSScDRw4vjDB6Da4Yc=; b=goDl7YOguIfEVyGN8WXrAU1RjCMrkm18eZmuDIvCzaO5smEEGCEIIdAu6svigYwOlZ QD49F3iUJUxVeVbX8AoFYBHRb7FQmdfifAArA44Z4kY3eVENx9KR9j4Vp71gYdxgvWgY Z+kyaV+3qnQC6VUaxkwyjkoeZRoK6G8xWOZkj7Dl6msgqx1BzwDY4eTbq8lTtH+JDb5D O7GQTP0NSGMAhWLh3pce0gRTHsacOKFdiTRBoz+SILA3rbbipP492Ts2db6XF9HkncZo tewcCfgENN/yzLazhGTadBFPRdW1KUG2UbCEp0INF/C8IAar7pQfu0TJ/wW/TY3UB0Ld uWSA== X-Gm-Message-State: AOJu0Yw1tLPx4k4b/AK/FLrmRkSLzoga1VameMYNRAxrxXqvwVZ9hXii DSAvj0/x/FcK8X36VptzHfrnc/5AOC22QAM/axGcaMpf6YF9DQAp44JbMQldG4qHfW3c8rIlAYO zomHfd12UgLBXXJeNwB9ZyNpw2Hb2/epISxw98GR5SOZvrRya70xISUQleVAbGRpqXpWuXuY= X-Gm-Gg: ASbGnctrMdOT091E4TM5F4kg+PZhtisYADxIMQchdqb5OBXixIHCsqLyqPVMilZcIV2 wTsBJgEu643gLgPcPsUNvmskDf5ExWrdgCnSuMGUevYHaBls4njyNi9O0DSestpq/U+P2tIdP0V 3Y5kWOb3RYthb+mc/esKtKfHuEeq5VQH+MuJ76zQOZhEE7pZrJUGOuV4rQYcZfKTVnoB7SvEd+p ++lxl1HLK4BzCz2Vb1oiZU5bu43ygbMePvVEJaGD8ZGh27IHFbtbIfiVMYo3msMrAga5Bdqsl4s MA2zcSFwG7WKPliTcHOwg9aYcDbCm1ukyRNXGoJXEn/O61C7BEUktqk3YbU/gQ4VC1Wbl+wtmwq A2N2csQ== X-Received: by 2002:a05:620a:1921:b0:88f:561:d956 with SMTP id af79cd13be357-8906e2d00camr1949879085a.13.1760986812792; Mon, 20 Oct 2025 12:00:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtHEUKc/uJly3QRZ3xKmUn0HhM4A4KzgRtg2+lmIsSwhV7aBnURto/5r6qDruPqfW1lI8CyQ== X-Received: by 2002:a05:620a:1921:b0:88f:561:d956 with SMTP id af79cd13be357-8906e2d00camr1949875685a.13.1760986812411; Mon, 20 Oct 2025 12:00:12 -0700 (PDT) Received: from [150.1.200.157] ([172.56.106.208]) by smtp.gmail.com with ESMTPSA id af79cd13be357-891cefba77asm614959385a.33.2025.10.20.12.00.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Oct 2025 12:00:12 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2025 12:00:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] infcall: Add support for integer literals as reference function paramters To: Tom Tromey Cc: gdb-patches@sourceware.org References: <92575c2eb6805095b41ebbe62ba99b81e4e5dd63.1760629738.git.keiths@redhat.com> <87zf9ppoq7.fsf@tromey.com> From: Keith Seitz In-Reply-To: <87zf9ppoq7.fsf@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wCXDy2iy8bAVQFJfKtsJLK_rpYIjYGRh0n_2Qt56czI_1760986813 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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, Tom, On 10/17/25 7:49 AM, Tom Tromey wrote: >>>>>> "Keith" == Keith Seitz writes: > > Keith> This patch attempts to mitigate the shortcomings of passing literals > Keith> to inferior function calls requiring references. The specific use case here > Keith> is std::map's operator[]: > > Keith> (gdb) print int_map[1] > Keith> Attempt to take address of value not located in memory. > > I didn't see in the text or the patch what the method type really is. I believe I have addressed this in upcoming v2. > Keith> +#include > Keith> +#include > > It's better for tests not to use libstdc++ stuff if possible, and to > just write out a method with the problem signature in a locally-defined > type. Gotcha. I have removed all the offending libstdc++ classes and rewritten using just basic function/method calls. > Keith> -if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} { > Keith> +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { > > This results in starting an extra gdb that is immediately exited. Reverted. Thank you for the review. Keith