lamo at ccs.ru wrote:
>Hello everyone:) > >I've got a couple of questions and I'll be very thankful if someone can shed a >light on these. > >1) For example, I want to print proc_t structure of process "bc" >I tried the following variant but stucked at the this stage > >::walk proc p |::print proc_t p_user.u_comm > >After that I've got result : >... >p_user.u_comm = [ "ttymon" ] >p_user.u_comm = [ "bc" ] >.... > > Did you already try '::ps ! grep bc' and then take the address just before the command name? >What dcmd should I use to search for "bc" and then get the pointer to its >proc_t structure back? >Or I have to use "|:: print -a proc_t p_user.u_comm" and then use sed or awk >to extract address and then pipe it again? > > > If you do just '::print -a proc_t', it lists out offsets of various fields. Note the offset for p_user.u_comm Deduct this offset from the address you get from your above dcmd and you will have the proc_t address corresponding to the cmd. -Surya >I think of using then ::eval<p=K to get back to "p" variable after the search. > > >2) Can someone explain the ::map syntax to me or point me when some examples >of this dcmd's usage can be found? > >OS: Solaris 9 > >TIA. >Best regards. > >Alexander. > >------------------------------------------------------------------------ > >_______________________________________________ >mdb-discuss mailing list >mdb-discuss at opensolaris.org > >