From owner-freebsd-fs@freebsd.org Thu Aug 24 08:25:07 2017 Return-Path: Delivered-To: freebsd-fs@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 A15A0DD96A7 for ; Thu, 24 Aug 2017 08:25:07 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0076F29E for ; Thu, 24 Aug 2017 08:25:06 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (124-148-71-183.dyn.iinet.net.au [124.148.71.183]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v7O8Ou7k014813 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 24 Aug 2017 01:24:59 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: Tips on remote debugging for filesystem code To: Aijaz Baig , freebsd-fs@freebsd.org References: From: Julian Elischer Message-ID: <046d8df4-71a6-65f5-18ad-50589d6d466d@freebsd.org> Date: Thu, 24 Aug 2017 16:24:50 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 08:25:07 -0000 On 24/8/17 1:40 pm, Aijaz Baig wrote: > I am trying to understand the internals of the VFS/VNODE interface in the > kernel and to that end I was attempting to go through the code flow. Hence > I hooked up two FreeBSD VMs, one as the server and the second as the client > using named pipes as serial ports. > > I put a breakpoint on say 'ufs_lookup' and I hit it by something as simple > as doing an 'ls' over a directory. Then I try to step through the code and > examine how the structures get populated and so on. However when I step > through the code on (K)GDB after a few lines of C code, the server VM (the > debugged machine) just kind of freezes while the client (on which GDB is > run is also waiting on the server) and thereafter I always have to restart > the server VM > > Am I doing something incorrectly? How do you guys normally do it? Keen to > hear tips and best practices > I have had more success recently using BHype to make a Virtual FreeBSD machine and connecting to it using the built-in gdb interface. Firstly it is easier than a serial interface and secondly you don't need two machines.