Making a Callback for a Structure Element
You could also request that an addressing callback be made for a structure element. If you do, it is called when TotalView displays a specific instance of the type. You can do this if you:
- Specify the addressing of the field as callback in the type callback.
- Provide an address_callback on the structure prototype.
The address callback will be called with the following arguments:
- The type_id for the type.
- The address of the instance.
- The index of the field whose address is required.
The address callback should return either an address expression or an absolute address.
The following example does not create an addressing callback because the structure field's address does not depend on the specific instance of the structure. This means TotalView will have no problem evaluating it with own addressing expression.