From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23336 invoked by alias); 20 Feb 2015 14:27:29 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 23302 invoked by uid 89); 20 Feb 2015 14:27:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f174.google.com Received: from mail-qc0-f174.google.com (HELO mail-qc0-f174.google.com) (209.85.216.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 20 Feb 2015 14:27:26 +0000 Received: by qcvs11 with SMTP id s11so861073qcv.8 for ; Fri, 20 Feb 2015 06:27:24 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.129.65 with SMTP id 62mr24364989qhb.11.1424442444514; Fri, 20 Feb 2015 06:27:24 -0800 (PST) Received: by 10.140.20.228 with HTTP; Fri, 20 Feb 2015 06:27:24 -0800 (PST) In-Reply-To: References: Date: Fri, 20 Feb 2015 14:27:00 -0000 Message-ID: Subject: Fwd: Can GDB interact with serial ports on remote targets? From: Brendan J To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-02/txt/msg00032.txt.bz2 I am using GDB to debug a remote target: I start GDB then type `target remote foo:1234`. I do I/O with the target via a serial port. So I have to have two terminals open: one with picocom (connected to something like /dev/ttyUSB0) and one with GDB (connected to OpenOCD via a socket). To be clear: the debug connection is *not over the serial port*, it's over a totally separate JTAG interface. As you know, when you debug a "normal" (i.e. not "remote") inferior in GDB, its stdin and stdout are multiplexed into GDB's TTY so that you can interact with it while it's running [1]. Is it possible to achieve that for a remote target - that is: can GDB connect to the serial port itself so I can do I/O with the target from within the GDB session? If not, is this something that might be feasible? Maybe GDB could multiplex its I/O so that while the inferior is running it passes characters to/from an external tool like picocom? (As you can see I'm fairly ignorant about this whole issue at the moment). Thanks, Brendan PS: I'm using arm-none-eabi-gdb, in case that happens to be relevant. [1] https://sourceware.org/gdb/onlinedocs/gdb/Input_002fOutput.html