build_struct_­transform ­Function
The build_struct_transform routine used in the example in the previous section is a Tcl helper function that builds the callbacks and addressing expressions that TotalView needs when it transforms data. It has two required arguments: name and members.
name Argument
The name argument contains a regular expression that identifies the structure or class. In this example, struct is part of the identifier’s name. It does not mean that you are creating a structure. In contrast, if stuff is class, you would type:
name {^class stuff$}
If you use a wildcard such as asterisk (*) or question mark (?), TotalView can match more than one thing. In some cases, this is what you want. If it isn’t, you need to be more precise in your wildcard.
members Argument
The members argument names the elements that TotalView will include in the information it will display. This argument contains one or more lists. The example in the previous section contained three lists: year, pName, and pStreet. Here again is the pName list:
{ pName { * pName } }
The first element in the list is the display name. In most cases, this is the name that exists in the structure or class. However, you can use another name. For example, since the transformation dereferences the pointer, you might want to change its name to Name:
{ Name { * pName } }
The sublist within the list defines a type transformation expression. These expressions are discussed in the next section.