DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using SCODB on SCO OpenServer 5

Displaying symbol and expression types

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 varidef file, it will hold a default type:
   debug0:1> type u
   "u" is int
If it is in the varidef 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 varidef 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> type cdevsw
   "cdevsw" is int
   debug0:4> declare struct cdevsw cdevsw[3C]
   debug0:5> type cdevsw
   "cdevsw" is struct cdevsw [3C]
It is not necessary to specify number of elements when declaring an array.

Use undeclare to return the type of a symbol to its original state, if it is not in the varidef file:

   debug0:6> undeclare cdevsw
   debug0:7> type cdevsw
   "cdevsw" is int
This is usually done to free space in the declaration table.

undeclare can also be used to prevent SCODB from printing the return value after a function call. For example:

   debug0:8> patch_nop(&main)
   1
   debug0:9> declare void patch_nop()
   debug0:10> patch_nop(&main)
   debug0:11>
The same effect can be made more permanent by placing a void definition of the function in the SCODB extra file.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005