|
|
Use the type command to display the type of an expression or the declared type of a symbol. Using the declare and undeclare commands to display the type modified or reset:
type expression /* Show type of expression */ declare C declaration... /* Give a system variable a type */ undeclare [*|variables...] /* Undeclare system variables */It can be useful to determine the type of an expression in case there is some question. For instance, if a symbol is not in the kstruct file, it will hold a default type:
debug0:1> type u
"u" is int
If it is in the kstruct file,
it is shown with the proper type:
debug0:2> type u
"u" is struct user
If the type of a symbol is not included
in the kstruct file
and it would be useful to use the symbol properly,
use the declare command
to override the original type assigned to the symbol:
debug0:3>It is not necessary to specify number of elements when declaring an array.type cdevsw
"cdevsw" is int debug0:4>declare struct cdevsw cdevsw[3C]
debug0:5>type cdevsw
"cdevsw" is struct cdevsw [3C]
Use undeclare to return the type of a symbol to its original state, if it is not in the kstruct file:
debug0:6>This is usually done to free space in the declaration table.undeclare cdevsw
debug0:7>type cdevsw
"cdevsw" is int
undeclare can also be used to prevent SCODB from printing the return value after a function call. For example:
debug0:8>The same effect can be made more permanent by placing a void definition of the function in the SCODB extra file.patch_nop(&main)
1 debug0:9>declare void patch_nop()
debug0:10>patch_nop(&main)
debug0:11>