Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 1995 16:30:56 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        fenner@parc.xerox.com, freebsd-hackers@FreeBSD.org
Subject:   Re: How do I set a kernel variable?
Message-ID:  <199504210630.QAA11488@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Under Sunos, I do

>adb -w -k /vmunix /dev/mem
>mrtdebug/W1

>Under FreeBSD, I do

>gdb -k /kernel /dev/mem
>kgdb> set mrtdebug = 1
>kvm_write:write failed
>kgdb> p mrtdebug
>$1 = 0

I normally use ddb.

gdb just seems to be braindamaged and buggy here.  Braindamaged: it has
its own kvm_write() which is quite different from the library kvm_write(),
and the error message doesn't give the errno.  (The errno is actually
EBADF, which is surprising considering that an lseek on the bad fd has
just succeeded.)  Broken: the fd used is for /dev/kmem.  kvm_read() is
quite differently, and reads from the correct fd (the core_kd arg),
and seems to work.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504210630.QAA11488>