From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KfZBMaBmUmUmpwUAWB0awg (envelope-from ) for ; Mon, 13 Nov 2023 13:10:40 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=RXX+YSMx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BC9051E0D2; Mon, 13 Nov 2023 13:10:40 -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 AD1951E091 for ; Mon, 13 Nov 2023 13:10:38 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 55F96384DB43 for ; Mon, 13 Nov 2023 18:10:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55F96384DB43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1699899038; bh=lbHkSdvqoHpOIg0UHyPuC9LKZdVaW1EmnX+xwIwsNYc=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RXX+YSMxKUXcyjnXKPOOH62krodti712/vBXjwq7TZq/cAkVa0cKR8miijqVzPWxK GJwgFaykj1v8H/5rIaDZderag5DY/0KMaAJaadTCqJ9Ppp+0pFXlhnFhcu7EsqE4rP UcqxSbT4Cn7YnnVubMU5gN3BscQg9HEjaXFJeZEA= Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d502]) by sourceware.org (Postfix) with ESMTPS id 731CA3858C2F for ; Mon, 13 Nov 2023 18:10:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 731CA3858C2F ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 731CA3858C2F ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699899012; cv=none; b=JnUjRz8sKXAN/XPfN0Yi7P5Q0KFLeIQlp4HBJSPj3HKHdQGJVMy+7UK+bUBR4RgHTbu0KGr4wJHzstds9xyfJ088Gop9GTn4mta5Hex1Wmhzo6t2GGGArxBj9JzKFDJr02NLXFGUtTEiIumuLj+p6Biw7MFF9lo1E6lGvTQjeQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699899012; c=relaxed/simple; bh=4I+3guoWVRKds3AZjnmhRUXvxYSyyKMZTJaPrl7uGys=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=qyWGDIxIK2fOBTvzi1Kg9hz+MLjeI/GLFKNf+o73cxfv9e4bxly51cbFBVLPfOnv5Z64fgvyvC35DoPf4Z3AH8AIqwKD4DQWC2ZytI8ygQsmhb0YX6cEMdn//ncUMYkwlP//wyHyPCZRSOW4Qb3FS6/yGUjNEuaZOo76cb5/JR8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:3995:0:640:f3e3:0]) by forward502b.mail.yandex.net (Yandex) with ESMTP id BB2EE5E99A; Mon, 13 Nov 2023 21:10:06 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 4AnWDFoUwqM0-SxQ0V6uG; Mon, 13 Nov 2023 21:10:06 +0300 X-Yandex-Fwd: 1 Message-ID: Subject: Re: How to write to stderr/stdout of debuggee To: Tom Tromey , Konstantin Kharlamov via Gdb Date: Mon, 13 Nov 2023 21:10:04 +0300 In-Reply-To: <877cmlsfyo.fsf@tromey.com> References: <9c035c4b1eeca774df605fda412570a9bb151a59.camel@yandex.ru> <877cmlsfyo.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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: , From: Konstantin Kharlamov via Gdb Reply-To: Konstantin Kharlamov Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Mon, 2023-11-13 at 10:47 -0700, Tom Tromey wrote: > > > > > > Konstantin Kharlamov via Gdb writes: >=20 > > 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 >=20 > > p (int) write(2, "Hello", 6) >=20 > > 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 :( >=20 > It's possible you have gdb in 'go' language mode. > Try 'set language c' before that print.=C2=A0 It might help. >=20 > Tom Haha, thanks, that worked!