From owner-freebsd-hackers Mon Sep 30 11:22:11 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA15572 for hackers-outgoing; Mon, 30 Sep 1996 11:22:11 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA15478 for ; Mon, 30 Sep 1996 11:22:04 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id UAA28119; Mon, 30 Sep 1996 20:21:42 +0200 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id UAA26747; Mon, 30 Sep 1996 20:21:41 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id UAA13084; Mon, 30 Sep 1996 20:19:02 +0200 (MET DST) From: J Wunsch Message-Id: <199609301819.UAA13084@uriah.heep.sax.de> Subject: Re: device driver optimization To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Mon, 30 Sep 1996 20:19:02 +0200 (MET DST) Cc: ajones@ctron.com (Alexander Seth Jones) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <324FDFC8.150F@ctron.com> from Alexander Seth Jones at "Sep 30, 96 10:57:12 am" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Alexander Seth Jones wrote: > I'm writing a device driver that works as expected when I compile with > the "-g" option, but as soon as I compile with "-O" it no longer works > as expected. > > Is there a good, systematic way to approach solving this? I could > examine the assembly code between the two versions, I guess, but I was > hoping there was a better way. Compile with -g and -O, run strip -d on /kernel after installing it, read carefully the handbook section about kernel debugging, and do your best. (Recently, Julian Elischer has also sent a description on how to run gdb on-line on a kernel. This is not yet in the handbook.) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)