From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 16 19:44:43 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188C0106564A for ; Sun, 16 Jan 2011 19:44:43 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id A277B8FC1C for ; Sun, 16 Jan 2011 19:44:42 +0000 (UTC) Received: by ewy24 with SMTP id 24so2319647ewy.13 for ; Sun, 16 Jan 2011 11:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9npoQVL9DnvBE1jMzWQdcYjcannbcYHlUoSm8YhPFaI=; b=ruVYkpR5CwymMs/0LUEbK6L3tvNh0PNXhhicQ0ebFla5jPKG8oAkmhKkoOqvh+92pA bAygvHU63UoHDB4laQqyXFo/VJnP4S5o/yQWWBST3Dxswifk+o+j3MSjj23xy/twYq2G G5xIG2KmTsJl0+4vNAeWcn4e7nw+u9w1Vu9Hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ZfLK+syC2TJCIpRV7+G0PbkP7SR05CUl735eR11hUP7HYVXazJoetBxaMWxZ7r4uDx lqZyZPkr5OwaJxTn7U/X6rRV6WofVXd2hwLOkAp6L+mNLKQE4Y/6+yn63hAl417yaKQU oSJF1yjSbESbq/ypOZrY5UM7Nn864Uc4Xi+FA= MIME-Version: 1.0 Received: by 10.213.20.78 with SMTP id e14mr2845419ebb.87.1295207081529; Sun, 16 Jan 2011 11:44:41 -0800 (PST) Received: by 10.213.22.14 with HTTP; Sun, 16 Jan 2011 11:44:41 -0800 (PST) In-Reply-To: References: Date: Sun, 16 Jan 2011 14:44:41 -0500 Message-ID: From: Ryan Stone To: Miki Magyari Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: problem debugging kernel module using kernel crash dump with kgdb X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 19:44:43 -0000 gcc has helpfully inlined minixfs_mountfs into minixfs_mount for you. kgdb, which is basically gdb patched to understand the structure of kernel cores, has no idea how to handle inlined functions. Sadly, you have only two options here that I'm aware of: 1) If the crash is reproducible, recompile you kernel with the attribute __attribute__((noinline)) attached to minixfs_mountfs's prototype. You should get a core that is possible to debug using kgdb. 2) If the crash is difficult to reproduce, the only thing I've been able to do in such a scenario is disassemble the function and try to work out where the variables I'm interested in are. This is extremely painful, so I'd suggest going with option 1 if it's at all feasible.