DynamoRIO
 
Loading...
Searching...
No Matches
Callstack Walker

Data Structures

struct  _drcallstack_options_t
 
struct  _drcallstack_frame_t
 

Typedefs

typedef struct _drcallstack_options_t drcallstack_options_t
 
typedef struct _drcallstack_frame_t drcallstack_frame_t
 
typedef struct _drcallstack_walk_t drcallstack_walk_t
 

Enumerations

enum  drcallstack_status_t {
  DRCALLSTACK_SUCCESS ,
  DRCALLSTACK_NO_MORE_FRAMES ,
  DRCALLSTACK_ERROR ,
  DRCALLSTACK_ERROR_INVALID_PARAMETER ,
  DRCALLSTACK_ERROR_FEATURE_NOT_AVAILABLE
}
 

Functions

DR_EXPORT drcallstack_status_t drcallstack_init (drcallstack_options_t *ops)
 
DR_EXPORT drcallstack_status_t drcallstack_exit (void)
 
DR_EXPORT drcallstack_status_t drcallstack_init_walk (dr_mcontext_t *mc, OUT drcallstack_walk_t **walk)
 
DR_EXPORT drcallstack_status_t drcallstack_cleanup_walk (drcallstack_walk_t *walk)
 
DR_EXPORT drcallstack_status_t drcallstack_next_frame (drcallstack_walk_t *walk, OUT drcallstack_frame_t *frame)
 

Detailed Description

Typedef Documentation

◆ drcallstack_frame_t

Describes one callstack frame.

◆ drcallstack_options_t

Specifies the options when initializing drcallstack.

◆ drcallstack_walk_t

typedef struct _drcallstack_walk_t drcallstack_walk_t

Opaque type.

Enumeration Type Documentation

◆ drcallstack_status_t

Success code for each drcallstack operation.

Enumerator
DRCALLSTACK_SUCCESS 

Operation succeeded.

DRCALLSTACK_NO_MORE_FRAMES 

No further frames found.

DRCALLSTACK_ERROR 

Operation failed.

DRCALLSTACK_ERROR_INVALID_PARAMETER 

Operation failed: invalid parameter

DRCALLSTACK_ERROR_FEATURE_NOT_AVAILABLE 

Operation failed: not available

Function Documentation

◆ drcallstack_cleanup_walk()

DR_EXPORT drcallstack_status_t drcallstack_cleanup_walk ( drcallstack_walk_t * walk)

Called when the 'walk' pointer is no longer needed.

◆ drcallstack_exit()

DR_EXPORT drcallstack_status_t drcallstack_exit ( void )

Cleans up the drcallstack extension.

Returns
whether successful or an error code on failure.

◆ drcallstack_init()

DR_EXPORT drcallstack_status_t drcallstack_init ( drcallstack_options_t * ops)

Initializes the drcallstack extension. Must be called prior to any of the other routines. Can be called multiple times (by separate components, normally) but each call must be paired with a corresponding call to drcallstack_exit().

Parameters
[in]opsSpecifies the optional parameters that control how drcallstack operates.
Returns
whether successful or an error code on failure.

◆ drcallstack_init_walk()

DR_EXPORT drcallstack_status_t drcallstack_init_walk ( dr_mcontext_t * mc,
OUT drcallstack_walk_t ** walk )

Initializes a new callstack walk with the passed-in context 'mc', which must have DR_MC_CONTROL and DR_MC_INTEGER filled in. The 'walk' pointer should then be passed to repeated calls to drcallstack_next_frame() until it returns DRCALLSTACK_NO_MORE_FRAMES. drcallstack_cleanup_walk() should then be called to free up resources.

Note
Currently callstack walking is only available for Linux.

◆ drcallstack_next_frame()

DR_EXPORT drcallstack_status_t drcallstack_next_frame ( drcallstack_walk_t * walk,
OUT drcallstack_frame_t * frame )

First, call drcallstack_init_walk() to initialize 'walk'. The 'walk' pointer should then be passed to repeated calls to drcallstack_next_frame() until it returns DRCALLSTACK_NO_MORE_FRAMES or an error code. drcallstack_cleanup_walk() should then be called to free up resources.

Note
Currently callstack walking is only available for Linux.