Subject: Re: how do I patch running kernel ?
To: Ronald Khoo <ronald@cpm.com.my>
From: Bakul Shah <bakul@netcom.com>
List: current-users
Date: 11/25/1994 12:41:08
I just write a small shell script for such things *when* I need
it.  This sort of patching is usually required for debugging
something so don't expect a standard utility!  If such a utility
were provided people *would* want to use it and when the variables
they have come to depend on and love disappear in a later version
of unix, they howl/groan/cry/beg/get angry/threaten.  It is not a
pretty sight.  With that out of the way, here is how I do it.

#! /bin/sh
case $# in
2)      var=$1;val=$2;;
*)      echo Usage: $0 var value';exit 1;;
esac
dbx -k /unix <<EOF
assign $var=$val
EOF

Replace dbx with a debugger of your choice; adjust the variable
assignment syntax accordingly.  If var is a complicated expression
you may need to quote it.

Bakul Shah