--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -31,6 +31,7 @@
#include "linespec.h"
#include "symtab.h"
#include "source.h"
+#include "version.h"
#include <ctype.h>
@@ -40,6 +41,9 @@ static PyObject *get_show_variable (PyObject *, PyObject *);
static PyObject *execute_gdb_command (PyObject *, PyObject *);
static PyObject *gdbpy_solib_address (PyObject *, PyObject *);
static PyObject *gdbpy_decode_line (PyObject *, PyObject *);
+static PyObject *gdbpy_version (PyObject *, PyObject *);
+static PyObject *gdbpy_host_conf (PyObject *, PyObject *);
+static PyObject *gdbpy_target_conf (PyObject *, PyObject *);
void
@@ -77,6 +81,13 @@ demand_python ()
Return a tuple holding the file name (or None) and line number (or None).\n\
Note: may later change to return an object." },
+ { "version", gdbpy_version, METH_NOARGS,
+ "Return the GDB version." },
+ { "host_config", gdbpy_host_conf, METH_NOARGS,
+ "Return the GDB host configuration triplet." },
+ { "target_config", gdbpy_target_conf, METH_NOARGS,
+ "Return the GDB target configuration triplet." },
+
{NULL, NULL, 0, NULL}
};
@@ -549,6 +560,24 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyObject *
+gdbpy_version (PyObject *self, PyObject *args)
+{
+ return PyString_FromString (version);
+}
+
+static PyObject *
+gdbpy_host_conf (PyObject *self, PyObject *args)
+{
+ return PyString_FromString (host_name);
+}
+
+static PyObject *
+gdbpy_target_conf (PyObject *self, PyObject *args)
+{
+ return PyString_FromString (target_name);
+}
+
void |