Csound API  6.18
Debugger

Data Structures

struct  debug_instr_s
 
struct  debug_opcode_s
 
struct  debug_variable_s
 
struct  debug_bkpt_info_t
 
struct  csdebug_data_s
 

Typedefs

typedef struct debug_instr_s debug_instr_t
 
typedef struct debug_opcode_s debug_opcode_t
 
typedef struct debug_variable_s debug_variable_t
 
typedef void(* breakpoint_cb_t) (CSOUND *, debug_bkpt_info_t *, void *userdata)
 Breakpoint callback function type. More...
 
typedef struct csdebug_data_s csdebug_data_t
 

Functions

PUBLIC void csoundDebuggerInit (CSOUND *csound)
 Intialize debugger facilities. More...
 
PUBLIC void csoundDebuggerClean (CSOUND *csound)
 Cleanup debugger facilities. More...
 
PUBLIC void csoundSetBreakpoint (CSOUND *csound, int line, int instr, int skip)
 Set a breakpoint on a particular line. More...
 
PUBLIC void csoundRemoveBreakpoint (CSOUND *csound, int line, int instr)
 Remove a previously set line breakpoint. More...
 
PUBLIC void csoundSetInstrumentBreakpoint (CSOUND *csound, MYFLT instr, int skip)
 Set a breakpoint for an instrument number. More...
 
PUBLIC void csoundRemoveInstrumentBreakpoint (CSOUND *csound, MYFLT instr)
 Remove instrument breakpoint. More...
 
PUBLIC void csoundClearBreakpoints (CSOUND *csound)
 Clear all breakpoints. More...
 
PUBLIC void csoundSetBreakpointCallback (CSOUND *csound, breakpoint_cb_t bkpt_cb, void *userdata)
 Sets the breakpoint callback function. More...
 
PUBLIC void csoundDebugNext (CSOUND *csound)
 Continue execution and break at next instrument instance. More...
 
PUBLIC void csoundDebugContinue (CSOUND *csound)
 Continue execution from breakpoint. More...
 
PUBLIC void csoundDebugStop (CSOUND *csound)
 Stop Csound rendering and enter the debugger. More...
 
PUBLIC debug_instr_tcsoundDebugGetInstrInstances (CSOUND *csound)
 Get a list of active instrument instances Returns a linked list of allocated instrument instances csoundDebugFreeInstrInstances() must be called on the list once it is no longer needed. More...
 
PUBLIC void csoundDebugFreeInstrInstances (CSOUND *csound, debug_instr_t *instr)
 Free list created by csoundDebugGetCurrentInstrInstance() or csoundDebugGetInstrInstances() More...
 
PUBLIC debug_variable_tcsoundDebugGetVariables (CSOUND *csound, debug_instr_t *instr)
 Get list of variables for instrument. More...
 
PUBLIC void csoundDebugFreeVariables (CSOUND *csound, debug_variable_t *varHead)
 Free variable list generated by csoundDebugGetVariables() More...
 

Detailed Description

Typedef Documentation

◆ breakpoint_cb_t

typedef void(* breakpoint_cb_t) (CSOUND *, debug_bkpt_info_t *, void *userdata)

Breakpoint callback function type.

When a breakpoint is reached, the debugger will call a function of this type see csoundSetBreakpointCallback()

◆ csdebug_data_t

◆ debug_instr_t

typedef struct debug_instr_s debug_instr_t

◆ debug_opcode_t

◆ debug_variable_t

Function Documentation

◆ csoundClearBreakpoints()

PUBLIC void csoundClearBreakpoints ( CSOUND csound)

Clear all breakpoints.

Removes all breakpoints. This call is thread safe, as it will be processed as soon as possible in the kperf function.

◆ csoundDebugContinue()

PUBLIC void csoundDebugContinue ( CSOUND csound)

Continue execution from breakpoint.

Call this function to continue execution of a Csound instance which is stopped because a breakpoint has been reached. This function will continue traversing the instrument chain from the instrument instance that triggered the break.

◆ csoundDebugFreeInstrInstances()

PUBLIC void csoundDebugFreeInstrInstances ( CSOUND csound,
debug_instr_t instr 
)

Free list created by csoundDebugGetCurrentInstrInstance() or csoundDebugGetInstrInstances()

◆ csoundDebugFreeVariables()

PUBLIC void csoundDebugFreeVariables ( CSOUND csound,
debug_variable_t varHead 
)

Free variable list generated by csoundDebugGetVariables()

◆ csoundDebuggerClean()

PUBLIC void csoundDebuggerClean ( CSOUND csound)

Cleanup debugger facilities.

Parameters
csoundA Csound instance

◆ csoundDebuggerInit()

PUBLIC void csoundDebuggerInit ( CSOUND csound)

Intialize debugger facilities.

This function allocates debugger structures, and enables its usage. There is a small performance penalty when using the debugger, so be sure to call csoundDebuggerClean() after use.

This call is not thread safe and must be called before performance starts.

Parameters
csoundA Csound instance

◆ csoundDebugGetInstrInstances()

PUBLIC debug_instr_t* csoundDebugGetInstrInstances ( CSOUND csound)

Get a list of active instrument instances Returns a linked list of allocated instrument instances csoundDebugFreeInstrInstances() must be called on the list once it is no longer needed.

This function is not thread safe and should only be called while the csound engine is stopped at a breakpoint.

◆ csoundDebugGetVariables()

PUBLIC debug_variable_t* csoundDebugGetVariables ( CSOUND csound,
debug_instr_t instr 
)

Get list of variables for instrument.

◆ csoundDebugNext()

PUBLIC void csoundDebugNext ( CSOUND csound)

Continue execution and break at next instrument instance.

Call this function to continue execution but automatically stop at next instrument instance.

◆ csoundDebugStop()

PUBLIC void csoundDebugStop ( CSOUND csound)

Stop Csound rendering and enter the debugger.

Calling this function will enter the debugger at the soonest possible point as if a breakpoint had been reached.

◆ csoundRemoveBreakpoint()

PUBLIC void csoundRemoveBreakpoint ( CSOUND csound,
int  line,
int  instr 
)

Remove a previously set line breakpoint.

◆ csoundRemoveInstrumentBreakpoint()

PUBLIC void csoundRemoveInstrumentBreakpoint ( CSOUND csound,
MYFLT  instr 
)

Remove instrument breakpoint.

Removes an instrument breakpoint from the breakpoint list. Csound will no longer break at that instrument

This call is thread safe, as the breakpoint will be put in a lock free queue that is processed as soon as possible in the kperf function.

◆ csoundSetBreakpoint()

PUBLIC void csoundSetBreakpoint ( CSOUND csound,
int  line,
int  instr,
int  skip 
)

Set a breakpoint on a particular line.

Parameters
csoundA Csound instance
lineThe line on which to set a breakpoint
instrWhen set to 0, the line number refers to the line number in the score. When a number is given, it should refer to an instrument that has been compiled on the fly using csoundParseOrc().
skipnumber of control blocks to skip

◆ csoundSetBreakpointCallback()

PUBLIC void csoundSetBreakpointCallback ( CSOUND csound,
breakpoint_cb_t  bkpt_cb,
void *  userdata 
)

Sets the breakpoint callback function.

Sets the function that will be called when a breakpoint is reached.

Parameters
csoundCsound instance pointer
bkpt_cbpointer to breakpoint callback function
userdatapointer to user data that will be passed to the callback function

◆ csoundSetInstrumentBreakpoint()

PUBLIC void csoundSetInstrumentBreakpoint ( CSOUND csound,
MYFLT  instr,
int  skip 
)

Set a breakpoint for an instrument number.

Sets a breakpoint for an instrument number with optional number of skip control blocks. You can specify a fractional instrument number to identify particular instances. Specifying a value greater than 1 will result in that number of control blocks being skipped before this breakpoint is called again. A value of 0 and 1 has the same effect.

This call is thread safe, as the breakpoint will be put in a lock free queue that is processed as soon as possible in the kperf function.

Parameters
csounda Csound instance
instrinstrument number
skipnumber of control blocks to skip