type

Gets and sets type properties

Format:

TV::type action [ object-id ] [ other-args ]

Arguments:

action

The action to perform, as follows:

commands

Lists the subcommands that you can use. The CLI responds by displaying the four subcommands shown here. 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 property names you entered.

If you use the -all option as an 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 within 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 type properties and states. These states and properties are:

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 giving the description 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 a 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. If this is not 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 may look something like:

4 1|12

The following example uses the TV::type properties command to obtain the list of properties:

d1.<> \
proc print_type {id} {
    foreach p [TV::type   properties] {
        puts [format "%13s %s" $p [TV::type get $id $p]]
    }
} d1.<> print_type 1|6

enum_values
id
image_id
language
len.DefShortBody{
    margin-top:0.0in;
    margin-left:.65in;
}
gth
name
prototype
rank
struct_fields
target
type
type_values

1|6
1|1
f77
4
<integer>

0


Signed Integer
{Array} {Array of characters} {Enumeration}...

d1.<>

 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0