IDA SDK
Modules | Enumerations | Functions
High level functions

Detailed Description

These functions can be used from scripts.

Modules

 Wait for debugger event flags
 Passed as 'wfne' parameter to wait_for_next_event()
 
 Debugger options
 Passed as 'options' parameter to set_debugger_options()
 

Enumerations

enum  dbg_event_code_t { DEC_NOTASK = -2, DEC_ERROR = -1, DEC_TIMEOUT = 0 }
 Wait for the next debugger event. More...
 

Functions

dbg_event_code_t idaapi wait_for_next_event (int wfne, int timeout_in_secs)
 Wait for the next event. More...
 
const debug_event_t *idaapi get_debug_event (void)
 Get the current debugger event.
 
uint idaapi set_debugger_options (uint options)
 Set debugger options. More...
 
void idaapi set_remote_debugger (const char *host, const char *pass, int port=-1)
 Set remote debugging options. More...
 
void idaapi get_process_options (qstring *path, qstring *args, qstring *sdir, qstring *host, qstring *pass, int *port)
 Get process options. More...
 
void idaapi set_process_options (const char *path, const char *args, const char *sdir, const char *host, const char *pass, int port)
 Set process options. More...
 
excvec_t *idaapi retrieve_exceptions (void)
 Retrieve the exception information. More...
 
bool idaapi store_exceptions (void)
 Update the exception information stored in the debugger module by invoking its dbg->set_exception_info callback.
 
const char *idaapi define_exception (uint code, const char *name, const char *desc, int flags)
 Convenience function: define new exception code. More...
 
bool have_set_options (const debugger_t *_dbg)
 Is set_dbg_options() present in debugger_t?
 
const char *idaapi set_dbg_options (debugger_t *_dbg, const char *keyword, int pri, int value_type, const void *value)
 Convenience function to set debugger specific options. More...
 
const char *idaapi set_dbg_options (const char *keyword, int pri, int value_type, const void *value)
 Set options for dbg.
 
const char *idaapi set_dbg_default_options (const char *keyword, int value_type, const void *value)
 Set dbg options with #IDPOPT_PRI_DEFAULT.
 
const char *idaapi set_int_dbg_options (const char *keyword, int32 value)
 Set an integer value option for dbg.
 

Enumeration Type Documentation

Wait for the next debugger event.

See also get_process_state() to get info about the current state of the debugged application Debugger event codes

Enumerator
DEC_NOTASK 

process does not exist

DEC_ERROR 

error

DEC_TIMEOUT 

timeout

Function Documentation

dbg_event_code_t idaapi wait_for_next_event ( int  wfne,
int  timeout_in_secs 
)
inline

Wait for the next event.

This function (optionally) resumes the process execution, and waits for a debugger event until a possible timeout occurs.

Parameters
wfnecombination of Wait for debugger event flags constants
timeoutnumber of seconds to wait, -1-infinity
Returns
either an event_id_t (if > 0), or a dbg_event_code_t (if <= 0)
uint idaapi set_debugger_options ( uint  options)
inline

Set debugger options.

Replaces debugger options with the specification combination Debugger options

Returns
the old debugger options
void idaapi set_remote_debugger ( const char *  host,
const char *  pass,
int  port = -1 
)
inline

Set remote debugging options.

Should be used before starting the debugger.

Parameters
hostIf empty, IDA will use local debugger. If NULL, the host will not be set.
passIf NULL, the password will not be set
portIf -1, the default port number will be used
void idaapi get_process_options ( qstring path,
qstring args,
qstring sdir,
qstring host,
qstring pass,
int *  port 
)
inline

Get process options.

Any of the arguments may be NULL

void idaapi set_process_options ( const char *  path,
const char *  args,
const char *  sdir,
const char *  host,
const char *  pass,
int  port 
)
inline

Set process options.

Any of the arguments may be NULL, which means 'do not modify'

excvec_t *idaapi retrieve_exceptions ( void  )
inline

Retrieve the exception information.

You may freely modify the returned vector and add/edit/delete exceptions You must call store_exceptions() after any modifications Note: exceptions with code zero, multiple exception codes or names are prohibited

const char *idaapi define_exception ( uint  code,
const char *  name,
const char *  desc,
int  flags 
)
inline

Convenience function: define new exception code.

Parameters
codeexception code (can not be 0)
nameexception name (can not be empty or NULL)
descexception description (maybe NULL)
flagscombination of Exception info flags
Returns
failure message or NULL. You must call store_exceptions() if this function succeeds
const char* idaapi set_dbg_options ( debugger_t _dbg,
const char *  keyword,
int  pri,
int  value_type,
const void *  value 
)
inline

Convenience function to set debugger specific options.

It checks if the debugger is present and the function is present and calls it.