This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python][rfc] Rename thread-related functions in the gdb module.


These are the last ones.


2008-12-05  Thiago Jung Bauermann  <bauerman@br.ibm.com>

gdb/
	* python/python.c (gdbpy_get_threads): Rename to ...
	(gdbpy_threads): ... this.
	(gdbpy_get_current_thread): Rename to ...
	(gdbpy_current_thread): ... this.
	(GdbMethods): Rename `get_threads' to `threads' and
	`get_current_thread' to `current_thread'.

gdb/doc/
	* gdb.texinfo: Fix references to renamed gdb module functions.

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 54027f2..c1f7810 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18666,15 +18666,15 @@ Python scripts can access information about the inferior's threads
 using some functions provided by @value{GDBN}.  Like all of
 @value{GDBN}'s Python additions, these are in the @code{gdb} module:
 
-@findex gdb.get_threads
-@defun get_threads
+@findex gdb.threads
+@defun threads
 This function returns a tuple holding all the thread IDs which are
 valid when the function is called.  If there are no valid threads,
 this will return @code{None}.
 @end defun
 
-@findex gdb.get_current_thread
-@defun get_current_thread
+@findex gdb.current_thread
+@defun current_thread
 This function returns the thread ID of the selected thread.  If there
 is no selected thread, this will return @code{None}.
 @end defun
@@ -18683,7 +18683,7 @@ is no selected thread, this will return @code{None}.
 @defun switch_to_thread id
 This changes @value{GDBN}'s currently selected thread to the thread
 given by @var{id}.  @var{id} must be a valid thread ID as returned by
-@code{get_threads}.  If @var{id} is invalid, this function throws an
+@code{threads}.  If @var{id} is invalid, this function throws an
 exception.
 @end defun
 
diff --git a/gdb/python/python.c b/gdb/python/python.c
index e7f1652..c3ef9fa 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -452,7 +452,7 @@ update_tuple_callback (struct thread_info *info, void *user_data)
 /* Python function which yields a tuple holding all valid thread IDs.  */
 
 static PyObject *
-gdbpy_get_threads (PyObject *unused1, PyObject *unused2)
+gdbpy_threads (PyObject *unused1, PyObject *unused2)
 {
   int thread_count = 0;
   struct set_thread_info info;
@@ -476,7 +476,7 @@ gdbpy_get_threads (PyObject *unused1, PyObject *unused2)
 /* Python function that returns the current thread's ID.  */
 
 static PyObject *
-gdbpy_get_current_thread (PyObject *unused1, PyObject *unused2)
+gdbpy_current_thread (PyObject *unused1, PyObject *unused2)
 {
   if (PIDGET (inferior_ptid) == 0)
     Py_RETURN_NONE;
@@ -1387,9 +1387,9 @@ static PyMethodDef GdbMethods[] =
 Return a tuple holding the file name (or None) and line number (or None).\n\
 Note: may later change to return an object." },
 
-  { "get_threads", gdbpy_get_threads, METH_NOARGS,
+  { "threads", gdbpy_threads, METH_NOARGS,
     "Return a tuple holding all the valid thread IDs." },
-  { "get_current_thread", gdbpy_get_current_thread, METH_NOARGS,
+  { "get_current_thread", gdbpy_current_thread, METH_NOARGS,
     "Return the thread ID of the current thread." },
   { "switch_to_thread", gdbpy_switch_to_thread, METH_VARARGS,
     "Switch to a thread, given the thread ID." },
-- 
1.5.6.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]