Functions | |
This module contains routines and classes for the | handling (error) messages */namespace LEVEL_BASE |
|
Given a command line (sub)string, find and parse its first argument. Parsing rules (see MS CRT): File names =========== Quoted string -> non-quoted string (quotes are not copied) Regular argument ================ 2N backslashes + " -> N backslashes + begin/end quoted string (quote is not copied) 2N+1 backslashes + " -> N backslashes + literal " " + " in a quoted string -> single literal " all other combinations of symbols are copied as is
Empty Constructor Constructor. Construct an object from argc, argv and delimiter Example1: argc = 6, argv = {ab bc cd de ef de}, delimiter = "de" => the object will contain: argc = 4, argv = {ab bc cd de} Example2: argc = 6, argv = {ab bc cd de ef de}, delimiter = NULL => the object will contain: argc = 6, argv = {ab bc cd de ef de} Example3: argc = 6, argv = {ab bc cd de ef de}, delimiter = "fg" => the object will contain: argc = 6, argv = {ab bc cd de ef de}
NOTE: Use this function only for original application's command line
Initialize the object using argc, argv and delimiter Initialize the object using commandLine string Deallocate all resources used by current object Find array size using argc, argv and delimiter Remove argument by index (0 <= index < m_argc) < size of argv array < CHAR* array Set mode for printing of addresses, two formats are available either 0x12345678 or #1234_5678 ctype::isspace alternative (avoids complications from including ctype.h) ctype::toupper alternative (avoids complications from including ctype.h) print pointer convert a UINT64 into a string using the hex address format convert a UINT64 into a dec string. Padding can be specified as well convert a UINT64 into a dec string. Padding can be specified as well Convert an array of integers to string, separated by spaces. convert a UINT64 into a dec string with 1000 separation . Padding can be specified as well add new lines to string to make it fit given line width restrictions convert a UINT64 into a hex string. Padding can be specified as well convert a FLT into a string. Padding can be specified as well convert a BOOL into a string. convert a TRI into a string. convert a string to a UINT32 convert a string to a UINT64 convert a string to a FLT64 Convert specified character to the corresponding hexadecimal digit
popcount/bitcount code using the usual trick read a line from file while maintaining a current line count skiping over blank and comment lines. break a line into tokens separated by whitespace return them in 'array' x x x x x x x x x x x x x x x left justify string convert ADDRINT to "void *" convert "void *" to ADDRINT convert "void *" to ADDRINT Round integer of type <T> up to the next power of two.
Specialization of the RoundUp function for pointer type Round integer of type <T> up to given alignment. The alignment must be power of two. Specialization of the RoundUpPowerOf2 function for pointer type Round integer of type <T> down to given alignment. Specialization of the RoundDown function for pointer type Round integer of type <T> down to given alignment. The alignment must be power of two. Specialization of the RoundDownPowerOf2 function for pointer type Convert a pointer to an ADDRINT. Convert an ADDRINT to a pointer. convert "void *" to int integer bit width check Sign extend from origSize to extendedSize and check if it fits in a field of extendedSize
Specialization for optimization (1 byte data size). Specialization for optimization (2 byte data size). Specialization for optimization (4 byte data size). Specialization for optimization (8 byte data size). Function to incrementally construct a hash value.
another pin helper function for command line arguments Determine if the fileName has the BaseName baseNameToCheckFor On Windows comparison is case-insensitive, others are case sensitive
Return the entry point of a program (either that of the main image or of the dynamic loader) Concatenate two strings with a path delimiter Strip the path information Create a temporary file name
Return pointer whose offset, in bytes, from <ptr> is <offset> Push data into stack and return updated value of top of stack the stack is growing to the lower addresses
< function is currently running < function executed successfully < function executed but failed Deleter class. Defines a static templated method D::Delete(T *) for deleting objects of type <T>. Used as an argument in the COUNTED_PTR template. Deleter class. Defines a static templated method D::Delete(T *) for deleting arrays of of elements of type <T>. Used as an argument in the COUNTED_PTR template. Simple non-intrusive implementation of the reference counted (shared) pointer. The implementation does not guarantee neither thread safety nor exception safety. It defines only bare minimum of methods and operators. TEMPLATE ARGUMENTS: T - value type of this template. D - deleter class that defines a static method D::Delete(T *) for deleting objects or arrays of type <T>. OBJECT_DELETER and ARRAY_DELETER are examples of the deleter class. Constructors. WARNING: do not use the same raw pointer to construct more than one COUNTED_PTR object Destructor. Assignment. Accessors. Comparison. Total net bytes allocated by RawMmap and RawMunmap. This must be global because another stats are normalized to this value. The actual value is kept as a local variable in sysfuncs_* and updated by UpdateRawMmapBytes to avoid accessing this variable before the constructor has run. Total net bytes reserved. Unattributed allocations Get StatRawMmapBytes - the number of bytes allocated by Pin. Note that this returns bytes currently allocated, not all bytes that have ever been allocated. Basically, this value will rise and fall during execution. Update StatRawMmapBytes from a local variable. We can't update the stat directly in RawMmap because it might be called before the constructor for the stat has been executed. A function calling all malloc-related functions. Calling PullinPinMalloc() in pin and pinclient forces the dynamic loader to pull in the Pin's malloc. Find value of environment variable |