From owner-freebsd-hackers@freebsd.org Wed Nov 22 07:40:17 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5229BDE35FB for ; Wed, 22 Nov 2017 07:40:17 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9A970AA4 for ; Wed, 22 Nov 2017 07:40:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (125-209-148-40.dyn.iinet.net.au [125.209.148.40]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id vAM7e6nE028141 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Nov 2017 23:40:09 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: Is ddb(4) over a USB-to-Serial port possible? To: Farhan Khan , freebsd-hackers@freebsd.org References: <11ce9826-f768-3ea0-547d-2d182d1552f0@gmail.com> From: Julian Elischer Message-ID: <36165883-5cb7-aabc-c81e-cb5458029803@freebsd.org> Date: Wed, 22 Nov 2017 15:40:00 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <11ce9826-f768-3ea0-547d-2d182d1552f0@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 07:40:17 -0000 On 22/11/17 3:08 pm, Farhan Khan wrote: > Hi all > > I am reading here in section "10.5, On-Line Kernel Debugging User > Remote GDB" that you can run ddb(4) over a serial cable. I am > interested in setting this up. > > My development box does not have a serial port (however, I do see a > uart0 device in the kernel messages), so I attached a USB serial > port attached to a machine with a serial port. The device uses the > uslcom(4) driver and is listed as "Silicon Labs CP2102 USB to UART > Bridge Controller". When I enter ddb and enter "gdb" I receive the > error "The remote GDB backend could not be selected." > > The hint.uart.0.port in /boot/device.hints is still set to 0x3F8, > which corresponds to the aforementioned kernel messages. I am not > certain if this is the same port as the USB-based serial port. Does > this feature work over USB? > > Thanks, > Farhan Khan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > generally speaking the answer is no, unless the device is emulated using SMI or some other mechanism that is independent of FreeBSD. uart0 is not the device on the USB but a hardware device at 3F8, regardless of whether it actually exists. Since the USB stack is not really functional when in the debugger, it can not be used to communicate with the debugger. I find a better answer is to fire up the test machine under bhyve, in which case its console is accessible through any stream session. (e.g. ssh)..