SYM: Symbol Object


Enumerations

enum  LEVEL_PINCLIENT::UNDECORATION {
  LEVEL_PINCLIENT::UNDECORATION_COMPLETE,
  LEVEL_PINCLIENT::UNDECORATION_NAME_ONLY
}

Functions

string LEVEL_PINCLIENT::PIN_UndecorateSymbolName (const string &symbolName, UNDECORATION style)
SYM LEVEL_PINCLIENT::SYM_Next (SYM x)
SYM LEVEL_PINCLIENT::SYM_Prev (SYM x)
const string & LEVEL_PINCLIENT::SYM_Name (SYM x)
SYM LEVEL_PINCLIENT::SYM_Invalid ()
BOOL LEVEL_PINCLIENT::SYM_Valid (SYM x)
BOOL LEVEL_PINCLIENT::SYM_Dynamic (SYM x)
ADDRINT LEVEL_PINCLIENT::SYM_Value (SYM x)
UINT32 LEVEL_PINCLIENT::SYM_Index (SYM x)

Detailed Description

SYMs are derived from ELF symbol records.

You must call PIN_InitSymbols to make symbols available.

Can be accessed at instrumentation time and analysis time.

Iteration idioms:

  // Forward pass over all symbols in an image
  for( SYM sym= IMG_RegsymHead(img); SYM_Valid(sym); sym = SYM_Next(sym) )

Availability:
Mode: JIT & Probe
O/S: Linux & Windows
CPU: All

Enumeration Type Documentation

enum LEVEL_PINCLIENT::UNDECORATION
 

List of supported symbol name undecoration styles. Used in PIN_UndecorateSymbolName()

Enumerator:
UNDECORATION_COMPLETE  Undecorate to full symbol signature.
UNDECORATION_NAME_ONLY  Undecorate to [scope::]name.


Function Documentation

string LEVEL_PINCLIENT::PIN_UndecorateSymbolName const string &  symbolName,
UNDECORATION  style
 

Undecorate symbol name.
Provides undecoration of C++ names and decorated C names. The behavior of this function
is compiler and OS specific.

C++ decorated name is undecorated either to full signature (UNDECORATION_COMPLETE style)
or to [scope::]name form (UNDECORATION_NAME_ONLY style).

Example of undecoration of symbol generated by Microsoft compiler in Windows:

  Style                   Original name        Undecorated name
  =====================   ==================   ======================================
  UNDECORATION_COMPLETE   ?foo@ccc@@QAEPADH@Z  public: char * __thiscall ccc::foo(int)
  UNDECORATION_NAME_ONLY                       ccc::foo

Symbol name decorated according to Windows IA32 C calling conventions is undecorated as follows:

  _foo     ->  foo    (__cdecl    convention)
  _foo@4   ->  foo    (__stdcall  convention)
  @foo@12  ->  foo    (__fastcall convention)

Parameters:
[in] symbolName Decorated name
[in] style Undecoration style, relevant only to C++ undecoration
Values:
UNDECORATION_COMPLETE undecorate to full signature
UNDECORATION_NAME_ONLY undecorate to [scope::]name
Returns:
string containing undecorated symbol name.
If undecoration fails or not supported, the function returns the unmodified original name.
Availability:
Mode: JIT & Probe
O/S: Windows
CPU: All

BOOL LEVEL_PINCLIENT::SYM_Dynamic SYM  x  ) 
 

Returns:
True if x is a dynamic symbol

UINT32 LEVEL_PINCLIENT::SYM_Index SYM  x  ) 
 

Returns:
section index of a symbol

SYM LEVEL_PINCLIENT::SYM_Invalid  ) 
 

Returns:
Used to indicate no symbol

const string& LEVEL_PINCLIENT::SYM_Name SYM  x  ) 
 

Returns:
Name of symbol

SYM LEVEL_PINCLIENT::SYM_Next SYM  x  ) 
 

Returns:
Routine that follows x, or SYM_Invalid() if x is the last in the section

SYM LEVEL_PINCLIENT::SYM_Prev SYM  x  ) 
 

Returns:
Routine that precedes x, or SYM_Invalid() if x is the first in the section

BOOL LEVEL_PINCLIENT::SYM_Valid SYM  x  ) 
 

Returns:
True if x is not SYM_Invalid()

ADDRINT LEVEL_PINCLIENT::SYM_Value SYM  x  ) 
 

Returns:
Value of symbol, usually an address relative to beginning of image


Generated on Tue Jan 13 03:10:49 2009 for Pin by  1.4.6