This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFA: add example to docs for python function
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 05 Nov 2012 10:54:53 -0700
- Subject: RFA: add example to docs for python function
PR 14802 concerns a users confusion about the purpose of gdb.Function.
After reading the PR I thought that an additional example showing how to
use the resulting function would avoid any future confusion.
Ok?
Tom
2012-11-05 Tom Tromey <tromey@redhat.com>
PR python/14802:
* gdb.texinfo (Functions In Python): Add example.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 21db475..c2c7745 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -24715,6 +24715,13 @@ registration of the function with @value{GDBN}. Depending on how the
Python code is read into @value{GDBN}, you may need to import the
@code{gdb} module explicitly.
+Now you can use the function in an expression:
+
+@smallexample
+(gdb) print $greet("Bob")
+$1 = "Hello, Bob!"
+@end smallexample
+
@node Progspaces In Python
@subsubsection Program Spaces In Python