Date: Fri, 23 Jul 1999 00:23:59 +1000 From: Bruce Evans <bde@zeta.org.au> To: cracauer@cons.org, current@FreeBSD.ORG Subject: Re: DDB: How to find address of static symbol? Message-ID: <199907221423.AAA25033@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907221423.AAA25033>
