Please enable JavaScript to view this site.

Memory Validator Help

Navigation: The User Interface > Settings > Global Settings Dialog > Data Display

Datatypes and Enumerations

Scroll Prev Top Next More

The Datatypes and enumerations tab allows you to:

 

scan headers to look for datatypes including typedefs, structs and enumerations

define or edit data not able to be determined automatically

 

The Show data at... feature of the Memory tab uses these definitions to inspect allocated memory using a meaningful interpretation of the data.

 

note If you don't define any datatypes or definitions here then memory inspection will just show the same format as the Show Data at (bytes)... option.

 

 

datatype-enumeration-settings

 

 

Edit datatypes... instructionStep shows the Datatypes dialog to edit existing datatypes or add new ones

 

Edit enumerations... instructionStep shows the Enumerations dialog to edit existing enums or add new ones

 

Scan for datatypes and enumerations... instructionStep shows the Scan for Datatypes dialog to extract definitions from header files

 

Reset datatypes and enumerations instructionStep clears any definitions previously defined or found in headers

 

noteDon't accidentally click the Reset button at the bottom of the page as that will reset all settings!

 

You can define standalone datatypes and enumerations, as well as those to be used in more complex datatypes.

 

noteMake sure you click OK not Cancel on the global settings dialog when you're done or you'll lose any changes.

 

Definitions will persist between sessions.

 

 

Datatypes Dialog

 

datatypes-dialog

 

 

Add... instructionStep shows the Define Data dialog to add a new definition
 

Edit... instructionStep opens the Define Data dialog to modify or just review an existing definition

 

Remove instructionStep removes any selected datatypes from the list

 

Byte packing instructionStep sets the number of bytes into which the datatype is to be packed and aligned

 

 

Enumerations dialog

 

The enumerations dialog is almost identical to the Datatypes dialog above:

 

enumerations-dialog

 

Add... instructionStep shows the Define Enumeration dialog to add a new definition

 

Edit... instructionStep opens the same dialog to modify or just review an existing enum

 

Remove instructionStep removes any selected enumerations from the list

 

 

Defining a new datatype

 

To define a new datatype you need to enter the name of the structure, and details about each member.

 

noteYou'll need to define any referenced types first before you define a structure that uses it.

 

We'll demonstrate the datatype definition with the following examples:

 

enum VehicleType
{
   VehicleType_Car   = 0,
   VehicleType_Bus   = 1,
   VehicleType_Van   = 2,
   VehicleType_Lorry = 3,

   VehicleType_Bicycle = 4,

   VehicleType_Motorbike = 5,

   VehicleType_Scooter = 6,

   VehicleType_Skateboard = 7
};

 

struct VehicleDataType
{
   int                     numWheels;
   char*                   strMake;
   double                  realEngineSize;
   enum VehicleType  enumType;
   CObject*          ptrOwner;
};

 

 

Edit datatypes... instructionStep Datatypes dialog instructionStep Add instructionStep shows the Define Data dialog

 

 

define-data-dialog

 

 

Name instructionStep specify the name of the datatype, VehicleDataType
 

Add instructionStep appends a new row to the data to define a new member
 

Double click to show the drop down list in the Type column if not already shown.

 
The list has many core datatypes and will include any datatypes you've already defined.

 

If the type is an enumeration, you'll be prompted for the name of the enumeration which you should have already defined.

 

enumeration-name-dialog

 

Enter the name of the data member in the Name column.

 

If more than one, Specify how many items the member represents in the Count column, e.g. for an array.

 

note Values in the Offset column will be calculated automatically.

 

Remove instructionStep removes any selected data members from the list
 

 

 

Defining a new enumeration

 

Edit enumerations... instructionStep Enumerations dialog instructionStep Add instructionStep shows the Define Enumeration dialog

 

define-enum-dialog

 

note Any enumerations defined here can be used in the Define Data dialog above.

 

Name instructionStep specify the name of the enum, VehicleType
 

Add instructionStep appends a new row to the data to define a new member
 

Enter the name of the member in the Enumeration column.

 

Set the corresponding value in the Value column

 

Remove instructionStep removes any selected members from the list
 

 

 

Scanning for datatypes

 

You can scan header files to find definitions for datatypes or enumerations which are not otherwise detectable.

 

Scan for datatypes and enumerations... instructionStep shows the Scan for Datatypes dialog

 

scan-for-datatypes

 

 

Browse... instructionStep type or browse to enter a directory or drive to scan for header files from which to extract datatypes

 

Leave this blank to scan all available drives.

 

Search... instructionStep start header file scanning

 

Stop instructionStep stop the search at any time

 

Cancel instructionStep discard the results of the search and close the dialog

 

Any datatypes found during the scan are added to the lists in the datatypes dialog or the enumerations dialog.

 

note At the time of writing, scans don't detect datatypes inside classes and 64 bit datatypes are not supported.

 

 

Reset All - Resets all global settings, not just those on the current page.

 

 

Reset - Resets the settings on the current page.