From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5mTyE0dhUmXvpAUAWB0awg (envelope-from ) for ; Mon, 13 Nov 2023 12:47:51 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=OuQiF5Be; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 431B71E0D2; Mon, 13 Nov 2023 12:47:51 -0500 (EST) 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 2DFBB1E091 for ; Mon, 13 Nov 2023 12:47:49 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 890BF3857712 for ; Mon, 13 Nov 2023 17:47:48 +0000 (GMT) Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 823E83858D37 for ; Mon, 13 Nov 2023 17:47:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 823E83858D37 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 823E83858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699897652; cv=none; b=rbnxkb73j24m9bDIh/PBl/4AlXE91MeDuiwDZs0hMn0xVy6/hge8DzT5174tWsLob14lOBpZ0FgB5bWB4nTAUK+7BxXolu0koxhaOQz7MZ3V3fHl5L5p0UptYaN70V6zdwxa9Gv3qfnkGWufaC2xfM75nEM8GD7G+E3ZXV9h7ew= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699897652; c=relaxed/simple; bh=AZAZcbhjFgoKX2vjQjDSxU3jWaHK5gyJJjfj08/oo84=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IzQxkIZwTq1gSAyk10x7KqkqwBgX2WbVhC3krVeeZ7uyvEdogf3G2zFTLPmzCux4H8zA+LZKemHx/cnD/b7PLPyUIQFnpcWZ1CyucGKghOyZnrBwXUVbfgsQg9wlpiJ/Az+zdHOxY4xa8werzzHyTioaxlMGBYXIzuv+6PyygZQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id 2EkerTV4yKOkL2b21rPs7V; Mon, 13 Nov 2023 17:47:29 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 2b20r43NL97pz2b21rCHi7; Mon, 13 Nov 2023 17:47:29 +0000 X-Authority-Analysis: v=2.4 cv=ULDOoQTy c=1 sm=1 tr=0 ts=65526131 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=52PHwpR_dKZoYy0ft1wA:9 a=ul9cdbp4aOFLsgKbc677:22 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:In-Reply-To:Date:References :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=5V/6dMf879QWigE7f5qvTSMdjXfqJhxQfshea7nubYI=; b=OuQiF5Bee7hX5MObaOQfjxS3GI jZXP15uliIIEpl3wsmF7Qjrlc4qxG5Pn5SblxvaP04AHaILcjUJrmghtBqjeY3KvdLvASraS9XDdu of3gJ6RezVfk6NQbdeqCO4tYC; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:33378 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 1r2b20-002fQG-1I; Mon, 13 Nov 2023 10:47:28 -0700 From: Tom Tromey To: Konstantin Kharlamov via Gdb Cc: Konstantin Kharlamov Subject: Re: How to write to stderr/stdout of debuggee References: <9c035c4b1eeca774df605fda412570a9bb151a59.camel@yandex.ru> X-Attribution: Tom Date: Mon, 13 Nov 2023 10:47:27 -0700 In-Reply-To: <9c035c4b1eeca774df605fda412570a9bb151a59.camel@yandex.ru> (Konstantin Kharlamov via Gdb's message of "Fri, 10 Nov 2023 18:06:31 +0300") Message-ID: <877cmlsfyo.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) 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.77.73 X-Source-L: No X-Exim-ID: 1r2b20-002fQG-1I X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (murgatroyd) [97.122.77.73]:33378 X-Source-Auth: tom+tromey.com X-Email-Count: 24 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFMwcn8jOo3JH8kYVlOtG0XZ44SdCej1GFUFfV/MF/7EIEXOSzOoZKZM2CuCJqDDQeK8aSlj9w+zw/wvK+zlnzeERDhMY8aj+XcWFrdIjU3WUL1ZI8CP Q85pJzoHk+BAdQNSiK9xwrfyTr6ICmi693VlIHlhWwSIQppwioJfKDywBoypxMvfKSc26NBtwGukvQ== X-Spam-Status: No, score=-3018.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" >>>>> Konstantin Kharlamov via Gdb writes: > My usecase is I'm debugging some plugin written in Go, and I don't have > anything language related in the visibility scope to be able to write > to stderr/stdout. Though apparently gdb does see a `write` function > (which I presume is a C write function, not Go), but executing a > p (int) write(2, "Hello", 6) > gives me a `syntax error in expression`. So anyway, I'm just wondering > if there's some built-in way to do that. I don't see a built-in $_write > function in gdb :( It's possible you have gdb in 'go' language mode. Try 'set language c' before that print. It might help. Tom