[dtrace-discuss] Quick quesion

陶捷 Tao Jie eulertao at gmail.com
Sun Jul 29 20:41:40 PDT 2007


Hi, Vivek:

These 2 addresses are inside the process of your program, and they are
determined by the OS (unix and rtld) and are valid on the fly.
I don't think you need to mdb step-by-step.
Suppose your program looks like:

... function (...)
{
......
ioctl(12, 0x04C9, 0xFE97B83C)
......
}

After compiling this program, dump the elf program. You could find a useful
addresses: the address of calling ioctl

You can stop at this address directly and print the structure that you are
interested.


Regards,
TJ

2007/7/30, Vivek Joshi <techvbj at gmail.com>:
>
> Thanks TJ! I tried to print the structure using addr::print struct
> uscsi_cmd but the address is null ..
>
> > 0xFE97B83C/J
> mdb: failed to read data from target: no mapping for address
> 0xfe97b83c:
> > 0xFE97B924/J
> mdb: failed to read data from target: no mapping for address
> 0xfe97b924:
> >
>
> I want to print this structure during the execution of the program sothat
> I get a valid address. I don't want to set break points and do a
> step-by-step. It'll be too time consuming :-)
>
> Or did I miss something?
>
> Thanks again!
>
> Cheers,
> Vivek
>
>
>  On 7/30/07, 陶捷 Tao Jie <eulertao at gmail.com > wrote:
>
> >  mdb
> > DTrace is used when you know the internal structure, while MDB can show
> > the internal structure to you in the case of only knowing the structure
> > name.
> >
> > Another way, download a copy of the ON source code and use cscope or
> > ggrep.
> >
> >
> > Regards,
> > TJ
> >
> > 2007/7/29, Vivek Joshi <techvbj at gmail.com>:
> > >
> > >
> > > Hi,
> > >
> > > How can I print the structure contents using DTrace ...
> > >
> > > For example, here is the truss output while execution of my program,
> > > /90:    ioctl(12, 0x04C9, 0xFE97B83C)                   = 0
> > > /90:    ioctl(12, 0x04C9, 0xFE97B924)                   Err#5 EIO
> > >
> > > The third field above is 'struct uscsi_cmd'. I am not sure why the
> > > second ioctl is failing, I want to confirm that scsi cdb is formed
> > > correctly in this case. How can I print this structure in parallel
> > > while running the program?
> > >
> > > Thanks for the inputs.
> > >
> > > Cheers,
> > > Vivek
> > > _______________________________________________
> > > dtrace-discuss mailing list
> > > dtrace-discuss at opensolaris.org
> > >
> >
> >
> > _______________________________________________
> > dtrace-discuss mailing list
> > dtrace-discuss at opensolaris.org
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070730/6a719691/attachment.html 


More information about the dtrace-discuss mailing list