| |   |
| 43 | 43 | static PyObject *execute_gdb_command (PyObject *, PyObject *); |
| 44 | 44 | static PyObject *gdbpy_solib_address (PyObject *, PyObject *); |
| 45 | 45 | static PyObject *gdbpy_decode_line (PyObject *, PyObject *); |
| 46 | | static PyObject *gdbpy_version (PyObject *, PyObject *); |
| 47 | | static PyObject *gdbpy_host_conf (PyObject *, PyObject *); |
| 48 | | static PyObject *gdbpy_target_conf (PyObject *, PyObject *); |
| 49 | 46 | static PyObject *gdbpy_find_pc_function (PyObject *, PyObject *); |
| 50 | 47 | static PyObject *gdbpy_get_threads (PyObject *, PyObject *); |
| 51 | 48 | static PyObject *gdbpy_get_current_thread (PyObject *, PyObject *); |
| … | … | |
| 91 | 91 | Return a tuple holding the file name (or None) and line number (or None).\n\ |
| 92 | 92 | Note: may later change to return an object." }, |
| 93 | 93 | |
| 94 | | { "version", gdbpy_version, METH_NOARGS, |
| 95 | | "Return the GDB version." }, |
| 96 | | { "host_config", gdbpy_host_conf, METH_NOARGS, |
| 97 | | "Return the GDB host configuration triplet." }, |
| 98 | | { "target_config", gdbpy_target_conf, METH_NOARGS, |
| 99 | | "Return the GDB target configuration triplet." }, |
| 100 | | |
| 101 | 94 | { "get_threads", gdbpy_get_threads, METH_NOARGS, |
| 102 | 95 | "Return a tuple holding all the valid thread IDs." }, |
| 103 | 96 | { "get_current_thread", gdbpy_get_current_thread, METH_NOARGS, |
| … | … | |
| 105 | 105 | |
| 106 | 106 | gdb_module = Py_InitModule ("gdb", GdbMethods); |
| 107 | 107 | |
| 108 | PyModule_AddStringConstant (gdb_module, "VERSION", version); |
| 109 | PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", host_name); |
| 110 | PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", target_name); |
| 111 | |
| 108 | 112 | gdbpy_initialize_hooks (); |
| 109 | 113 | gdbpy_initialize_values (); |
| 110 | 114 | gdbpy_initialize_breakpoints (); |
| … | … | |
| 596 | 596 | return make_cleanup (py_decref, (void *)py); |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | | static PyObject * |
| 600 | | gdbpy_version (PyObject *self, PyObject *args) |
| 601 | | { |
| 602 | | return PyString_FromString (version); |
| 603 | | } |
| 604 | | |
| 605 | | static PyObject * |
| 606 | | gdbpy_host_conf (PyObject *self, PyObject *args) |
| 607 | | { |
| 608 | | return PyString_FromString (host_name); |
| 609 | | } |
| 610 | | |
| 611 | | static PyObject * |
| 612 | | gdbpy_target_conf (PyObject *self, PyObject *args) |
| 613 | | { |
| 614 | | return PyString_FromString (target_name); |
| 615 | | } |
| 616 | | |
| 617 | 599 | |
| 618 | 600 | |
| 619 | 601 | /* Threads. */ |
| toggle raw diff |
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -43,9 +43,6 @@ 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 *);
static PyObject *gdbpy_find_pc_function (PyObject *, PyObject *);
static PyObject *gdbpy_get_threads (PyObject *, PyObject *);
static PyObject *gdbpy_get_current_thread (PyObject *, PyObject *);
@@ -94,13 +91,6 @@ 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." },
-
{ "get_threads", gdbpy_get_threads, METH_NOARGS,
"Return a tuple holding all the valid thread IDs." },
{ "get_current_thread", gdbpy_get_current_thread, METH_NOARGS,
@@ -115,6 +105,10 @@ Note: may later change to return an object." },
gdb_module = Py_InitModule ("gdb", GdbMethods);
+ PyModule_AddStringConstant (gdb_module, "VERSION", version);
+ PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", host_name);
+ PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", target_name);
+
gdbpy_initialize_hooks ();
gdbpy_initialize_values ();
gdbpy_initialize_breakpoints ();
@@ -602,24 +596,6 @@ struct cleanup *make_cleanup_py_decref (PyObject *py)
return make_cleanup (py_decref, (void *)py);
}
-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);
-}
-
/* Threads. */ |