From owner-freebsd-fs@freebsd.org Thu Aug 24 05:40:16 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 9325EDD68E7 for ; Thu, 24 Aug 2017 05:40:16 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1D36B445 for ; Thu, 24 Aug 2017 05:40:16 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id j62so1056494ith.1 for ; Wed, 23 Aug 2017 22:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jX3BUVu31pQJHmInOJbOe+3AN6J4jzmNoob5Ngls4a8=; b=cAbaN6/vPEY8zomx0WXFiNjQfjmEfsoURmlQT6Akg5PyGsuoffk80oCRuBc83LU3Wd 7Lke/bV1nIT89gXvSg8b50N5DMg33Gr/rHXBVPcDAnhnLgAK8jO1PvG6wnMJz/kFO+Gs NECo2XGY5qWdcg0baMC5JNfeaMFk9cKYPeQxY2GrN8nX6+3nnRAYbs/842SsJCnEr43Y uj5CTmJSGsyaK7HurVjpt71lUzTAyQf0oApdIZXebteFmzMqS/JJmNShUd3R4+Z5HNUQ UIgBPZaNBD81VPSSgJKU80ZaRyVogrsQh8/amqM2UOLXedLYqlREbZyJcNhURpFzgftB u8Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jX3BUVu31pQJHmInOJbOe+3AN6J4jzmNoob5Ngls4a8=; b=KTw88gkf4VAhlyUEj4BOK3qElP0pfHhv0Cqppnd7//OaqrY/5vKaMH4+JzzCxPFix+ lJLLlSRJQuCNmO5nJ55CTMdj4IK3DCauoxkueDHpzMs1CddeWuUnwq29d9fegyGrCzeD 8GDzSYJQ2uc8c5cq7egPGSvZpcKHRGlU8ZKqy5p88ZMTy1i8dPOm6j7/1Y3nX2NHY8sr Ohs3SFQ0HBJDQL7rIILoM2pbtUImfMKt5OqCGVuQTZQHVKOahdJDfwM8AWNAf7wY37Q1 jEmi1Fruxc7/eMIFaYCHW92BXBplyoK6N1cj3bhevXWfQ7TTIo+KPaucXYsu9NxAO3L2 kFTw== X-Gm-Message-State: AHYfb5gaELE24/qdwSCZcz4ez6JYbRI6dBzX6s30QB6DngNRkqDqnS6P 5XCrTIAbgUIZOPJzf9eoCGTK8f+rBA== X-Received: by 10.36.48.16 with SMTP id q16mr4793747itq.112.1503553215353; Wed, 23 Aug 2017 22:40:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.2.200 with HTTP; Wed, 23 Aug 2017 22:40:14 -0700 (PDT) From: Aijaz Baig Date: Thu, 24 Aug 2017 11:10:14 +0530 Message-ID: Subject: Tips on remote debugging for filesystem code To: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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 05:40:16 -0000 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 -- Best Regards, Aijaz Baig