> I compiled a simple device driver according to Device Driver Tutorial, and
> ran the mdb like below:
>
> #mdb -k
> >dummy`_init::nm
> Value          Size               Type   Bind   Other  Shndx Name
> 0xf9609c20|0x0000002a|FUNC|GLOB|0x0    |1        |dummy`_init
> >dummy`_init::bp
> mdb: failed to add breakpoint at 0xf9609c20: operation not supported by target
>
> I wonder why I can not set breakpoint to it? Is there any way that can make
> the target support the ::bp?

When you run mdb -k, you are debugging the live kernel for inspection only
(through /dev/ksyms and /dev/kmem): you are not actually controlling it.
If you want to set breakpoints and stop the live kernel, you need to use
kmdb instead.  The kmdb man page and Modular Debugger Guide explain how.

Short story is that you either boot -k or use mdb -K from the system console
to load and enter mdb.  And then use the syntax above.

-Mike

-- 
Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/

Reply via email to