From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id u7YsAuk1AmIxVQAAWB0awg (envelope-from ) for ; Tue, 08 Feb 2022 04:20:41 -0500 Received: by simark.ca (Postfix, from userid 112) id EC4BA1F3C6; Tue, 8 Feb 2022 04:20:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 374881ECEB for ; Tue, 8 Feb 2022 04:20:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A77E9385840F for ; Tue, 8 Feb 2022 09:20:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A77E9385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644312039; bh=wFJeB67dwy/BlyppAZKJfXhUp9EWY41P8uDMDSI1ITY=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=q9P2xBI8wYpu4cGRvF9Byeg5X8PlZUKCTpX3hJMKhvJKQE/heJVmMhGoUMTOHtHLY u1HdTger+KPDQsQArNbjTyPbiq/XJ2YjJz7WghXZKDVH9cddw03duLBnZVY8NKO4N2 Map5hGjzMMhEzSH9hKmsylodFMKzUhmqiVmpAkGc= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2F433385841F for ; Tue, 8 Feb 2022 09:20:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F433385841F Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-539-zFyA2CuSMZWN5uwBx5Ndug-1; Tue, 08 Feb 2022 04:20:13 -0500 X-MC-Unique: zFyA2CuSMZWN5uwBx5Ndug-1 Received: by mail-wm1-f71.google.com with SMTP id a8-20020a7bc1c8000000b0037bc4c62e97so297822wmj.0 for ; Tue, 08 Feb 2022 01:20:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=wFJeB67dwy/BlyppAZKJfXhUp9EWY41P8uDMDSI1ITY=; b=uPwsyKNuDMMyId2OXCXSo32jIKcbpguVJnYug6sfUM1YKwANAdNR4njp3FfWFX7iSg 5nwp0MBROy0PkPZ/fk4xtntaG/vkJyq9SXeAOfLuXMF0xSEvY5mxEO4LrtHJZshusXAJ 89hEyMIMDSbs2N6858LlEO76WeUx92NwCpvG5iWFcuhmXA2TwhxYQIulKjDvXsZYr10w 1bIcfIovZzMudP6S/AE952w2XyNuirnPZ7gGUc6F3IRNd6Dc7ur9oz19WvCBcKnl4wuV n2/fOkReliLYYv5EHIo+VNz9fKOqOR2VwRiTlqClIAgwicoyhax2roZANWO55dCdLXnG /ETw== X-Gm-Message-State: AOAM53320k4NloNxTl8BAwpQc6DwadtCQ8NH3ixfPyLH0s3bT9yBK9NV +sdrHjcGLlxMYp5ETZKrXmC0P1lfGRZjPfltW+ZmPZ9Fat6J/XuSgQqCNUA+LetrL8x91RHvugv zrYs6rEy7pUYINW12MHBv1g== X-Received: by 2002:a05:600c:2551:: with SMTP id e17mr278411wma.128.1644312012046; Tue, 08 Feb 2022 01:20:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5lNmi4xAqUm5tiBTExXplbL6NdFsFgTIQrRS8fmKMWv51RJySMVDaU5Xnu+HnH2sBRA1jEA== X-Received: by 2002:a05:600c:2551:: with SMTP id e17mr278388wma.128.1644312011772; Tue, 08 Feb 2022 01:20:11 -0800 (PST) Received: from localhost (host86-134-151-224.range86-134.btcentralplus.com. [86.134.151.224]) by smtp.gmail.com with ESMTPSA id j19sm1727630wmq.17.2022.02.08.01.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 01:20:11 -0800 (PST) To: William Tambe , gdb-patches@sourceware.org Subject: Re: Can gdbserver tunnel stdout/stdin to/from gdb ? In-Reply-To: References: Date: Tue, 08 Feb 2022 09:20:09 +0000 Message-ID: <871r0daf5i.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" William Tambe via Gdb-patches writes: > Can gdbserver tunnel stdout/stdin to/from gdb so as to debug an > application as if it was executing on the machine running gdb ? I don't believe gdbserver itself supports this feature. The remote protocol doe have limited support for this using the File I/O extensions: https://sourceware.org/gdb/onlinedocs/gdb/File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension as far as I understand it though, this is mostly used when debugging devices that don't have their own console, so we have some support for allowing the target to print to gdb's console. Though I don't see why a bigger target couldn't make use of that extension - you'd just need a mechanism to intercept the syscalls at the remote end and have gdbserver forward them to gdb. The final thing that might be relevant to this topic, though clearly not what you're actually asking about, is the 'O' packet, which allows gdbserver to write messages to gdb's console. As I understand it, this is often used to allow things like monitor commands to print diagnostic output, but in general I think this is more for gdbserver itself (not the thing running under gdbserver) to communicate with the gdb user. Thanks, Andrew