From owner-p4-projects@FreeBSD.ORG Wed Mar 10 09:24:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 40DFF16A4CF; Wed, 10 Mar 2004 09:24:27 -0800 (PST) Delivered-To: perforce@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 010A816A4D0; Wed, 10 Mar 2004 09:24:26 -0800 (PST) Date: Wed, 10 Mar 2004 07:24:26 -1000 From: juli mallett To: Marcel Moolenaar Message-ID: <20040310172426.GA75977@FreeBSD.org> References: <200403100801.i2A810eC071863@repoman.freebsd.org> <39071.1078906642@critter.freebsd.dk> <20040310161537.GA36028@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040310161537.GA36028@dhcp01.pn.xcllnt.net> User-Agent: Mutt/1.4.1i X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb X-Disclaimer: Opinions expressed about the deliciousness of eating brains are my own unless expressed by my employer. cc: Poul-Henning Kamp cc: Perforce Change Reviews Subject: Re: PERFORCE change 48556 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2004 17:24:27 -0000 * Marcel Moolenaar [ Date: 2004-03-10 ] [ w.r.t. Re: PERFORCE change 48556 for review ] > On Wed, Mar 10, 2004 at 09:17:22AM +0100, Poul-Henning Kamp wrote: > > In message <200403100801.i2A810eC071863@repoman.freebsd.org>, Marcel Moolenaar > > > Note that most #ifdef DDB instances have to be replaced > > > with #ifdef DEBUG, because DDB is specific to a single > > > back-end, not to having debugging support in general. A > > > new option, GDB, has been added to add support for gdb. > > > This has to be worked-out still. > > > > #ifdef DEBUG is a singulary bad choice since much code have private > > use of that macro. > > The point of using a define is to be able to get rid of the debugger > calls in production systems. It doesn't matter if DEBUG has private > meaning as long as it relates to having debugging code. Other than > that, anything else is fine too, as long as it's not DDB. I disagree. What if you are defining DEBUG and a file was once: #if DEBUG /* Ignore privlege elevation checks or something similarly * dangerous, in the hopes of figuring out what's going on * and then leave the system in a useless state so I can * debug my own code. */ #endif #if DDB /* For the average user, just show a warning and backtrace * to show me. */ #endif What PHK means is "#if DEBUG" is other people's macro, it's ambiguous, and it's not necessarily the sort of debugging you want to enable. As long as you're running with "kdb" why not: #if KDB #if KERNEL_DEBUGGER #if KERNEL_DEBUGGING #if KDEBUGGER -- juli mallett. jmallett@freebsd.org. adrift in the pacific.