diff options
Diffstat (limited to 'gdb/python/py-symtab.c')
-rw-r--r-- | gdb/python/py-symtab.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index 8f4208d..1065ba3 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -126,6 +126,25 @@ stpy_get_objfile (PyObject *self, void *closure) return result; } +/* Getter function for symtab.producer. */ + +static PyObject * +stpy_get_producer (PyObject *self, void *closure) +{ + struct symtab *symtab = NULL; + + STPY_REQUIRE_VALID (self, symtab); + if (symtab->producer != NULL) + { + const char *producer = symtab->producer; + + return PyString_Decode (producer, strlen (producer), + host_charset (), NULL); + } + + Py_RETURN_NONE; +} + static PyObject * stpy_fullname (PyObject *self, PyObject *args) { @@ -530,6 +549,8 @@ static PyGetSetDef symtab_object_getset[] = { "The symbol table's source filename.", NULL }, { "objfile", stpy_get_objfile, NULL, "The symtab's objfile.", NULL }, + { "producer", stpy_get_producer, NULL, + "The name/version of the program that compiled this symtab.", NULL }, {NULL} /* Sentinel */ }; |