|
The
ENTITY class (and each class derived from it) contains a method called
debug_ent that is called to dump the instance's data for debugging. The method
ENTITY::debug_ent is implemented as:
|
|
|
void ENTITY::debug_ent(FILE* fp) const
|
|
{
|
|
|
// Start with this entity's identifier
|
|
|
|
debug_header(this, fp);
|
|
|
|
// Now the entity data.
|
|
|
|
if (fp != NULL) {
|
|
|
|
debug_title("Rollback pointer", fp);
|
|
|
|
debug_pointer(rollback_ptr, fp);
|
|
|
|
debug_newline(fp);
|
|
|
}
|
|
|
|
debug_new_pointer("Attribute list", attrib(), fp);
|
|
|
|
// Put out anything from the unknown text.
|
|
|
|
text_ptr->debug_ent(fp);
|
|
}
|
|
|
This method calls several functions that dump data using
fprintf. For example:
|
|
|
void debug_title(char const* title, FILE* fp)
|
|
{
|
|
|
if (fp != NULL) {
|
|
|
|
if (title == NULL)
|
|
|
|
|
title = "";
|
|
|
|
fprintf(fp, "\t%-16.16s: ", title);
|
|
|
}
|
|
}
|
|
|
The following general debug routines are used by the
debug_ent methods to print out various types of values:
|
|
|
debug_dist
|
Prints a real representing a signed distance. It is considered to be zero if its magnitude is less than
SPAresabs.
|
|
|
debug_newline
|
Prints a new line character.
|
|
|
debug_norm
|
Prints a real representing a normalized, dimensionless quantity. It considered to be zero if its magnitude is less than
SPAresnor.
|
|
|
debug_pointer
|
Prints a pointer. By default, prints this as a relative address. If the option
debug_absolute_addresses is on, an absolute address is used.
|
|
|
debug_pointer_str
|
Prints a pointer as a string. By default, prints this as a relative address. If the option
debug_absolute_addresses is on, an absolute address is used.
|
|
|
debug_real
|
Prints a real number with appropriate precision.
|
|
|
debug_time
|
Prints the debugging time difference. This is the amount of time since the last call to this function or to the
debug_time_init function.
|
|
|
debug_time_init
|
Initializes the debugging time.
|