OpenSolaris

You are not signed in. Sign in or register.

Heads-up: mdb ::print enhancements

Date: Thu, 24 Aug 2006 14:55:22 -0700
From: Jonathan Adams <jonathan.adams at sun dot com>
To: on-all at eng dot sun dot com, onnv-gate at onnv dot eng dot sun dot com
Subject: Heads-up: mdb ::print enhancements

My recent putback of:

4949088 ::print would be more useful with a couple more options

into build 48 changes ::print in two ways:

	1.  ::print now behaves well when its output is directed to a pipe.
	    Formerly, if you tried to ::print a structure member that itself
	    is a structure or array, you'd get an error:

		> 6000281f800::print proc_t p_user | ::print user_t u_finfo
		mdb: syntax error on line 1 of (pipeline) near "{"
		> 

	    after this fix, this works as you'd expect;  the address is
	    passed down the pipeline:

		> 6000281f800::print proc_t p_user | ::print user_t u_finfo
		{
		    u_finfo.fi_lock = {
		        _opaque = [ 0 ]
		...

	    In addition, if you pass the "-a" flag, ::print will always pass
	    the address down the pipeline.

	2.  ::print now has a '-s' option, which specifies the maximum
	    depth to print out details in.  For example:

		> ::print -s 0 -t siginfo_t
		siginfo_t { ... }
		> ::print -s 1 -t siginfo_t
		{
		    int si_signo 
		    int si_code 
		    int si_errno 
		    int si_pad 
		    union  __data { ... }
		}
		> ::print -s 2 -t siginfo_t
		{
		    int si_signo 
		    int si_code 
		    int si_errno 
		    int si_pad 
		    union  __data {
		        int [60] __pad 
		        struct  __proc { ... }
		        struct  __fault { ... }
		        struct  __file { ... }
		        struct  __prof { ... }
		        struct  __rctl { ... }
		    }
		}
		> 

	    which is nice for cutting down on uninteresting output.

Enjoy!

- jonathan


-- 
Jonathan Adams, Solaris Kernel Development