From: Justin Lebar <jlebar@google.com>
To: gdb-patches@sourceware.org
Cc: Justin Lebar <jlebar@google.com>
Subject: [PATCH] Fix documentation for Type.template_argument.
Date: Tue, 24 Jun 2014 19:01:00 -0000 [thread overview]
Message-ID: <1403636496-9795-1-git-send-email-jlebar@google.com> (raw)
In the Python API, Type.template_argument(n) returns either a gdb.Type
or a gdb.Value, depending on whether the n'th template argument is a C++
type or a C++ value.
Also add a note that Type.template_argument(n) throws an exception if n
is out of range (as opposed to, say, returning None).
There's one piece of the documentation I still don't understand:
> If block is given, then name is looked up in that scope. Otherwise, it
> is searched for globally.
What is 'name', exactly, and why are we looking it up? I'd be happy to
fix this up if we could clarify this, but otherwise this patch stands on
its own.
2014-06-18 Justin Lebar <jlebar@google.com>
* python.texi (Types In Python): Type.template_argument(n) returns a
gdb.Value or a gdb.Type and throws an exception if n is out of
range.
---
gdb/doc/python.texi | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 4688783..f9e0b0c 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1048,11 +1048,12 @@ exception.
@defun Type.template_argument (n @r{[}, block@r{]})
If this @code{gdb.Type} is an instantiation of a template, this will
-return a new @code{gdb.Type} which represents the type of the
-@var{n}th template argument.
+return a new @code{gdb.Value} or @code{gdb.Type} which represents the
+value of the @var{n}th template argument (indexed starting at 0).
-If this @code{gdb.Type} is not a template type, this will throw an
-exception. Ordinarily, only C@t{++} code will have template types.
+If this @code{gdb.Type} is not a template type, or if the type has fewer
+than N template arguments, this will throw an exception. Ordinarily,
+only C@t{++} code will have template types.
If @var{block} is given, then @var{name} is looked up in that scope.
Otherwise, it is searched for globally.
--
2.0.0.526.g5318336
next reply other threads:[~2014-06-24 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 19:01 Justin Lebar [this message]
2014-06-24 19:19 ` Eli Zaretskii
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=1403636496-9795-1-git-send-email-jlebar@google.com \
--to=jlebar@google.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