From owner-freebsd-net@FreeBSD.ORG Sat May 3 14:50:32 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 385DE1065671 for ; Sat, 3 May 2008 14:50:32 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by mx1.freebsd.org (Postfix) with ESMTP id E6E838FC0C for ; Sat, 3 May 2008 14:50:31 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so133122ywe.13 for ; Sat, 03 May 2008 07:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=LvPEoHMU8mN6cIxjhk+dVRciWbLQoYw6VA36Leqz4TI=; b=IWxNd/rigePmY+EgNMnq/xLG1fnT61YWcr9O6AexMCoY0bbbNJXv5T5RqyVP3rnAQboxTsfMleJ7RPVuGXKoGOm6V29RwkBVaBGE7m6LLR38TCz3su9pgqnu3ykpNnvCWUDeWNZIx1bLIbi3fQfP9ywSUNsb+5eOgbPnYqZj5Ys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ioG+D8pkC3aFyywKGmok3zcVnLq1wBEDXUzCypJd0cY7ThOzX20CF2S3H8hfyGLSClwxWs9h2KnbmV7Ru8HsDr+i5YiwISEtP+hrBiOn0ut59SfSjhsKD+nq1Sm7nl7RQSJU0VMfXwNKrj1+62t5lhjqJtSaDhKz4JHUqA0Rb5g= Received: by 10.150.202.14 with SMTP id z14mr4557665ybf.95.1209826231146; Sat, 03 May 2008 07:50:31 -0700 (PDT) Received: by 10.151.11.1 with HTTP; Sat, 3 May 2008 07:50:31 -0700 (PDT) Message-ID: <3c0b01820805030750k2fc389b0y500914c36069e6cf@mail.gmail.com> Date: Sat, 3 May 2008 10:50:31 -0400 From: "Alexander Sack" To: "David Christensen" In-Reply-To: <5D267A3F22FD854F8F48B3D2B523819324F09D6896@IRVEXCHCCR01.corp.ad.broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5D267A3F22FD854F8F48B3D2B523819324F09D65FA@IRVEXCHCCR01.corp.ad.broadcom.com> <3c0b01820805021315i482fe0acg3e9238a2f412770e@mail.gmail.com> <5D267A3F22FD854F8F48B3D2B523819324F09D6896@IRVEXCHCCR01.corp.ad.broadcom.com> Cc: "freebsd-net@freebsd.org" Subject: Re: Not All Symbols Present in a Loadable Kernel Module X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2008 14:50:32 -0000 On Fri, May 2, 2008 at 8:06 PM, David Christensen wrote: > > > I'm trying to build the "bce" driver as a kernel module under > > RELENG_7 but I'm > > > finding that not all of the functions in the driver are exported as > > symbols. This > > > makes it difficult to "call" a function from ddb because I get the > > error "Symbol > > > not found". I'm building and loading the driver from > > /usr/src/sys/modules/bce. > > > What am I doing wrong? How can I get all functions in the driver > > exported as > > > symbols usable by the debugger? > > > > Are you building a debug kernel or regular kernel? Have you turned on > > debug symbols? > > > > makeoptions DEBUG=-g # Build kernel with gdb(1) > > debug symbols > > > > Just a quick thought...I'm assuming these symbols are listed under > > your final kernel image (nm it etc.). > > Yes, I'm building a debug kernel. I have the line listed above as well > as the following: > > options KDB > options DDB > options GDB > options INVARIANTS > options INVARIANT_SUPPORT > options WITNESS > options WITNESS_SKIPSPIN Dave: What symbols can you not access exactly and how are you installing/setting up debugging? I just built a RELENG_7 with DDB and I'm able to access bce symbols without a problem. I can examine them and call them. I'm not using options GDB however, only KDB/DDB. I would: - Make sure you have the right if_bce.ko/if_bce.ko.symbols files generated/installed which contains the debug sections of your ko (from the objcopy calls during the build - the binary is stripped with a section pointer to the if_bce.ko.symbols file for debugging information I believe) - If you are using GDB, make sure its pointed to the right source base so it can retrieve symbol information correctly - If you are using GDB, stub it out and just use DDB to verify that your build is sane (it works for me!) - If all else fails, you can always build bce statically (just to move forward etc.) -aps