Previous - Up - Next

7.3   Argument Types

Following is a list of the available argument types. Note that some of them are "real" arguments, while some are generator functions which, when called with appropriate parameters, return an actual argument type.

addr_t

Accepts a target machine address, optionally with an address space prefix, such as v: for virtual addresses or p: for physical.

bool_t(true_str, false_str)

Accepts only the two strings true_str and false_str, the strings "TRUE" and "FALSE", and boolean values (that is, the strings "0" and "1"). It passes True or False to the command function depending on which string (or value) was given.

Both arguments are optional; if not given, TRUE, FALSE, 1, and 0 will still be recognized.

filename_t(dirs = 0, exist = 0, simpath = 0)

Generator function for filename arguments. If the dirs argument is zero (which is default), no directories will be accepted. The exist flag, when set, forces the file to actually exist. If simpath is true, files will be checked for existence using SIM_lookup_file(), searching the Simics search path. simpath implies exist. On Windows, if Cygwin path conversion is performed (see SIM_native_path() for details), the filename will be converted to host native format.

float_t

Accepts floating-point numbers.

int32_t

Accepts any integer that fits in 32 bits (signed or unsigned). The value passed to the command function is cast into an unsigned value.

int64_t

Accepts any integer that fits in 64 bits (signed or unsigned). The value passed to the command function is the value cast to unsigned.

int_t

Accepts any integer (regardless of size).

integer_t

Accepts any integer that fits in 64 bits (signed or unsigned). Corresponds to the Simics API's integer_t.

obj_t(desc, kind = None)

Returns an argument which accepts any object.

desc is the string returned as a description of the argument. kind can be used to limit the accepted objects to only allow objects of a certain kind. This parameter can either be a class name that the object should be an instance of, or the name of an interface that the object must implement.

range_t(min, max, desc, positive = 0)

Returns an argument which accepts any integers x, such that min <= x <= max. desc is the string returned as a description of the argument.

If positive is true, any negative values will be "cast" into positive ones using the formula max + v + 1, where v is the negative value.

sint32_t

Accepts any signed integer that fits in 32 bits.

sint64_t

Accepts any signed integer that fits in 64 bits.

str_t

Accepts any one word or quoted string.

string_set_t(strings)

Accepts only strings from the given set. strings can be any iterable, such as a tuple, list, or set, in which case the return value is the exact string the user gave; or a dictionary mapping acceptable user input strings to return values.

The optional parameter visible is a list of strings. If given, only strings in this list will be suggested by the expander.

uint32_t

Accepts any unsigned integer that fits in 32 bits.

uint64_t

Accepts any unsigned integer that fits in 64 bits.

Previous - Up - Next