Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Nov 2000 02:59:24 -0800 (PST)
From:      Jacques Fourie <jacques4i@yahoo.com>
To:        freebsd-hackers@freebsd.org
Subject:   Debugging KLD's
Message-ID:  <20001106105924.9983.qmail@web3507.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi

I am using the following method to debug a KLD on 4.1
using gdb remote debugging:

- Add makeoptions DEBUG=-g to the kernel config
- Compile the KLD with -ggdb
- Use objdump -h to get the offset of .text in the
KLD.
- Add this value to the value reported by kldstat and 
 use this as offset for the gdb add-symbol-file
command.

The problem is that variable values reported by gdb
seems to be total garbage. If I add explicit printf's
in the C code, the value printed on the console is
correct but the values given by gdb are totally
different. Everything else seems to be working - I can
do a break <function_name_in_kld> and the breakpoint
will be set correctly.

Any help will be greatly appreciated.

jacques

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001106105924.9983.qmail>