From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 22:40:11 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72D4464B for ; Mon, 21 Jul 2014 22:40:11 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (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 45A222C74 for ; Mon, 21 Jul 2014 22:40:11 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id bj1so10677676pad.11 for ; Mon, 21 Jul 2014 15:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=HG0p4RcadAa/fQyLIhTZtzqmG4ESZ35z5WfEj32fGYg=; b=Bpu9H8Gb7viRP2wXWyGaiqrR6L7Mk9sjEayLnXDQ2TZMJ2BaUBAjAwA7YNjJm6mPM5 4yiS5klVf2UqypNsMB2/Au2euaqm1FvOEZlds+CPla/Jx1ssxLOdutAgtTVQV+JteEQT zWv4eMJEO3P4RKI3IgDj+r5LRISaVUf+3cOvn7M5sRfqhHJJEn8jnCi9SWAV101eveob 3DgVo4io+tg6J59REY3emDZIjnslyLyv7tOE9HEUNC/WU14JtdzFMadyKKkcOcntQGbH SAYP2hbyFqbrZOfs1TR7ijBf+GZuZH+VL0CDBZn4z9pIR2H9+PA45qgA7fog5+es1i7i 27eQ== X-Received: by 10.68.252.7 with SMTP id zo7mr17717971pbc.102.1405982410917; Mon, 21 Jul 2014 15:40:10 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id kk3sm6405035pbc.51.2014.07.21.15.40.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jul 2014 15:40:10 -0700 (PDT) Message-ID: <53CD96C9.2010600@gmail.com> Date: Mon, 21 Jul 2014 15:40:09 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Nidal Khalil Subject: Re: Remote kernel debugging question References: <53CD92A8.5000201@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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:40:11 -0000 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 > >