public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/python: test exception case for gdb.solib_name
Date: Fri, 15 Mar 2024 14:39:52 +0200	[thread overview]
Message-ID: <86cyrv8y93.fsf@gnu.org> (raw)
In-Reply-To: <856ee4315d2d615388efe8352b29379feefa4054.1710503245.git.aburgess@redhat.com> (message from Andrew Burgess on Fri, 15 Mar 2024 11:47:45 +0000)

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Fri, 15 Mar 2024 11:47:45 +0000
> 
> I noticed that gdb.solib_name() and Progspace.solib_name() were not
> documented as being able to throw an exception, but in some cases it
> is possible to get an exception from these functions.  An exception
> can occur when the address argument can't be converted to an unsigned
> integer.
> 
> This commit extends the documentation to mention the exception case,
> and I've added a couple of tests to cover this case.

Thanks.

> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -521,7 +521,11 @@
>  
>  @defun gdb.solib_name (address)
>  Return the name of the shared library holding the given @var{address}
> -as a string, or @code{None}.  This is identical to
> +as a string, or @code{None} if there is no library containing
> +@var{address}.  If @var{address} can't be converted to a unsigned
                                                          ^^^^^^^^^^
"an unsigned"

> +integer address then an exception will be raised.

Btw, what does it mean for ADDRESS to not be convertible to an
unsigned integer address?  Does it mean ADDRESS is not an integral
number or something?  Maybe we should say that explicitly.

>  @defun Progspace.solib_name (address)
>  Return the name of the shared library holding the given @var{address}
> -as a string, or @code{None}.
> +as a string, or @code{None} if there is no library containing
> +@var{address}.  If @var{address} can't be converted to a unsigned
> +integer address then an exception will be raised.

Same here.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

  reply	other threads:[~2024-03-15 12:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 11:47 Andrew Burgess
2024-03-15 12:39 ` Eli Zaretskii [this message]
2024-03-15 13:16 ` Tom Tromey
2024-03-19  9:38   ` Andrew Burgess
2024-03-19 15:55     ` Tom Tromey
2024-03-19 16:04       ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86cyrv8y93.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).