Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seVFa-0080Va-0r for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Aug 2024 07:50:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1seVFY-00FPLd-LK for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Aug 2024 07:50:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seVFX-00FPLU-2r for pgsql-hackers@lists.postgresql.org; Thu, 15 Aug 2024 07:50:24 +0000 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seVFU-004x6I-GI for pgsql-hackers@lists.postgresql.org; Thu, 15 Aug 2024 07:50:22 +0000 Received: from phl-compute-01.internal (phl-compute-01.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id EFF5B1151CB8; Thu, 15 Aug 2024 03:50:17 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 15 Aug 2024 03:50:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1723708217; x=1723794617; bh=AAs8RmCR9J0vlGy4Kmrg6VXJcPTAWpJt9z7V9zEwvoQ=; b= yGVOJFXcVSPrJqUSSHqx0MFepaxGcdIISuwIrwVUQACv8Z4q0+9zVP2j33We2QKW 4f97q8SGcqhfr0FG0hVqoESYuVidiOU172dFofNWCgQD6JXz31urgNfdzluFa/zr JIg3Erh29TqCoNRa+jmomXHea+HjSt+7liniaLrtAc321a1yN5X5tT0I8afFE3JW OVZExfT4vvKlKGNceRkW0HF/y7cQnso5hiU8s3hWNGVZIiJgFFNYB7TjTw9zrzUj Zz+dC4CKOxeDrp23+KMNBARXVmLKx1saLpiUqUsKR66DLPDZAFEwEuh+ajUfxVgE S/MFNhc1e6cfnS27js0b0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723708217; x= 1723794617; bh=AAs8RmCR9J0vlGy4Kmrg6VXJcPTAWpJt9z7V9zEwvoQ=; b=b /uHOnuQdHMc4WjLGQkn1XVltPE1iW2rjToxMGnwCxVNhcktvcA5J5DmUWIh5/4ou HLHDYG/8jNueflFjgtMOkE3g3tmmPsr5jOM4yTkCrJPIyQswkY6YbuFy36FnYbKC OFGhWOeZgFdjoDU46F/TUsia2NITUjgtURO4BB7sphKvJXLdbz/N1mqu2osepnFo YyTixUEayAmHVUyAIUE/GwQbNqiebnuaG+IdxTCw7teQYn1I/AHusAzKHmf941k3 XUjiLiDZTSla1+Hbw7A8s5yBHYyWpA8EKn9rVHWWjX2rfftoJ8B9/BOIEqvG2zxv iFS7h8bo3xn1L7sq7F0yw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddthedguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepudfgjefffeelfedvgedvjedv ieehvefghfejgfduhfevvdejveefheetlefgveefnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope hpjhesihhllhhumhhinhgrthgvuggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtohep rghlvghkshgrnhguvghrsehtihhmvghstggrlhgvrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Aug 2024 03:50:16 -0400 (EDT) Message-ID: <4f87171d-1623-4acf-8d7e-80a714ae68ea@eisentraut.org> Date: Thu, 15 Aug 2024 09:50:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: format_datum debugging function To: Paul Jungwirth , Aleksander Alekseev , PostgreSQL Hackers References: <286814e4-46d4-44d6-be45-c2ee979021e1@illuminatedcomputing.com> <463c034f-a1bb-4361-ada7-83e994d86bfb@illuminatedcomputing.com> <991fd3e7-f414-4320-8674-e9651ece1b4e@illuminatedcomputing.com> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <991fd3e7-f414-4320-8674-e9651ece1b4e@illuminatedcomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14.08.24 17:46, Paul Jungwirth wrote: > On 8/14/24 02:16, Peter Eisentraut wrote: >> On 12.08.24 23:15, Paul Jungwirth wrote: >>> On 8/12/24 04:32, Aleksander Alekseev wrote: >>>>> [...] This function takes a Datum and the appropriate out function, >>>>> and returns a char *. So you >>>>> can do this: >>>>> >>>>> (gdb) call format_datum(range_out, $1) >>>>> $2 = 0x59162692d938 "[1,4)" >>>>> >>>>> I assume a patch like this doesn't need documentation. Does it need >>>>> a test? Anything else? >>>> >>>> I think you forgot to attach the patch. Or is it just a proposal? >>> >>> Sorry, patch attached here. >> >> I don't think it's safe to call output functions at arbitrary points >> from a debugger.  But if you're okay with that during development, >> say, then I think you could just call >> OidOutputFunctionCall(F_RANGE_OUT, $1)? > > I assumed it wasn't safe everywhere (e.g. there is potentially a TOAST > lookup), but for debugging a patch that's okay with me. > > Are you doing something to get macro expansion? I've never gotten my gdb > to see #defines, although in theory this configure line should do it, > right?: Oh I see, you don't have the F_* constants available then. Maybe just put in the OID manually then?