DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

NAME

ST - dump a structure in kcrash and kdb

SYNOPSIS

ST < source file >
st < structure name > < address >
sl < structure name > < address > < offset of link pointer >

DESCRIPTION

ST < file name > will use the named file for the structure dumping commands /crash/bin/kcrash.bin is the default for kcrash. In kdb and in kcrash with no argument, ST lists the structures that can be dumped.

st < structure name > < address > will print out the structure that starts at address with offset names and values

sl < structure name > < address > < offset of link pointer > will do the same as st. If you do not give an argument, sl will print out the structure at the location pointed to by *(address+offset).

SETUP

In order to use the commands ST, st and or sl in kcarsh or kdb, follow this sequence of steps:

   1)  Compile a source file with the appropriate include files which
       contain the structure definitions that are desired.  Use the
       -g option so that the structure definitions are included in the
       resulting binary.  NOTE: make certain that the appropriate
       defines are used for the kernel (i.e. -V -Xt -g -Kblended -Kk
       -D_KERNEL -O -DEISA -DAT386  -DWEITEK -DMERGE386 -DEVGA
       -DMP -DAIO -DPCAT -Di486)

   2)  Once the object or binary is compiled, run the command extstr.
       (Example:  extstr infile.o > strfile ).  This will extract the
       structure definition from the binary.


   3)  On the strfile from the extstr run the createbin command. Be sure 
       to make the /crash/bin directory first:  

          createbin strfile /crash/bin/kcrash.bin proc user as vnode inode ...

        This command creates the file /crash/bin/kcrash.bin which will
        contain the structures that were named on the command line.

    4) kcrash will read the kcrash.bin file when the st, ST or sl 
       commands are used. 

       To use these commands in kdb it is necessary to execute the 
       command :

           mkdbstr /crash/bin/kcrash.bin

       This loads the structure definitions into the kernel.

SUMMARY

* cc -g a kernel module
* run extstr to extract structure from the object file
* run createbin to create the .bin file
* use mkdbstr to load into active kernel for kdb
* dump structures using st and sl commands in kcrash and kdb
Typical output looks like this:
 S> ST

SEE ALSO

addbin, createbin(1), createbin(4), extstr, listbin, mkdbstr

APPENDIX A: Alphabetic Index of Macros