type
Gets and sets type properties
Format
TV::type action [ object-id ] [ other-args ]
Arguments
action
The action to perform, as follows:
commands
Displays the subcommands that you can use. The CLI responds by displaying these four action subcommands. Do not use other arguments with this option.
get
Gets the values of one or more type properties. The other-args argument can include one or more property names. The CLI returns these values in a list, and places them in the same order as the names you enter.
If you use the -all option instead of object-id, the CLI returns a list containing one (sublist) element for each object.
properties
Lists a type’s properties. Do not use other arguments with this option.
set
Sets the values of one or more type properties. The other-args argument contains paired property names and values.
object-id
An identifier for an object; for example, 1 represents process 1, and 1.1 represents thread 1 in process 1. If you use the -all option, the operation is carried out on all objects of this class in the current focus.
other-args
Arguments required by the get and set subcommands.
Description
The TV::type command lets you examine and set the following type properties and states:
enum_values
For an enumerated type, a list of {name value} pairs giving the definition of the enumeration. If you apply this to a non-enumerated type, the CLI returns an empty list.
id
The ID of the object.
image_id
The ID of the image in which this type is defined.
language
The language of the type.
length
The length of the type.
name
The name of the type; for example, class foo.
prototype
The ID for the prototype. If the object is not prototyped, the returned value is {}.
rank
(array types only) The rank of the array.
struct_fields
(class/struct/union types only). A list of lists that contains descriptions of all the type’s fields. Each sublist contains the following fields:
{ name type_id addressing properties }
where:
name is the name of the field.
type_id is simply the type_id of the field.
addressing contains additional addressing information that points to the base of the field.
properties contains an additional list of properties in the following format:
“[virtual] [public|private|protected] base class”
If no properties apply, this string is null.
If you use get struct_fields for a type that is not a class, struct, or union, the CLI returns an empty list.
target
For an array or pointer type, returns the ID of the array member or target of the pointer. For commands without this argument applied to one of these types, the CLI returns an empty list.
type
Returns a string describing this type; for example, signed integer.
type_values
Returns all possible values for the type property.
Examples
TV::type get 1|25 length target
Finds the length of a type and, assuming it is a pointer or an array type, the target type. The result might look something like:
4 1|12
The following example uses the TV::type properties command to obtain the list of properties. It begins by defining a procedure:
proc print_type {id} {
foreach p [TV::type properties] {
puts [format "%13s %s" $p [TV::type get $id $p]]
}
}
You then display information with the following command:
print_type 1|6
enum_values id image_id language length name prototype rank struct_fields target type type_values | 1|6 1|1 f77 4 <integer> 0 Signed Integer {Array} {Array of characters} {Enumeration}... |
|
|
|
|
|
|
|
|
|
|
|