This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

FYI: rename gdb.get_parameter


This patch renames gdb.get_parameter to gdb.parameter, in keeping with
our general naming scheme.  I ran across this while testing the
libstdc++ pretty-printers.


Tom

ChangeLog:
2009-05-28  Tom Tromey  <tromey@redhat.com>

	* python/python.c (gdbpy_parameter): Rename.  Fix error message.
	(GdbMethods): Change "get_parameter" to "parameter".

doc/ChangeLog:
2009-05-28  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Basic Python): Change get_parameter to parameter.

Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.597
diff -u -r1.597 gdb.texinfo
--- doc/gdb.texinfo	28 May 2009 01:09:20 -0000	1.597
+++ doc/gdb.texinfo	28 May 2009 16:39:30 -0000
@@ -18554,8 +18554,8 @@
 It must be a boolean value.  If omitted, it defaults to @code{False}.
 @end defun
 
-@findex gdb.get_parameter
-@defun get_parameter parameter
+@findex gdb.parameter
+@defun parameter parameter
 Return the value of a @value{GDBN} parameter.  @var{parameter} is a
 string naming the parameter to look up; @var{parameter} may contain
 spaces if the parameter has a multi-part name.  For example,
Index: python/python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.17
diff -u -r1.17 python.c
--- python/python.c	28 May 2009 01:09:20 -0000	1.17
+++ python/python.c	28 May 2009 16:39:30 -0000
@@ -212,7 +212,7 @@
    value.  */
 
 static PyObject *
-get_parameter (PyObject *self, PyObject *args)
+gdbpy_parameter (PyObject *self, PyObject *args)
 {
   struct cmd_list_element *alias, *prefix, *cmd;
   char *arg, *newarg;
@@ -235,7 +235,7 @@
 			 "could not find parameter `%s'", arg);
 
   if (! cmd->var)
-    return PyErr_Format (PyExc_RuntimeError, "`%s' is not a variable", arg);
+    return PyErr_Format (PyExc_RuntimeError, "`%s' is not a parameter", arg);
   return parameter_to_python (cmd);
 }
 
@@ -612,7 +612,7 @@
     "Get a value from history" },
   { "execute", execute_gdb_command, METH_VARARGS,
     "Execute a gdb command" },
-  { "get_parameter", get_parameter, METH_VARARGS,
+  { "parameter", gdbpy_parameter, METH_VARARGS,
     "Return a gdb parameter's value" },
 
   { "default_visualizer", gdbpy_default_visualizer, METH_VARARGS,


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