예제 #1
0
파일: py-symtab.c 프로젝트: ibuclaw/gdb
static PyObject *
stpy_get_producer (PyObject *self, void *closure)
{
  struct symtab *symtab = NULL;
  struct compunit_symtab *cust;

  STPY_REQUIRE_VALID (self, symtab);
  cust = SYMTAB_COMPUNIT (symtab);
  if (COMPUNIT_PRODUCER (cust) != NULL)
    {
      const char *producer = COMPUNIT_PRODUCER (cust);

      return host_string_to_python_string (producer);
    }

  Py_RETURN_NONE;
}
예제 #2
0
static PyObject *
stpy_get_producer (PyObject *self, void *closure)
{
  struct symtab *symtab = NULL;
  struct compunit_symtab *cust;

  STPY_REQUIRE_VALID (self, symtab);
  cust = SYMTAB_COMPUNIT (symtab);
  if (COMPUNIT_PRODUCER (cust) != NULL)
    {
      const char *producer = COMPUNIT_PRODUCER (cust);

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

  Py_RETURN_NONE;
}