Loading...
Searching...
No Matches
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.
typedef struct csdebug_data_s | csdebug_data_t

## Functions

PUBLIC void | csoundDebuggerInit (CSOUND *csound)
| Intialize debugger facilities.
PUBLIC void | csoundDebuggerClean (CSOUND *csound)
| Cleanup debugger facilities.
PUBLIC void | csoundSetBreakpoint (CSOUND *csound, int line, int instr, int skip)
| Set a breakpoint on a particular line.
PUBLIC void | csoundRemoveBreakpoint (CSOUND *csound, int line, int instr)
| Remove a previously set line breakpoint.
PUBLIC void | csoundSetInstrumentBreakpoint (CSOUND *csound, MYFLT instr, int skip)
| Set a breakpoint for an instrument number.
PUBLIC void | csoundRemoveInstrumentBreakpoint (CSOUND *csound, MYFLT instr)
| Remove instrument breakpoint.
PUBLIC void | csoundClearBreakpoints (CSOUND *csound)
| Clear all breakpoints.
PUBLIC void | csoundSetBreakpointCallback (CSOUND *csound, breakpoint_cb_t bkpt_cb, void *userdata)
| Sets the breakpoint callback function.
PUBLIC void | csoundDebugNext (CSOUND *csound)
| Continue execution and break at next instrument instance.
PUBLIC void | csoundDebugContinue (CSOUND *csound)
| Continue execution from breakpoint.
PUBLIC void | csoundDebugStop (CSOUND *csound)
| Stop Csound rendering and enter the debugger.
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.
PUBLIC void | csoundDebugFreeInstrInstances (CSOUND *csound, debug_instr_t *instr)
| Free list created by csoundDebugGetCurrentInstrInstance() or csoundDebugGetInstrInstances().
PUBLIC debug_variable_t * | csoundDebugGetVariables (CSOUND *csound, debug_instr_t *instr)
| Get list of variables for instrument.
PUBLIC void | csoundDebugFreeVariables (CSOUND *csound, debug_variable_t *varHead)
| Free variable list generated by csoundDebugGetVariables().

## 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

typedef struct csdebug_data_s csdebug_data_t

## debug_instr_t

typedef struct debug_instr_s debug_instr_t

## debug_opcode_t

typedef struct debug_opcode_s debug_opcode_t

## debug_variable_t

typedef struct debug_variable_s 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.

References PUBLIC.

## 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.

References PUBLIC.

## csoundDebugFreeInstrInstances()

PUBLIC void csoundDebugFreeInstrInstances | ( | CSOUND * | csound,
|  | debug_instr_t * | instr )

Free list created by csoundDebugGetCurrentInstrInstance() or csoundDebugGetInstrInstances().

References PUBLIC.

## csoundDebugFreeVariables()

PUBLIC void csoundDebugFreeVariables | ( | CSOUND * | csound,
|  | debug_variable_t * | varHead )

Free variable list generated by csoundDebugGetVariables().

References PUBLIC.

## csoundDebuggerClean()

PUBLIC void csoundDebuggerClean | ( | CSOUND * | csound | ) |

Cleanup debugger facilities.

Parameters

  csound | A Csound instance

References PUBLIC.

## 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

  csound | A Csound instance

References PUBLIC.

## 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.

References PUBLIC.

## csoundDebugGetVariables()

PUBLIC debug_variable_t * csoundDebugGetVariables | ( | CSOUND * | csound,
|  | debug_instr_t * | instr )

Get list of variables for instrument.

References PUBLIC.

## 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.

References PUBLIC.

## 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.

References PUBLIC.

## csoundRemoveBreakpoint()

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

Remove a previously set line breakpoint.

References PUBLIC.

## 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.

References PUBLIC.

## csoundSetBreakpoint()

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

Set a breakpoint on a particular line.

Parameters

  csound | A Csound instance
  line | The line on which to set a breakpoint
  instr | When 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().
  skip | number of control blocks to skip

References PUBLIC.

## 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

  csound | Csound instance pointer
  bkpt_cb | pointer to breakpoint callback function
  userdata | pointer to user data that will be passed to the callback function

References PUBLIC.

## 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

  csound | a Csound instance
  instr | instrument number
  skip | number of control blocks to skip

References PUBLIC.