From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 161243858D1E for ; Mon, 6 May 2024 16:31:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 161243858D1E 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 161243858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715013086; cv=none; b=P1NGGM4i5cZMggi3DJ8vgOgKiP+qwd7jmGUiOhZisSLTZy9GcKp2W55GK5MygfxxhE8phIUsNLncXIDIsfUsBgjFc+/CD28UWEouytUUQ4Hdufi6jPSaMdEDHlszF8WR9qo99E+2DQ2Ta7NeT1LuaAOPykFk53PKMsx6bLa47GU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715013086; c=relaxed/simple; bh=ONi6TA8Poc1RIUJszi6/Ax3ftr2Gg86urGwdspfOBoY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CEC56hfmZaoAETHmdOojHKd0RXpnfej98YCX5oJBYIuVO8erz4Vd0RK1dmDr9tfQLcEw3PT96IwogfF+FKTTEv4+svTMc7s36xz7ImkT376zOZMgRkrPU5PgT1We7RbKG+OInkD1nZSk53UKXZC4CI0jIwj3sZdAosC9dJ0qpiQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5003a.ext.cloudfilter.net ([10.0.29.159]) by cmsmtp with ESMTPS id 3qVJsQpNvSqsh41FMsvcVc; Mon, 06 May 2024 16:31:24 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 41FLs03kNsT9B41FMsUuph; Mon, 06 May 2024 16:31:24 +0000 X-Authority-Analysis: v=2.4 cv=LIutQ4W9 c=1 sm=1 tr=0 ts=663905dc a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=TpHVaj0NuXgA:10 a=Qbun_eYptAEA:10 a=ak9k0u-1s74wN3mVbacA:9 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:Date:References:In-Reply-To :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=CifqbujqJT7rJ7PCifOwh47aAengeL9J7CnzmxM5/xU=; b=npYUGHiiY1YCBq4kh6dZGmM1W+ luJ5Dg0uIevOybIemS8oojHEOqeT6ES2EB5nyJY5AlWb8VgNkNM3staXtpA7MIuTwtE6u/covQJeT Pz2MFe6F30JWlOsouRTvxy1+e; Received: from 97-122-86-252.hlrn.qwest.net ([97.122.86.252]:34148 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 1s41FL-002jZ5-22; Mon, 06 May 2024 10:31:23 -0600 From: Tom Tromey To: Hannes Domani Cc: Tom Tromey , "gdb-patches@sourceware.org" , "blarsen@redhat.com" Subject: Re: [PATCH v2] Allow calling of user-defined function call operators In-Reply-To: <829989170.10609936.1714768529914@mail.yahoo.com> (Hannes Domani's message of "Fri, 3 May 2024 20:35:29 +0000 (UTC)") References: <20240427163606.1780-1-ssbssa.ref@yahoo.de> <20240427163606.1780-1-ssbssa@yahoo.de> <87msp6d5ik.fsf@tromey.com> <829989170.10609936.1714768529914@mail.yahoo.com> X-Attribution: Tom Date: Mon, 06 May 2024 10:31:22 -0600 Message-ID: <8734quc36t.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) 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.86.252 X-Source-L: No X-Exim-ID: 1s41FL-002jZ5-22 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-86-252.hlrn.qwest.net (murgatroyd) [97.122.86.252]:34148 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: MS4xfJVEAwF9o9noWTqQaLENLvpQYEhj6lDKK36wuQqkFASKysVZkZ3Ncak8hlP3ufSNOjrTEM8MItmyNfb9RuetU3DebDXfX3LpSYmolXxhicNwsHEl/zDc BpAc62BNNoOHE/5x3/XJAQHFedwmiMUxZS7EGgZ7H8zuJ09Tm3GcV8Jmy/j5N2DPKFq8Lc9G2V5+SSM3OtYqE+sj/qA/EZDkLJc= X-Spam-Status: No, score=-3014.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP 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: >> IIRC the evaluation operations are all kind of complicated and >> hairy... but it seems to me that the type of the chosen overload of >> operator() would supply the type here? Hannes> Here the overload of operator() is chosen based on the argument values, Hannes> not the other way round. Ok, I looked a little more and I see other paths pretty much doing the same thing. I don't really understand how this works if, say, a call like this requires a pointer-adjusting cast to be done -- evaluate_with_coercion won't do this properly. However, if there's a bug here, it's probably reproducible some other way already. >> However, the value API is convenient to use -- for example, this is what >> makes operator overloading work in the Python API. >> >> You can see the distinction with this patch by trying to call a >> struct-with-operator() object from Python. Hannes> Calling a struct-with-operator() object from Python does not work, because Hannes> valpy_call directly calls call_function_by_hand. Hannes> It would maybe be possible to also call evaluate_subexp_do_call there. We'll probably just need a new value API if/when the time comes. Tom