From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tdcpJNPXgGk3gCQAWB0awg (envelope-from ) for ; Mon, 02 Feb 2026 11:58:59 -0500 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=Ax/5Xz4m; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7F79C1E0BA; Mon, 02 Feb 2026 11:58:59 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.1 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_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 C14E51E08D for ; Mon, 02 Feb 2026 11:58:58 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 067534BB58E6 for ; Mon, 2 Feb 2026 16:58:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 067534BB58E6 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=Ax/5Xz4m Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 3C9D44BB58B1 for ; Mon, 2 Feb 2026 16:58:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C9D44BB58B1 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 3C9D44BB58B1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770051506; cv=none; b=eYEpX707lAL9cSJtM/vXV9HS2ddMNeV7SGWM/SxSY4drKLcOyBZzPjwtf+zUBJ2X26J2amjZfGEpHdOzoTnnTdfdPaUVaEOZXcIYoHWj/qlNDpnNLcw5U+v1qSVMd8PxfyB3daoi+FjVLiSyOH/Ns9XGGGRIq2gCVqYcWyTbXQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770051506; c=relaxed/simple; bh=ikxIL+CLL6DUi/cpe+BhS+CogKbR31p9dS2JucO0IyU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=usXH7cqglRWUYTa5gNzlL+zFuajCupXuyB7HZcobsFk+yyPKMRmc3UWngJ8C46Jdq/3aKZak2E8y+XQWP/gIE65M+Fernism1fQvpwkIU5Oxxg2uU3ilW2GNVD2AItBia/D0ZFHbPA1mIxifsukmBFQ4ceJZ/9kRg5LeXa1kuSE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C9D44BB58B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770051505; 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=WA/601PZz7XYsqMBpIBXr+0JdyGjQMQisRiNUR3iNUM=; b=Ax/5Xz4m/5y0jAhYV4urQFRTTOZPUKbJwMTs4TBw2IuZWYhC0Yl0YIH+03zGfcib7klX1v Q8BGsnn/Lsn3gGM8JgwidiRsVK06YZDpyo5v5zDDuqZFZFRaGh+73W2RRky+WjxoJ0uomV O3ogrR27KDDycE0favLGKUOuz5R3BNY= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-amtsWZG5N7qe72JCTA2MFQ-1; Mon, 02 Feb 2026 11:58:24 -0500 X-MC-Unique: amtsWZG5N7qe72JCTA2MFQ-1 X-Mimecast-MFC-AGG-ID: amtsWZG5N7qe72JCTA2MFQ_1770051504 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-822426d844aso2939413b3a.0 for ; Mon, 02 Feb 2026 08:58:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770051503; x=1770656303; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc: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=WA/601PZz7XYsqMBpIBXr+0JdyGjQMQisRiNUR3iNUM=; b=RdAQecngty7tXfXjUObFAlF6F3hl33FLtHDY2iIgWKvinFHiDIdyrLhPUYe8wFRJs/ 7HwQqvtpEQh+Ud/No/a+pygYfpArDPrbLhk6p60lfANnCHDk6yRtBmk+ImkJic/nm2EB CCx97OPUkjn1PD3wrDyTuacK3wGvtfgghUrBqtWjicxMnddHeSqkofTM/1Q8cRkN1kUz wyt0IH1kiaDyRIWa7nSIo+yj9I1b6U0BVGBA0dDgIPOsKle4o3pq2DkwSH88cX2keg0x mfGcMWVNovEFpFJg6kCDqN09fx03sNT0tTnSbftBDe3nrsHQx7bu1fUVi72JKIWhb42o p07g== X-Gm-Message-State: AOJu0YxubG6Xu0OCQlR72rQQZ6l5N3pQxby4PDpB1/wCSTxEIUqN9g/W jbQqXHCUFnr5oca9UGBURGUkvkiiNWTzDxAuixxt0geclyaHRlelZt7GX5QV+9mVQY44Q6BqEpR Yr1Z5PZ6k806W7iVXKtbwiCLEQZsUWlttdo1PMJ1e3QCXlNKU9CprcgrTuwHxjh6A8D2bQAo= X-Gm-Gg: AZuq6aKfcB691+poSU5CtoqKzXOPgF+nBYVLlhEVTI54MtQ6hf5ZNzZgtvFYE1pmSsW HhoE/qhPcaLGkkZOyiYvrDIT/apch5TjrPcAJWDEDf5Jy/crdFHzIYzxvH3Ac2sD8Ey7SlwfLf0 APHLQjmGRZM5b/G4TZ4emwA7jU6X8eSfZ5uUp7un3xQIR6s1UQ3alqUNePyzBGwXgFzpYw7QOGU fWgTeErM4eKwiASnH7CVC0HXuW9VefNkdgRQEGKJiq0yu37lOifzfIcFoW9u8Cq2DEWTFoOQOwa nhrTI5YSaGgPkzCaV32/Zl7kiDBCUd1pCNaoJ2aO7o/MrjWmQC656Ts7n7DXJOK4XhdVllalQkT 5fikLYToeGMxZcEsH X-Received: by 2002:a05:6a00:4086:b0:823:1bc7:ffd8 with SMTP id d2e1a72fcca58-8240427d8eemr66689b3a.9.1770051503346; Mon, 02 Feb 2026 08:58:23 -0800 (PST) X-Received: by 2002:a05:6a00:4086:b0:823:1bc7:ffd8 with SMTP id d2e1a72fcca58-8240427d8eemr66680b3a.9.1770051502963; Mon, 02 Feb 2026 08:58:22 -0800 (PST) Received: from [150.1.200.157] ([172.56.106.185]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379c5a190sm19828713b3a.68.2026.02.02.08.58.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Feb 2026 08:58:22 -0800 (PST) Message-ID: <49b0d193-6421-493b-9633-eedd473d110f@redhat.com> Date: Mon, 2 Feb 2026 08:58:21 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] 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> <963c933a79455dc4aaa35f8c34bed8693065e6a5.1769539110.git.keiths@redhat.com> <871pj695q6.fsf@tromey.com> From: Keith Seitz In-Reply-To: <871pj695q6.fsf@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YtXFtAlrY-RYxvIt28XQiNZwbYdqFXTKcNhi5RVAswk_1770051504 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 On 1/30/26 12:59 PM, Tom Tromey wrote: >>>>>> "Keith" == Keith Seitz writes: > > Keith> - Allocate to stack instead of heap > > I'm curious why this change was made. > Often I think gdb just coerces to memory via malloc. I was persuaded by another reviewer's comments[1]: > This uses malloc to allocate the space. I was wondering if allocating > space on the stack wouldn't be better. That's how arguments that are > implicitly pass-by-reference are passed. Also struct return values > are forced to lval in stack-allocated memory. > > Furthermore, malloc would not be possible everywhere (e.g. on GPUs); > stack allocation would be supported by more platforms. I was unable to conceive of a counterpoint to this last argument, hence the change. > Also other calls in this area seem to check > thread_stack_temporaries_enabled_p. Not sure if that's needed? > Maybe it's expected to be set and this can just be asserted? > > This is not really an area I know much about. That makes two of us. I will look into the use of thread_stack_temporaries_enabled_p. > Keith> + if (new_value->lval () != lval_memory > Keith> + && language_pass_by_reference (new_value->type ()) > Keith> + .trivially_copyable) > > This subexpression should be parenthesized and the '.' lined up with the > 'l'. Will do. Thank you for taking a look, Keith [1] https://inbox.sourceware.org/gdb-patches/92575c2eb6805095b41ebbe62ba99b81e4e5dd63.1760629738.git.keiths@redhat.com/T/#mc60c810be7d4054faa7699a453c00cdf6b21fc15