From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28104 invoked by alias); 6 Jul 2014 17:57:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28088 invoked by uid 89); 6 Jul 2014 17:57:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f47.google.com Received: from mail-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 06 Jul 2014 17:57:36 +0000 Received: by mail-qa0-f47.google.com with SMTP id hw13so2757463qab.34 for ; Sun, 06 Jul 2014 10:57:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=XPVvd0ZDebRcHTSbi0uwkKjr7xuJz9HHxPxA7AWLGyg=; b=GAOhgDR7oloPUXB6MzVL4GrsKYa9NbZUV8tRrHFmmGHhawdG36zlA73G+Ur50Abbgl kraQ5YULlyeHruYpWgj5fPsf794I4WALRZLeEhqEjwk+h9ngL0ibl4O/rshfiJ0ThP9u lSq7Au9gaVDLqzSK1KnNbzXpKh80XE2Jlx3V/b+6ZOkzhAk9vThDrK1ButK4QeYGIRtf TEpAQG2K6xX1uHje9Fty9nLnYUsy3vR7ANWQ/qN363HSsrLUhMdWJs55Iu6m6LXQebpN OJIupkbhiNxhQTqzyTb1vNX9uG5khyQaYSgs3O9fbSOyGc9N1EBDQhexCa/I2GBvsYeZ IgPA== X-Gm-Message-State: ALoCoQkzWQtDPH0BHNEYzgCADoTzSLWMGfUzSY2nghvN7SsmQBPPT0nOBcIsIAm1EL60F2ZuaBBc X-Received: by 10.140.101.245 with SMTP id u108mr14320788qge.48.1404669454060; Sun, 06 Jul 2014 10:57:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.44.193 with HTTP; Sun, 6 Jul 2014 10:57:13 -0700 (PDT) In-Reply-To: <1403649524-10769-1-git-send-email-jlebar@google.com> References: <1403649524-10769-1-git-send-email-jlebar@google.com> From: Justin Lebar Date: Sun, 06 Jul 2014 17:57:00 -0000 Message-ID: Subject: Re: [PATCH v2] Fix documentation for Type.template_argument. To: gdb-patches@sourceware.org Cc: Justin Lebar Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-07/txt/msg00102.txt.bz2 Ping on this patch? (Would it be appropriate to find the last person to touch this documentation and cc him/her, or do something else like that?) Regards, -Justin On Tue, Jun 24, 2014 at 3:38 PM, Justin Lebar wrote: > 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 > > * 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..266af80 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 @var{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 >