The add_breakpoint function adds a new breakpoint. The reg_name is the register name. When register becomes the value, simulator will stop. The break_upon_change means whether simulator should stop upon change of the register value. In this case, value is not used. The mask can be used when only certain bits are of interest.
The remove_breakpoint function removes a breakpoint with a given id. If the id is -1, then all breakpoints are removed.
The function get_breakpoints returns a list of defined breakpoints. Each breakpoint in the list is described by a tuple: (breakpoint_id, register_name, break_value, mask). If the breakpoint is triggered upon every register value change, then break_value is NIL.
SIM_INTERFACE(register_breakpoint) {
int (*add_breakpoint)(conf_object_t *obj, const char *reg_name,
uint64 value, uint64 mask,
bool break_upon_change);
bool (*remove_breakpoint)(conf_object_t *obj, int id);
attr_value_t (*get_breakpoints)(conf_object_t *obj);
};
#define REGISTER_BREAKPOINT_INTERFACE "register_breakpoint"