You're not redirecting stdin so mdb wouldn't see steps 2 through 6.

In ksh script you could do the following:

-------doit.ksh--------
#!/usr/bin/ksh

mdb ./a.out >./doit.out 2>&1 <<EOF
::sysbp _exit
:r
::log -d
:c
EOF
-------doit.ksh--------

peterte at planck: ./doit.ksh
peterte at planck:  cat doit.out
mdb: logging to "./mdb.out"
hello world!
mdb: stop on entry to _exit
mdb: target stopped at:
0xfee925ea:     addb   %al,(%eax)
mdb: target has terminated
peterte at planck:

I'm sure there are more elegant ways of doing this but hopefully this 
gets you going.
Cheers,
PT.

ajishrao wrote:
> Hi,
>      I am new to mdb, i am  trying to use mdb in shell script some this 
> like this
> 1) mdb ./a.out
> 2)::sysbp _exit
> 3)<addr>:b
> 4):r
> 5)<some commands> to store the output to file
> 6):c
> 
> -Ajish
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mdb-discuss mailing list
> mdb-discuss at opensolaris.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3253 bytes
Desc: S/MIME Cryptographic Signature
URL: 
<http://mail.opensolaris.org/pipermail/mdb-discuss/attachments/20081024/dbb430d8/attachment.bin>

Reply via email to