Debugging any_regular_t and short names
Debugging the any_regular_t type can be problematic if you don’t know what the data type of the value stored in it is. To make it simpler for to view an any_regular_t in the debugger, release 1.0.41 contains a four character short name for the type which is stored at the top of the vtable.
The structure of an any_regular_t is a pair of doubles, the first word of the first double contains a pointer to a vtable.
| double | double | |
|---|---|---|
| vtable* | pad (on 32 bit machines) | data or data* |
The first word of the vtable contains a version number on release builds (currently 1) and a short name (a four character constant) on debug builds.
| version or short name |
| ... proc pointers ... |
By convention, the four character codes are stored in little endian order (so as to be readable in the debugger when viewing memory) -
| 'd' | 'i' | 'c' | 't' | (remainder of word is zeros on 64 bit machine) |
Also by convention, ASL will only use lower case letters in their short names - clients are free to use upper case letters. Note that the short name facility is to aid debugging only. it is not intended as a unique name for every type.
You can define a name for your own type using the ADOBE_SHORT_NAME_TYPE() macro in the global scope defined in <adobe/typeinfo.hpp>. For example:
namespace my_space {
class my_class { };
} // namespace my_space
ADOBE_SHORT_NAME_TYPE('M','y','C','l', my_space::my_class);
Once defined, a short name for a particular type can be referred to using the short_name type function:
cout << adobe::short_name<double>::value;
The following is a list of the short names for the CEL types defined in ASL:
| type | name |
|---|---|
| double | dble |
| bool | bool |
| empty_t | emty |
| array_t | arry |
| dictionary_t | dict |
| string_t | strg |
| name_t | name |
In addition, the following short names are defined though these won’t typically appear in an any_regular_t:
| type | name |
|---|---|
| string16_t | st16 |
| int | int_ |
| short | short |
| unsigned int | uint |
| unsigned short | ushr |
| unsigned long | ulng |
| char | char |
| signed char | schr |
| uchar | uchr |