From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14312 invoked by alias); 23 Dec 2013 07:23:17 -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 14298 invoked by uid 89); 23 Dec 2013 07:23:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 23 Dec 2013 07:23:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9207111631C for ; Mon, 23 Dec 2013 02:23:53 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iFJ6zi2nfgaM for ; Mon, 23 Dec 2013 02:23:53 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2AE291162AE for ; Mon, 23 Dec 2013 02:23:53 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E07D8E00B6; Mon, 23 Dec 2013 11:23:08 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/doco] Fix gdb.Field attributes documentation for enum types. Date: Mon, 23 Dec 2013 07:23:00 -0000 Message-Id: <1387783386-6072-1-git-send-email-brobecker@adacore.com> X-SW-Source: 2013-12/txt/msg00879.txt.bz2 Hello, The following patch ... | commit 14e75d8ea4fe9ed4dbf292ae4a9745e33e2ff353 | Date: Wed Apr 18 06:46:47 2012 +0000 | | gdb/ | PR symtab/7259: | [...] ... discussed under ... [PATCH] Allow 64-bit enum values http://www.sourceware.org/ml/gdb-patches/2012-03/msg00772.html ... introduced a change in the gdb.Fields API without documenting it: | I took a separate approach from the one I took in: | | http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html | | and removed the overloaded meaning of the bitpos location variable to | fix PR symtab/7259. In the following patch, I introduce a separate | field_location union member 'enumval' which can accept LONGEST and | hence expand enum values to 64-bit signed values. With this change, | bitpos now only is used for (non-negative) offsets into structures, | since the other overload of bitpos (range bounds) were already | separated into struct range_bound. This patch updates the documentation to reflect that change. gdb/doc/ChangeLog: * gdb.texinfo (Types In Python): Fix the documentation of attribute "bitpos" in class gdb.Field for enum types. Add documentation for attribute "enumval" in that same class. Tested on x86_linux. OK to check in? Thanks, -- Joel --- gdb/doc/gdb.texinfo | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 29f1cfc..cb0452f 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -24350,10 +24350,13 @@ into one of these categories, an empty sequence will be returned. Each field is a @code{gdb.Field} object, with some pre-defined attributes: @table @code @item bitpos -This attribute is not available for @code{static} fields (as in -C@t{++} or Java). For non-@code{static} fields, the value is the bit -position of the field. For @code{enum} fields, the value is the -enumeration member's integer representation. +This attribute is not available for @code{enum} or @code{static} +(as in C@t{++} or Java) fields. The value is the bit position of +the field. + +@item enumval +This attribute is only available for @code{enum} fields, and its value +is the enumeration member's integer representation. @item name The name of the field, or @code{None} for anonymous fields. -- 1.8.3.2