From owner-freebsd-current Thu Jul 22 7:24:26 1999 Delivered-To: freebsd-current@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 2761314DAF for ; Thu, 22 Jul 1999 07:24:21 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id AAA25033; Fri, 23 Jul 1999 00:23:59 +1000 Date: Fri, 23 Jul 1999 00:23:59 +1000 From: Bruce Evans Message-Id: <199907221423.AAA25033@godzilla.zeta.org.au> To: cracauer@cons.org, current@FreeBSD.ORG Subject: Re: DDB: How to find address of static symbol? Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >I want to examine and switch a variable in ddb. The variable is static >to a source file, I don't have a symbol in ddb. You should have static symbols in ddb, except in the following broken cases: 1) elf kernel booted with -d. There are no symbols at the initial breakpoint because elf symbols are loaded by a sysinit. 2) elf kernel booted directly by boot2. Static symbols require special handling which seems to only be done in boot/loader. I don't use boot/loader, so I had to fix this. I use the pre-kld method of loading elf symbols (ddb/db_elf.c). This also fixes (1). It probably breaks symbols in modules. >I see the address of the symbol with `nm /kernel | grep symname`, but >the addresses listed here are obviously subject to file-specific >offsets. The addresses show up twice and I can verify that the data is >wrong when I just use the hex address in ddb. The symbol values are offset in the file. but not in memory. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message