[03/14] Document that Frame.block can throw

Message ID 20180908201417.13444-4-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Sept. 8, 2018, 8:14 p.m. UTC
  PR python/16484 points out that Frame.block can throw an exception,
but this is not documented.

This patch fixes the documentation.  Changing Frame.block to return
None would be nice, but I suspect it's too late for that change.

gdb/doc/ChangeLog
2018-09-08  Tom Tromey  <tom@tromey.com>

	PR python/16484:
	* python.texi (Frames In Python): Document that Frame.block can
	throw.
---
 gdb/doc/ChangeLog   | 6 ++++++
 gdb/doc/python.texi | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
  

Comments

Eli Zaretskii Sept. 8, 2018, 9:07 p.m. UTC | #1
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Sat,  8 Sep 2018 14:14:06 -0600
> 
> PR python/16484 points out that Frame.block can throw an exception,
> but this is not documented.
> 
> This patch fixes the documentation.  Changing Frame.block to return
> None would be nice, but I suspect it's too late for that change.
> 
> gdb/doc/ChangeLog
> 2018-09-08  Tom Tromey  <tom@tromey.com>
> 
> 	PR python/16484:
> 	* python.texi (Frames In Python): Document that Frame.block can
> 	throw.

OK, thanks.
  

Patch

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 86a91110e0e..e1b79cc30b2 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -4321,7 +4321,10 @@  Returns the frame's resume address.
 @end defun
 
 @defun Frame.block ()
-Return the frame's code block.  @xref{Blocks In Python}.
+Return the frame's code block.  @xref{Blocks In Python}.  If the frame
+does not have a block -- for example, if there is no debugging
+information for the code in question -- then this will throw an
+exception.
 @end defun
 
 @defun Frame.function ()