From owner-freebsd-hackers Mon Nov 6 2:59:26 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from web3507.mail.yahoo.com (web3507.mail.yahoo.com [204.71.203.74]) by hub.freebsd.org (Postfix) with SMTP id 5E24A37B479 for ; Mon, 6 Nov 2000 02:59:24 -0800 (PST) Message-ID: <20001106105924.9983.qmail@web3507.mail.yahoo.com> Received: from [196.7.146.6] by web3507.mail.yahoo.com; Mon, 06 Nov 2000 02:59:24 PST Date: Mon, 6 Nov 2000 02:59:24 -0800 (PST) From: Jacques Fourie Subject: Debugging KLD's To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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