* [PATCH] Update documentatio for Python Frame.older and Frame.newer
@ 2023-05-19 15:41 Tom Tromey
2023-05-19 16:09 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2023-05-19 15:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
I noticed that Frame.older and Frame.newer don't document that they
return None at the ends of the stack. This patch updates the
documentation, and also fixes a somewhat related typo in a comment
that I noticed while digging into this.
---
gdb/doc/python.texi | 6 ++++--
gdb/frame.c | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index d93ee55690e..4066dafb601 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -5367,11 +5367,13 @@ Return the symbol for the function corresponding to this frame.
@end defun
@defun Frame.older ()
-Return the frame that called this frame.
+Return the frame that called this frame. If this is the oldest frame,
+@code{None} is returned.
@end defun
@defun Frame.newer ()
-Return the frame called by this frame.
+Return the frame called by this frame. If this is the newest frame,
+@code{None} is returned.
@end defun
@defun Frame.find_sal ()
diff --git a/gdb/frame.c b/gdb/frame.c
index c8b8d2e257e..57d53410cc0 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2601,7 +2601,7 @@ inside_entry_func (frame_info_ptr this_frame)
}
/* Return a structure containing various interesting information about
- the frame that called THIS_FRAME. Returns NULL if there is entier
+ the frame that called THIS_FRAME. Returns NULL if there is either
no such frame or the frame fails any of a set of target-independent
condition that should terminate the frame chain (e.g., as unwinding
past main()).
--
2.40.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Update documentatio for Python Frame.older and Frame.newer
2023-05-19 15:41 [PATCH] Update documentatio for Python Frame.older and Frame.newer Tom Tromey
@ 2023-05-19 16:09 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-05-19 16:09 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> Cc: Tom Tromey <tromey@adacore.com>
> Date: Fri, 19 May 2023 09:41:37 -0600
> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
>
> I noticed that Frame.older and Frame.newer don't document that they
> return None at the ends of the stack. This patch updates the
> documentation, and also fixes a somewhat related typo in a comment
> that I noticed while digging into this.
> ---
> gdb/doc/python.texi | 6 ++++--
> gdb/frame.c | 2 +-
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
> index d93ee55690e..4066dafb601 100644
> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -5367,11 +5367,13 @@ Return the symbol for the function corresponding to this frame.
> @end defun
>
> @defun Frame.older ()
> -Return the frame that called this frame.
> +Return the frame that called this frame. If this is the oldest frame,
> +@code{None} is returned.
> @end defun
>
> @defun Frame.newer ()
> -Return the frame called by this frame.
> +Return the frame called by this frame. If this is the newest frame,
> +@code{None} is returned.
> @end defun
This is OK, but please use "return @code{None}" instead of
"@code{None} is returned", to avoid passive voice.
Thanks.
Approved-By: Eli Zaretskii <eliz@gnu.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-19 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 15:41 [PATCH] Update documentatio for Python Frame.older and Frame.newer Tom Tromey
2023-05-19 16:09 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).