From owner-freebsd-hackers@freebsd.org Thu Nov 23 22:34:42 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 253BADF7202 for ; Thu, 23 Nov 2017 22:34:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB8AC7D719 for ; Thu, 23 Nov 2017 22:34:41 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id y80so19196389wmd.0 for ; Thu, 23 Nov 2017 14:34:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a7ypo0no3x0gjdOi2vQ0MEOPKWLEo3sLv7ZpzL0Uhzo=; b=PRVkpbk4vSlDZobPqQ+sZtDj9JZ+j3C6H/REM3oai7FjKXIdXTTrEXuDuqAjinSllF C/aJL5tQdOoKiy3aZJMemPFU0RhmGr0F+oU4sRUmErO/0wClceVu6WoKx1QUQ1AgS+5Q iBnit1mJO1dqTYq+N1J2JlZIV5NVq5zplqvwFvENipCkaiDh5rNfREDBZFN5cMRh11as XTVZwmmo0glYvWh/WZvb3Z7Msh0AFKJEIouaSQSKdPQ64KB6YIjnUoTiXco0ibi3WM8W K3/r5owTtoFmNZveMIot7UzsJDQSQvMIRsaLDWVTP5kid1PqnGoopVI360cq0kim8Svn pRdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a7ypo0no3x0gjdOi2vQ0MEOPKWLEo3sLv7ZpzL0Uhzo=; b=iUYoqwVId/PE7r1ZzSb4N55psMga9tWkUcHf0WlxGzonphuCJKPxdtadCvhe7BwRlc 8OgDCEgiMw8puoKW+aE+sCVSc7qmjk2182ZOExnO+Fd6cEn9gMZ1ufYEE+8ZyHg+shyP K2/u/KZNEmvPG+T9PUQchcDKOLWRxLccSzvZR9l3W98ISsQDSq3HFkvFmYyTzRF5B93M 3+mZxltpVaCimaWb40TdUxfcx0KGb0MNrRqW93wRjRNu4B4McatLTxj0ndHAv9S+9Eoo hrgNAGfKddB5tFf6Lpq4vD/NA/2MgjEB0EE6HFEpfhqQ5AZHlqy+lSjL9Z1JcoZcu+9Q 8xzA== X-Gm-Message-State: AJaThX7uYi2LUbLKhSfjPvHBHYq4teXhlXKtJP37/t+ggSNlLSwhQ2S9 jfP++0oaqenvEmdep54W3JgoonjpUnmXD6uceZu0Nw== X-Google-Smtp-Source: AGs4zMaL/+aRmUz6uurHglqnA7P4TeeZcs2Os6b7hJjTJZ0A9AwhPIV53NQEtKA8oUVmZ/FpTkiautHV5HisEpeyrmc= X-Received: by 10.80.145.195 with SMTP id h3mr37846934eda.240.1511476480055; Thu, 23 Nov 2017 14:34:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.149.174 with HTTP; Thu, 23 Nov 2017 14:34:39 -0800 (PST) In-Reply-To: References: <11ce9826-f768-3ea0-547d-2d182d1552f0@gmail.com> <36165883-5cb7-aabc-c81e-cb5458029803@freebsd.org> <5c6da274-102c-33c6-50f0-20597cf8e7ef@selasky.org> From: Oliver Pinter Date: Thu, 23 Nov 2017 23:34:39 +0100 Message-ID: Subject: Re: Is ddb(4) over a USB-to-Serial port possible? To: Hans Petter Selasky Cc: Julian Elischer , Farhan Khan , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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: Thu, 23 Nov 2017 22:34:42 -0000 On Thursday, November 23, 2017, Hans Petter Selasky wrote: > On 11/23/17 16:59, Julian Elischer wrote: > >> On 22/11/17 4:33 pm, Hans Petter Selasky wrote: >> >>> On 11/22/17 08:40, Julian Elischer wrote: >>> >>>> 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).. >>>> >>>> >>> Hi, >>> >>> There is another setting for this: >>> >>> Try setting cons_baud and cons_unit below. USB serial supports polling >>> from the debugger after panic. >>> >>> hw.usb.ucom.cons_baud: 9600 >>> hw.usb.ucom.cons_subunit: 0 >>> hw.usb.ucom.cons_unit: -1 >>> hw.usb.ucom.debug: 0 >>> hw.usb.ucom.pps_mode: 0 >>> >>> wow.. I will need to try this when I have the appropriate setup. >> is this in the kenv? is it in loader.conf or sysctl.conf? >> >> > Hi, > > /boot/loader.conf > > or > > kenv > > or > > sysctl > > Before attaching the device. Could we somehow change these after attached device? Ergo could we setup two USB context, one for normal operation and one for the debugger? > > --HPS > > _______________________________________________ > 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" >