From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 21:56:03 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 5C52BC72 for ; Mon, 21 Jul 2014 21:56:03 +0000 (UTC) Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu [18.7.68.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F096E28D0 for ; Mon, 21 Jul 2014 21:56:02 +0000 (UTC) X-AuditID: 12074423-f79bf6d000007580-d6-53cd8c6a4a71 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 74.EB.30080.A6C8DC35; Mon, 21 Jul 2014 17:55:54 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s6LLts17015626; Mon, 21 Jul 2014 17:55:54 -0400 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6LLtqIP023713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 21 Jul 2014 17:55:53 -0400 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id s6LLtpdi020103; Mon, 21 Jul 2014 17:55:51 -0400 (EDT) Date: Mon, 21 Jul 2014 17:55:51 -0400 (EDT) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Nidal Khalil Subject: Re: Remote kernel debugging question In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBIsWRmVeSWpSXmKPExsUixG6nrpvVczbYYNdUA4vtm/8xWjx6foLR gcljxqf5LB47Z91lD2CK4rJJSc3JLEst0rdL4Mq48/s5S8EpzopP3QUNjLPYuxg5OSQETCR2 LV3ICGGLSVy4t56ti5GLQ0hgNpPE0pbtTBDORkaJU6t3sUM4h5gklq94zwzhNDBKLLs8hQWk n0VAW+L0m2usIDabgJrE473NrBBzFSU2n5oE1MDBISKgIvF2ej5ImFlAXuLC5kNgq4UFdCXW dk0AK+cUCJTonLeZDcTmFXCUePKtA2y8kECARPvy7cwgtqiAjsTq/RBreQUEJU7OfMICMdNS 4tyf62wTGIVmIUnNQpJawMi0ilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdMLzezRC81pXQTIziA XZR3MP45qHSIUYCDUYmH10L+bLAQa2JZcWXuIUZJDiYlUd6mTqAQX1J+SmVGYnFGfFFpTmrx IUYJDmYlEd4vzUA53pTEyqrUonyYlDQHi5I471trq2AhgfTEktTs1NSC1CKYrAwHh5IEr1E3 UKNgUWp6akVaZk4JQpqJgxNkOA/QcD+QGt7igsTc4sx0iPwpRkUpcV6/LqCEAEgiozQPrheW YF4xigO9IsybD9LOA0xOcN2vgAYzAQ0uyjwNMrgkESEl1cDYwefG917ptdfN7pKHm96vWqBj ZfGSu6I1/VuBf8Prw8VnuX9mMeX+qluc7tOl0zN9dmGAOLvH+8u/FhuUiwb7RYeaZwedmP24 XkL9joHqrOeaK/54JeaZOnAtPrbW0iz6l9COUyGHIvhulX3JY9lktvZ0cq0fR+7RQEHX6g2P H0saH3j5u1OJpTgj0VCLuag4EQDEmKJPCwMAAA== 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:56:03 -0000 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