klMatrix
Data Structures | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
klStackWalkBase Class Reference

#include <kl_stack_walker.h>

Inheritance diagram for klStackWalkBase:
Inheritance graph
Collaboration diagram for klStackWalkBase:
Collaboration graph

Data Structures

struct  CallstackEntry
 

Public Types

enum  StackWalkOptions {
  RetrieveNone = 0, RetrieveSymbol = 1, RetrieveLine = 2, RetrieveModuleInfo = 4,
  RetrieveFileVersion = 8, RetrieveVerbose = 0xF, SymBuildPath = 0x10, SymUseSymSrv = 0x20,
  SymAll = 0x30, OptionsAll = 0x3F
}
 
enum  { STACKWALK_MAX_NAMELEN = 1024 }
 
typedef enum
klStackWalkBase::StackWalkOptions 
StackWalkOptions
 
typedef BOOL(__stdcall * PReadProcessMemoryRoutine )(HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead, LPVOID pUserData)
 

Public Member Functions

 klStackWalkBase (int options=OptionsAll, LPCSTR szSymPath=NULL, DWORD dwProcessId=GetCurrentProcessId(), HANDLE hProcess=GetCurrentProcess())
 
 klStackWalkBase (DWORD dwProcessId, HANDLE hProcess)
 
virtual ~klStackWalkBase ()
 
BOOL LoadModules ()
 
BOOL ShowCallstack (HANDLE hThread=GetCurrentThread(), const CONTEXT *context=NULL, PReadProcessMemoryRoutine readMemoryFunction=NULL, LPVOID pUserData=NULL)
 

Protected Types

enum  CallstackEntryType { firstEntry, nextEntry, lastEntry }
 
typedef struct
klStackWalkBase::CallstackEntry 
CallstackEntry
 

Protected Member Functions

virtual void OnSymInit (LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUserName)
 
virtual void OnLoadModule (LPCSTR img, LPCSTR mod, DWORD64 baseAddr, DWORD size, DWORD result, LPCSTR symType, LPCSTR pdbName, ULONGLONG fileVersion)
 
virtual void OnCallstackEntry (CallstackEntryType eType, CallstackEntry &entry)
 
virtual void OnDbgHelpErr (LPCSTR szFuncName, DWORD gle, DWORD64 addr)
 
virtual void OnOutput (LPCSTR szText)
 

Static Protected Member Functions

static BOOL __stdcall myReadProcMem (HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead)
 

Protected Attributes

klStackWalkerInternalm_sw
 
HANDLE m_hProcess
 
DWORD m_dwProcessId
 
BOOL m_modulesLoaded
 
LPSTR m_szSymPath
 
int m_options
 
friend klStackWalkerInternal
 

Member Typedef Documentation

typedef BOOL(__stdcall * klStackWalkBase::PReadProcessMemoryRoutine)(HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead, LPVOID pUserData)

Member Enumeration Documentation

anonymous enum
Enumerator
STACKWALK_MAX_NAMELEN 
Enumerator
firstEntry 
nextEntry 
lastEntry 
Enumerator
RetrieveNone 
RetrieveSymbol 
RetrieveLine 
RetrieveModuleInfo 
RetrieveFileVersion 
RetrieveVerbose 
SymBuildPath 
SymUseSymSrv 
SymAll 
OptionsAll 

Constructor & Destructor Documentation

klStackWalkBase::klStackWalkBase ( int  options = OptionsAll,
LPCSTR  szSymPath = NULL,
DWORD  dwProcessId = GetCurrentProcessId(),
HANDLE  hProcess = GetCurrentProcess() 
)
klStackWalkBase::klStackWalkBase ( DWORD  dwProcessId,
HANDLE  hProcess 
)
klStackWalkBase::~klStackWalkBase ( )
virtual

Member Function Documentation

BOOL klStackWalkBase::LoadModules ( )

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL __stdcall klStackWalkBase::myReadProcMem ( HANDLE  hProcess,
DWORD64  qwBaseAddress,
PVOID  lpBuffer,
DWORD  nSize,
LPDWORD  lpNumberOfBytesRead 
)
staticprotected

Here is the caller graph for this function:

void klStackWalkBase::OnCallstackEntry ( CallstackEntryType  eType,
CallstackEntry entry 
)
protectedvirtual

Here is the call graph for this function:

Here is the caller graph for this function:

void klStackWalkBase::OnDbgHelpErr ( LPCSTR  szFuncName,
DWORD  gle,
DWORD64  addr 
)
protectedvirtual

Here is the call graph for this function:

Here is the caller graph for this function:

void klStackWalkBase::OnLoadModule ( LPCSTR  img,
LPCSTR  mod,
DWORD64  baseAddr,
DWORD  size,
DWORD  result,
LPCSTR  symType,
LPCSTR  pdbName,
ULONGLONG  fileVersion 
)
protectedvirtual

Here is the call graph for this function:

Here is the caller graph for this function:

void klStackWalkBase::OnOutput ( LPCSTR  szText)
protectedvirtual

Reimplemented in klStackWalker.

Here is the caller graph for this function:

void klStackWalkBase::OnSymInit ( LPCSTR  szSearchPath,
DWORD  symOptions,
LPCSTR  szUserName 
)
protectedvirtual

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL klStackWalkBase::ShowCallstack ( HANDLE  hThread = GetCurrentThread(),
const CONTEXT *  context = NULL,
PReadProcessMemoryRoutine  readMemoryFunction = NULL,
LPVOID  pUserData = NULL 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

friend klStackWalkBase::klStackWalkerInternal
protected
DWORD klStackWalkBase::m_dwProcessId
protected
HANDLE klStackWalkBase::m_hProcess
protected
BOOL klStackWalkBase::m_modulesLoaded
protected
int klStackWalkBase::m_options
protected
klStackWalkerInternal* klStackWalkBase::m_sw
protected
LPSTR klStackWalkBase::m_szSymPath
protected

The documentation for this class was generated from the following files: