Exemple #1
0
/* Create a new symtab and line (gdb.Symtab_and_line) object
   that encapsulates the symtab_and_line structure from GDB.  */
PyObject *
symtab_and_line_to_sal_object (struct symtab_and_line sal)
{
  gdbpy_ref<sal_object> sal_obj (PyObject_New (sal_object, &sal_object_type));
  if (sal_obj != NULL)
    {
      if (set_sal (sal_obj.get (), sal) < 0)
	return NULL;
    }

  return (PyObject *) sal_obj.release ();
}
Exemple #2
0
/* Create a new symtab and line (gdb.Symtab_and_line) object
   that encapsulates the symtab_and_line structure from GDB.  */
PyObject *
symtab_and_line_to_sal_object (struct symtab_and_line sal)
{
  sal_object *sal_obj;
  int success = 0;

  sal_obj = PyObject_New (sal_object, &sal_object_type);
  if (sal_obj)
    {
      if (set_sal (sal_obj, sal) < 0)
	{
	  Py_DECREF (sal_obj);
	  return NULL;
	}
    }

  return (PyObject *) sal_obj;
}