From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 21:58:26 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 4270BE52; Mon, 21 Jul 2014 21:58:26 +0000 (UTC) Received: from mail-vc0-x235.google.com (mail-vc0-x235.google.com [IPv6:2607:f8b0:400c:c03::235]) (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 E40EB28F1; Mon, 21 Jul 2014 21:58:25 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id lf12so13181713vcb.12 for ; Mon, 21 Jul 2014 14:58:24 -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=R3dNuaCtpZ5oKp/hmIPR5Czkq7qMbKa7rHX/gmOl5vY=; b=f8KQ6YYUwRwx/V9wCuEtlGfOQ3lsXNPOx7+SgdoeR0cPKZps4p3o5yMwzZmTDlfuH3 jn1w2mgxIlrfM2pJXmbOY3upBKMD8PZbfT4UQmuhq92Y2hyibUE82PgZf17DSGcv4Vg9 AEXTNYsGZ4wuf/0iGYiEP57KYlHtFm9Tgl0BCXu25oPBrmOuQ8tdxikTcnyguO2qrn0j Bz3UXHW4Mt+i2x4uxJ/H43J6pu8t58V0LR5Z/AVD8ekyEb3zYu8r4i/gZ6ShG5ORP7if v+yEyBjURhYMG9VgjxKt2ls+fydrh0SjEXYEtzfguo6W9+gWuTiOab106aFCa7BRxodW JA9Q== MIME-Version: 1.0 X-Received: by 10.52.239.6 with SMTP id vo6mr13661096vdc.59.1405979904889; Mon, 21 Jul 2014 14:58:24 -0700 (PDT) Received: by 10.220.20.74 with HTTP; Mon, 21 Jul 2014 14:58:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 21 Jul 2014 14:58:24 -0700 Message-ID: Subject: Re: Remote kernel debugging question From: Nidal Khalil To: Benjamin Kaduk 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 21:58:26 -0000 Hi Ben, Yes I am familiar with the doc. As On Mon, Jul 21, 2014 at 2:55 PM, Benjamin Kaduk wrote: > On Mon, 21 Jul 2014, 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 >> How do I enable gdb backend. I appreciate the help. >> > > I do not think I have actually used remote GDB kernel debugging on my own > machines, but I wanted to make sure that you had seen the documentation for > doing so, available at http://www.freebsd.org/doc/en/ > books/developers-handbook/kerneldebug-online-gdb.html . If it is > incorrect, we should update it to be correct. > > Thanks, > > Ben Kaduk >