From owner-freebsd-hackers@FreeBSD.ORG Sun May 10 02:00:08 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD7862EF for ; Sun, 10 May 2015 02:00:08 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEBF61DFA for ; Sun, 10 May 2015 02:00:07 +0000 (UTC) Received: from [192.168.200.208] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 52157192906 for ; Sun, 10 May 2015 02:00:06 +0000 (UTC) Message-ID: <554EBBA5.9000303@ignoranthack.me> Date: Sat, 09 May 2015 19:00:05 -0700 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: How to get anything useful out of kgdb? References: <554E41EE.2010202@ignoranthack.me> <554E4BD1.1030802@ignoranthack.me> <406EAA27-D825-408B-985E-DC3FFE746473@frob.org> <554E5263.8010205@ignoranthack.me> <20150509190347.10e1e2c2@kan> In-Reply-To: <20150509190347.10e1e2c2@kan> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2015 02:00:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >> >> I'm guessing that the place to change -O2 -> -O0 is in >> kern.pre.mk ? >> >> sean > > No, it means you need to iescover DEBUG and how it affects > optimization level :) > > .if defined(DEBUG) _MINUS_O= -O CTFFLAGS+= -g .else ... > > Say, I have 'makeoptions DEBUG="-g -gdwarf-2"' in my kernel > config file. -gdwarf-2 is probably not required anymore. Indeed! :-) I was directed to go a slightly different way: make.conf: COPTFLAGS=-O0 CFLAGS=-O0 This makes unbootable kernels and they panic unless you defined the following in your kernel config: options KSTACK_PAGES=6 sean -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJVTruiXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kPtwIAIBLJNM3c8ml1+31ZAg7Z/tM xTLPBroxdO12GIAMniacX1A1YGDWbt+jGt9097Yzm7SWKFLa4cR/C62QqgwdwM6N XJDoh4Vyd+oaOou3zaLo2FSfMX9tS2TsVZOdl+aOU2D0qkgMZP/y2tt9j9tcLlUn rMg6uKI6JrUh4dHHuM2V5T8FC2t99JnJqPPPTrEdXoNrjMBU+5eAUiufvorQhAHF JkknzZ0BFOSfn+4M9YDyNVmlYX2qtX+6NudbxNAwrRCsgIAzVxWgQ875VqT1Pjov TggjbtnHF6d9CNHlQK0AKckXHDhSdECjQ4vcCtIKiniHtX46YxA8w2x9Id7dXM0= =wWUX -----END PGP SIGNATURE-----