/* Python function to test whether or not the breakpoint is silent.  */
static PyObject *
bppy_get_silent (PyObject *self, void *closure)
{
  breakpoint_object *self_bp = (breakpoint_object *) self;

  BPPY_REQUIRE_VALID (self_bp);
  if (self_bp->bp->silent)
    Py_RETURN_TRUE;
  Py_RETURN_FALSE;
}
Exemplo n.º 2
0
static PyObject *
bppy_delete_breakpoint (PyObject *self, PyObject *args)
{
  breakpoint_object *self_bp = (breakpoint_object *) self;

  BPPY_REQUIRE_VALID (self_bp);

  delete_breakpoint (self_bp->bp);

  Py_RETURN_NONE;
}
/* Python function to test whether or not the breakpoint is enabled.  */
static PyObject *
bppy_get_enabled (PyObject *self, void *closure)
{
  breakpoint_object *self_bp = (breakpoint_object *) self;

  BPPY_REQUIRE_VALID (self_bp);
  if (! self_bp->bp)
    Py_RETURN_FALSE;
  if (self_bp->bp->enable_state == bp_enabled)
    Py_RETURN_TRUE;
  Py_RETURN_FALSE;
}
/* Python function to get the condition expression of a breakpoint.  */
static PyObject *
bppy_get_condition (PyObject *self, void *closure)
{
  char *str;
  breakpoint_object *obj = (breakpoint_object *) self;

  BPPY_REQUIRE_VALID (obj);

  str = obj->bp->cond_string;
  if (! str)
    Py_RETURN_NONE;

  return PyString_Decode (str, strlen (str), host_charset (), NULL);
}
/* Python function to get the breakpoint expression.  */
static PyObject *
bppy_get_expression (PyObject *self, void *closure)
{
  char *str;
  breakpoint_object *obj = (breakpoint_object *) self;

  BPPY_REQUIRE_VALID (obj);

  if (obj->bp->type != bp_watchpoint
      && obj->bp->type != bp_hardware_watchpoint  
      && obj->bp->type != bp_read_watchpoint
      && obj->bp->type != bp_access_watchpoint)
    Py_RETURN_NONE;

  str = obj->bp->exp_string;
  if (! str)
    str = "";

  return PyString_Decode (str, strlen (str), host_charset (), NULL);
}