From patchwork Sat Jul 4 20:14:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciro Santilli X-Patchwork-Id: 7517 Received: (qmail 128123 invoked by alias); 4 Jul 2015 20:14:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 128114 invoked by uid 89); 4 Jul 2015 20:14:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f47.google.com Received: from mail-la0-f47.google.com (HELO mail-la0-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 04 Jul 2015 20:14:20 +0000 Received: by lagh6 with SMTP id h6so116369781lag.2 for ; Sat, 04 Jul 2015 13:14:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.27.197 with SMTP id v5mr41773019lag.64.1436040857431; Sat, 04 Jul 2015 13:14:17 -0700 (PDT) Received: by 10.152.1.70 with HTTP; Sat, 4 Jul 2015 13:14:17 -0700 (PDT) Date: Sat, 4 Jul 2015 22:14:17 +0200 Message-ID: Subject: [PATCH] gdb python LineTable.source_lines docstring returns List, not FrozenSet From: Ciro Santilli To: gdb-patches@sourceware.org This can be seen at https://github.com/cirosantilli/binutils-gdb/blob/2edf562a17871d32b814acda9ced29856d405d6c/gdb/python/py-linetable.c#L285: source_list = PyDict_Keys (source_dict); return source_list; PyDict_Keys makes list, not a frozen set: https://docs.python.org/3/c-api/dict.html#c.PyDict_Keys The python.texi is correct and says List. I wish we could concentrate all documentation on a single place to avoid such clashes (only texi or only docstrings). From 2edf562a17871d32b814acda9ced29856d405d6c Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sat, 4 Jul 2015 21:56:58 +0200 Subject: [PATCH] gdb python LineTable.source_lines docstring returns List, not FrozenSet --- gdb/python/py-linetable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c index 195a8b3..82b4cfc 100644 --- a/gdb/python/py-linetable.c +++ b/gdb/python/py-linetable.c @@ -227,8 +227,8 @@ ltpy_has_line (PyObject *self, PyObject *args) Py_RETURN_FALSE; } -/* Implementation of gdb.LineTable.source_lines (self) -> FrozenSet. - Returns a Python FrozenSet that contains source line entries in the +/* Implementation of gdb.LineTable.source_lines (self) -> List. + Returns a Python List that contains source line entries in the line table. This function will just return the source lines without corresponding addresses. */ @@ -488,8 +488,8 @@ Return executable locations for a given source line." }, "has_line (lineno) -> Boolean\n\ Return TRUE if this line has executable information, FALSE if not." }, { "source_lines", ltpy_get_all_source_lines, METH_NOARGS, - "source_lines () -> FrozenSet\n\ -Return a frozen set of all executable source lines." }, + "source_lines () -> List\n\ +Return a list of all executable source lines." }, { "is_valid", ltpy_is_valid, METH_NOARGS, "is_valid () -> Boolean.\n\ Return True if this Linetable is valid, False if not." },