aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-objfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-objfile.c')
-rw-r--r--gdb/python/py-objfile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 3e3270e..298f3f2 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -101,6 +101,18 @@ objfpy_get_username (PyObject *self, void *closure)
Py_RETURN_NONE;
}
+/* Get the 'is_file' attribute. */
+
+static PyObject *
+objfpy_get_is_file (PyObject *o, void *ignore)
+{
+ objfile_object *self = (objfile_object *) o;
+
+ if (self->objfile != nullptr)
+ return PyBool_FromLong ((self->objfile->flags & OBJF_NOT_FILENAME) == 0);
+ Py_RETURN_NONE;
+}
+
/* If SELF is a separate debug-info file, return the "backlink" field.
Otherwise return None. */
@@ -762,6 +774,8 @@ static gdb_PyGetSetDef objfile_getset[] =
"Type printers.", NULL },
{ "xmethods", objfpy_get_xmethods, NULL,
"Debug methods.", NULL },
+ { "is_file", objfpy_get_is_file, nullptr,
+ "Whether this objfile came from a file.", nullptr },
{ NULL }
};