From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 22:44:24 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E764887A for ; Mon, 21 Jul 2014 22:44:24 +0000 (UTC) Received: from mail-vc0-x22a.google.com (mail-vc0-x22a.google.com [IPv6:2607:f8b0:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A43F52CFB for ; Mon, 21 Jul 2014 22:44:24 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id lf12so13373847vcb.29 for ; Mon, 21 Jul 2014 15:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FncwdxD+ujtI/UwAEt3B06EPDlMHqllKnEhwN+P92xY=; b=GhC21IhEspR7GiLTMnottM/e15gBMuYsPq189osAPnZ5MFgAtUfJiNOlPma3BxjJFO vNWdqtql0xvcNrvzUDe2x50GOHwe0LMMNq6Ync7N7wJ96Irf8fvZGrFOa4Jcpp0qtrZN rUApAdpKNhqullc5SQ3e8Ms6ZqXpc0n2M/ZzQ7cCD5kDQFvai/oLQbd6/LncNxxygi5W RamkZB/l0MFVm2yTHTXfgfb3UYDdYQIK8h+XFgR3bFirfn+hXDYPLdO4RFVxlE4N/qgE XLOMr9++KGdeI1QVVbKE4UcxbbJficteAzwCDgJ8dBwZcTQcrPSWS1/iXsmddCsvthou rHWw== MIME-Version: 1.0 X-Received: by 10.52.138.7 with SMTP id qm7mr29090329vdb.7.1405982663666; Mon, 21 Jul 2014 15:44:23 -0700 (PDT) Received: by 10.220.20.74 with HTTP; Mon, 21 Jul 2014 15:44:23 -0700 (PDT) In-Reply-To: <53CD96C9.2010600@gmail.com> References: <53CD92A8.5000201@gmail.com> <53CD96C9.2010600@gmail.com> Date: Mon, 21 Jul 2014 15:44:23 -0700 Message-ID: Subject: Re: Remote kernel debugging question From: Nidal Khalil To: Navdeep Parhar Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:44:25 -0000 No, I have not . It is hint.uart.0.flags="0x90" Thanks My question is how do I get gdb to show up as part of available debuggers in this node: debug.kdb.available: ddb Thanks Nidal On Mon, Jul 21, 2014 at 3:40 PM, Navdeep Parhar wrote: > On 07/21/14 15:35, Nidal Khalil wrote: > > The documentation states to put hint.uart.0.flags="0x90" in > > /boot/device.hits > > Putting it in device.hints should have worked too. In fact, that's > where uart(4) has it. You haven't spelled it "hits" on your filesystem > like you did here, have you? > > > However you hit on a good point. I see some parameters in > > boot/loader.conf. Can you please email this file > > I think that I need to do more configuration to this file. I will do it > > by comparison. Thanks > > That's all there was in the file. > > Regards, > Navdeep > > > > > Nidal > > > > > > On Mon, Jul 21, 2014 at 3:22 PM, Navdeep Parhar > > wrote: > > > > On 07/21/14 12:22, Nidal Khalil wrote: > > > Hello All, > > > I am somewhat new to BSD kernel but I am trying to debug a kernel > > module > > > using remote debugging. > > > I am using 9.2 RELEASE. > > > I setup and compiled the kernel with the following: > > > > > > makeoptions DEBUG=-g > > > options KDB > > > options KDB_TRACE > > > options DDB_CTF > > > options DDB > > > options GDB > > > options ALT_BREAK_TO_DEBUGGER > > > > > > I setup the uart for serial1 flags to 0x90 and I can read and > > write to the > > > serial from either machine > > > Both machines have the same kernel booted. > > > I can enter ddb but I can not launch gdb > > > The remote GDB backend could not be selected. > > > sysctl -a | grep debug.kdb > > > > > > debug.kdb.available: ddb > > > Is that correct or it should be: > > > debug.kdb.available: ddb gdb > > > > The latter. > > > > > How do I enable gdb backend. I appreciate the help. > > > > All this on a recent HEAD. If your problem is 9.2 specific then this > > may not help, but at least we can compare notes. You did say you set > > flags to 0x90 for your serial port but it's not clear how. I have > this > > in /boot/loader.conf: > > hint.uart.0.flags="0x90" > > > > When the system boots I see this right around when loader hands off > to > > the kernel. > > > > GDB: debug ports: uart > > GDB: current port: uart > > KDB: debugger backends: ddb gdb > > KDB: current backend: ddb > > Copyright (c) 1992-2014 The FreeBSD Project. > > ... > > > > After the system boots I see both ddb and gdb in the available debug > > backends and all is well. > > > > # sysctl debug.kdb.available > > debug.kdb.available: ddb gdb > > # sysctl debug.kdb.current > > debug.kdb.current: ddb > > # sysctl debug.kdb.current=gdb > > debug.kdb.current: ddb -> gdb > > # sysctl debug.kdb.current > > debug.kdb.current: gdb > > > > Regards, > > Navdeep > > > > > >