aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-09-08 09:39:41 -0600
committerTom Tromey <tom@tromey.com>2018-09-10 07:44:25 -0600
commit4a5a194ae8a871a781d4cdc73c7ba3ae7deafbaa (patch)
treed30011bf7504bdfd4fb3db943e291be8aa105e32 /gdb/doc
parentf5a476a7b19f43dce8d15ae3e5deb7027f71ab7b (diff)
downloadgdb-4a5a194ae8a871a781d4cdc73c7ba3ae7deafbaa.zip
gdb-4a5a194ae8a871a781d4cdc73c7ba3ae7deafbaa.tar.gz
gdb-4a5a194ae8a871a781d4cdc73c7ba3ae7deafbaa.tar.bz2
Reword gdb.GdbError text
PR python/23108 points out that the gdb.GdbError documentation is somewhat difficult to find. The exception is apparently just mentioned in passing. This patch introduces a new table and adds a bit more text to try to make it more obvious. gdb/doc/ChangeLog 2018-09-10 Tom Tromey <tom@tromey.com> PR python/23108: * python.texi (Exception Handling): Rearrange gdb.GdbError text and add a table.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog6
-rw-r--r--gdb/doc/python.texi21
2 files changed, 21 insertions, 6 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index dfbb154..a4971ce 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,11 @@
2018-09-10 Tom Tromey <tom@tromey.com>
+ PR python/23108:
+ * python.texi (Exception Handling): Rearrange gdb.GdbError text
+ and add a table.
+
+2018-09-10 Tom Tromey <tom@tromey.com>
+
* gdb.texinfo (Compilation): Use "gcc", not "gcc.info", in @xref.
(Machine Code): Use "binutils", not "binutils.info", in @pxref.
(Separate Debug Files): Use "ld", not "ld.info", in @ref.
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 8c4dd8d..59b6b3b 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -528,12 +528,20 @@ message as its value and the Python call stack backtrace at the Python
statement closest to where the @value{GDBN} error occured as the
traceback.
-@findex gdb.GdbError
-When implementing @value{GDBN} commands in Python via @code{gdb.Command},
-it is useful to be able to throw an exception that doesn't cause a
-traceback to be printed. For example, the user may have invoked the
-command incorrectly. Use the @code{gdb.GdbError} exception
-to handle this case. Example:
+
+When implementing @value{GDBN} commands in Python via
+@code{gdb.Command}, or functions via @code{gdb.Function}, it is useful
+to be able to throw an exception that doesn't cause a traceback to be
+printed. For example, the user may have invoked the command
+incorrectly. @value{GDBN} provides a special exception class that can
+be used for this purpose.
+
+@ftable @code
+@item gdb.GdbError
+When thrown from a command or function, this exception will cause the
+command or function to fail, but the Python stack will not be
+displayed. @value{GDBN} does not throw this exception itself, but
+rather recognizes it when thrown from user Python code. Example:
@smallexample
(gdb) python
@@ -551,6 +559,7 @@ to handle this case. Example:
(gdb) hello-world 42
hello-world takes no arguments
@end smallexample
+@end ftable
@node Values From Inferior
@subsubsection Values From Inferior