From owner-freebsd-current Wed Apr 2 12:36:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA22248 for current-outgoing; Wed, 2 Apr 1997 12:36:45 -0800 (PST) Received: from peedub.gj.org (ns1046.munich.netsurf.de [195.180.235.46]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA22221; Wed, 2 Apr 1997 12:36:31 -0800 (PST) Received: from peedub.gj.org (localhost [127.0.0.1]) by peedub.gj.org (8.8.5/8.6.9) with ESMTP id WAA01626; Wed, 2 Apr 1997 22:36:09 GMT Message-Id: <199704022236.WAA01626@peedub.gj.org> X-Mailer: exmh version 2.0gamma 1/27/96 To: "Peter M. Chen" Cc: freebsd-current@freebsd.org, freebsd-questions@freebsd.org Subject: Re: writing to kernel global variables with gdb Reply-To: Gary Jennejohn In-reply-to: Your message of "Tue, 01 Apr 1997 15:55:44 EST." <199704012055.PAA27208@life.eecs.umich.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 02 Apr 1997 22:36:08 +0000 From: Gary Jennejohn Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk "Peter M. Chen" writes: >Hi Gary, > Joerg referred me to you as the maintainer for kgdb. I am using >"gdb -w -k kernel.debug /dev/mem" to try to change a global variable on a >running kernel (which Joerg thought should work), but I get >"kvm_write:write failed". This is true even when I run as root. > > Any ideas? > it turns out that there's already a "w" option ("use windows") defined in main.c. There's no code which makes use of it. If you start gdb with -wcore, then you can write OK. The "w" window option isn't documented with the --help flag. But then again, the "w" make core writable option isn't either, although wcore does show up in the list. Perhaps it would be better to use "-wk" for "writable kernel" (that's sort of mnemonic) in place of "-w". Any opinions ? Guess this should really be documented somewhere. This affects both -current and 2.2.1R :( I'm forwarding this to both the current and questions mail lists, since it's (IMO) of general interest. --- Gary Jennejohn Home - Gary.Jennejohn@munich.netsurf.de Work - gjennejohn@frt.dec.com