From owner-freebsd-net@FreeBSD.ORG Mon May 5 16:27:22 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 39C0C106566B for ; Mon, 5 May 2008 16:27:22 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by mx1.freebsd.org (Postfix) with ESMTP id 091BB8FC12 for ; Mon, 5 May 2008 16:27:21 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from [10.11.16.99] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 05 May 2008 09:27:13 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id C33CB2B1; Mon, 5 May 2008 09:27:13 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id ACA9F2B0; Mon, 5 May 2008 09:27:13 -0700 (PDT) Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id GVS51604; Mon, 5 May 2008 09:27:13 -0700 (PDT) Received: from NT-IRVA-0751.brcm.ad.broadcom.com (nt-irva-0751 [10.8.194.65]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 33E5774CFF; Mon, 5 May 2008 09:27:13 -0700 (PDT) Received: from IRVEXCHHUB01.corp.ad.broadcom.com ([10.9.200.131]) by NT-IRVA-0751.brcm.ad.broadcom.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 5 May 2008 09:27:13 -0700 Received: from IRVEXCHCCR01.corp.ad.broadcom.com ([10.9.200.129]) by IRVEXCHHUB01.corp.ad.broadcom.com ([10.9.200.131]) with mapi; Mon, 5 May 2008 09:27:10 -0700 From: "David Christensen" To: "Alexander Sack" Date: Mon, 5 May 2008 09:27:10 -0700 Thread-Topic: Not All Symbols Present in a Loadable Kernel Module Thread-Index: AcitLROec8UcZgvYTCaLzY2hWtjZCQBmAlzg Message-ID: <5D267A3F22FD854F8F48B3D2B523819324F09D6A52@IRVEXCHCCR01.corp.ad.broadcom.com> References: <5D267A3F22FD854F8F48B3D2B523819324F09D65FA@IRVEXCHCCR01.corp.ad.broadcom.com> <3c0b01820805021315i482fe0acg3e9238a2f412770e@mail.gmail.com> <5D267A3F22FD854F8F48B3D2B523819324F09D6896@IRVEXCHCCR01.corp.ad.broadcom.com> <3c0b01820805030750k2fc389b0y500914c36069e6cf@mail.gmail.com> In-Reply-To: <3c0b01820805030750k2fc389b0y500914c36069e6cf@mail.gmail.com> Accept-Language: en-US Content-Language: en-US acceptlanguage: en-US MIME-Version: 1.0 X-OriginalArrivalTime: 05 May 2008 16:27:13.0105 (UTC) FILETIME=[DFC80C10:01C8AECC] X-WSS-ID: 6401EAEB4E0225277-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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: Mon, 05 May 2008 16:27:22 -0000 > > 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.) - Enable the kernel debugger as described above - Build the driver in the /usr/src/sys/modules/bce directory with the command "make". - Run the command "nm if_bce.ko | grep dump_stat" in the same directory with the kernel module just built. In my case I only see a symbol for bce_dump_status_block, but there is a second routine called bce_dump_stats_block. In my working build there are 23 functions that start with "bce_dump" but only 8 are displayed with the command "nm if_bce.ko | grep bce_dump". Of course, I also get the symbol not present error when I try to use any of those missing symbols through a "call" command in the debugger. Dave