From owner-freebsd-hackers Thu Feb 7 3:32:45 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by hub.freebsd.org (Postfix) with ESMTP id A64CB37B42B for ; Thu, 7 Feb 2002 03:32:40 -0800 (PST) Received: from fwd06.sul.t-online.de by mailout09.sul.t-online.com with smtp id 16Ymn9-0005Pp-08; Thu, 07 Feb 2002 12:32:39 +0100 Received: from peedub.jennejohn.org (520017439985-0001@[217.235.123.237]) by fmrl06.sul.t-online.com with esmtp id 16Ymn1-1xgxv6C; Thu, 7 Feb 2002 12:32:31 +0100 Received: from peedub.jennejohn.org (localhost [127.0.0.1]) by peedub.jennejohn.org (8.11.6/8.11.6) with ESMTP id g17BWkL52065; Thu, 7 Feb 2002 12:32:48 +0100 (CET) (envelope-from garyj@peedub.jennejohn.org) Message-Id: <200202071132.g17BWkL52065@peedub.jennejohn.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.3 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: hackers To: Peter Jeremy Cc: freebsd-hackers@freebsd.org Subject: Re: Patching a kernel Reply-To: Gary Jennejohn In-reply-to: Your message of "Wed, 06 Feb 2002 07:37:13 +1100." <20020206073713.Z7444@gsmx07.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain Date: Thu, 07 Feb 2002 12:32:46 +0100 From: Gary Jennejohn X-Sender: 520017439985-0001@t-dialin.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Jeremy writes: > I'd like to patch a running kernel to disable an annoying non-rate-limited > message but gdb won't let me. (For various reasons, I don't want to have > to build a new kernel and reboot). > > aalp03# chflags noschg /kernel > aalp03# gdb -k /kernel /dev/mem > GNU gdb 4.18 > ... > IdlePTD 3457024 > initial pcb at 4d40000 > panic messages: > --- > --- > #0 0xc0159bf0 in mi_switch () > (kgdb) set write on > (kgdb) print {int}0xc01fffa4 = 0x00004eb8 > kvm_write:write failed > (kgdb) show write > Writing into executable and core files is on. > (kgdb) > > 0xc01fffa4 is in the kernel text area. > > This is 4.4-STABLE from mid-December running at securelevel -1. > > Is there any way around this? > RTFM :) You have to use the wcore option to turn on writing in kgdb mode. The ``show write'' command is totally unrelated to this and only shows what's set for _normal_ debugging. There's no way to tell from within gdb whether wcore was used or not. Unfortunately, the -w option is overloaded. Normally it means ``use a windowing system''. In FreeBSD it's an alias for wcore. --- Gary Jennejohn / garyj@jennejohn.org gj@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message