[mdb-discuss] [networking-discuss] how to debug tcp init code?

2007-07-24 Thread zhijun
Very nice :-)  Thanks!

Zhijun
>> Hi folks,
>> One of my colleages met a panic at boot today,after he modified some
>> kernel code for tcp.The panic occurrs in 'unix' module,at which point
>> tcp is initialized.He would like to set a breakpoint at tcp init routine
>> for debugging, but as unix is loaded immediately after kmdb, we don't
>> have the chance to invoke kmdb at boot to set the breakpoint before tcp
>> init function is called,thus the panic happens every time.
>> Is there a way to set up a breakpoint early at boot such as this? If
>> this is not the case,which is the best way for debugging this kind of
>> problems?
>> 
michael schuster wrote:
> Have him add "-kd" to the kernel arguments, he should drop into kmdb 
> very soon and be able to set a breakpoint.
>
> HTH
>   
James C. McPherson wrote:
> boot with "-d" on the command line, so that you get
> thrown into kmdb immediately on boot. This allows
> you to set breakpoints.
>
> You will need to ensure that your console's keyboard
> is not attached with usb, because at the point when
> you land in kmdb the usb modules haven't been loaded
> yet so you are unable to type any keystrokes ;-)
>
>
>
> James C. McPherson
> --
> Solaris kernel software engineer
> Sun Microsystems
> ___
> mdb-discuss mailing list
> mdb-discuss at opensolaris.org
>   
-- next part --
An HTML attachment was scrubbed...
URL: 



[mdb-discuss] [networking-discuss] how to debug tcp init code?

2007-07-24 Thread michael schuster
zhijun wrote:
> Hi folks,
> One of my colleages met a panic at boot today,after he modified some
> kernel code for tcp.The panic occurrs in 'unix' module,at which point
> tcp is initialized.He would like to set a breakpoint at tcp init routine
> for debugging, but as unix is loaded immediately after kmdb, we don't
> have the chance to invoke kmdb at boot to set the breakpoint before tcp
> init function is called,thus the panic happens every time.
> Is there a way to set up a breakpoint early at boot such as this? If
> this is not the case,which is the best way for debugging this kind of
> problems?

Have him add "-kd" to the kernel arguments, he should drop into kmdb 
very soon and be able to set a breakpoint.

HTH
-- 
Michael SchusterSun Microsystems, Inc.
recursion, n: see 'recursion'