From patchwork Tue Apr 25 19:41:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 20148 Received: (qmail 22783 invoked by alias); 25 Apr 2017 19:41:39 -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 22679 invoked by uid 89); 25 Apr 2017 19:41:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*tom, completed X-HELO: gproxy9.mail.unifiedlayer.com Received: from gproxy9-pub.mail.unifiedlayer.com (HELO gproxy9.mail.unifiedlayer.com) (69.89.20.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Apr 2017 19:41:33 +0000 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id 18CFD1E07DB for ; Tue, 25 Apr 2017 13:41:33 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id CjhW1v0032f2jeq01jhZpp; Tue, 25 Apr 2017 13:41:33 -0600 X-Authority-Analysis: v=2.2 cv=VKStp5HX c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=AzvcPWV-tVgA:10 a=zstS-IiYAAAA:8 a=cfI38WN2CeNEdGPLK5UA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 75-166-63-71.hlrn.qwest.net ([75.166.63.71]:40598 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1d36L3-0000OG-Nr; Tue, 25 Apr 2017 13:41:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 04/10] Remove EXT_LANG_BT_COMPLETED Date: Tue, 25 Apr 2017 13:41:07 -0600 Message-Id: <20170425194113.17862-5-tom@tromey.com> In-Reply-To: <20170425194113.17862-1-tom@tromey.com> References: <20170425194113.17862-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1d36L3-0000OG-Nr X-Source-Sender: 75-166-63-71.hlrn.qwest.net (bapiya.Home) [75.166.63.71]:40598 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== While looking at the frame filter code, I noticed that EXT_LANG_BT_COMPLETED is not really needed. Semantically there is no difference between the "completed" and "ok" results. So, this patch removes this constant. ChangeLog 2017-04-25 Tom Tromey * python/py-framefilter.c (py_print_frame): Return EXT_LANG_BT_OK. (gdbpy_apply_frame_filter): Update comment. * extension.h (enum ext_lang_bt_status) : Remove. : Change value. --- gdb/ChangeLog | 9 +++++++++ gdb/extension.h | 6 +----- gdb/python/py-framefilter.c | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f68e32c..176332a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2017-04-25 Tom Tromey + * python/py-framefilter.c (py_print_frame): Return + EXT_LANG_BT_OK. + (gdbpy_apply_frame_filter): Update comment. + * extension.h (enum ext_lang_bt_status) : + Remove. + : Change value. + +2017-04-25 Tom Tromey + PR backtrace/15582: * stack.c (backtrace_command): Parse "elide" argument. * python/py-framefilter.c (py_print_frame): Handle PRINT_ELIDE. diff --git a/gdb/extension.h b/gdb/extension.h index 7c35502..59205e1 100644 --- a/gdb/extension.h +++ b/gdb/extension.h @@ -76,13 +76,9 @@ enum ext_lang_bt_status succeeded. */ EXT_LANG_BT_OK = 1, - /* Return when the frame filter process is complete, and all - operations have succeeded. */ - EXT_LANG_BT_COMPLETED = 2, - /* Return when the frame filter process is complete, but there were no filter registered and enabled to process. */ - EXT_LANG_BT_NO_FILTERS = 3 + EXT_LANG_BT_NO_FILTERS = 2 }; /* Flags to pass to apply_extlang_frame_filter. */ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index f0474a9..2bbbfbe 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -916,7 +916,7 @@ py_print_args (PyObject *filter, containing all the frames level that have already been printed. If a frame level has been printed, do not print it again (in the case of elided frames). Returns EXT_LANG_BT_ERROR on error, with any - GDB exceptions converted to a Python exception, or EXT_LANG_BT_COMPLETED + GDB exceptions converted to a Python exception, or EXT_LANG_BT_OK on success. It can also throw an exception RETURN_QUIT. */ static enum ext_lang_bt_status @@ -969,7 +969,7 @@ py_print_frame (PyObject *filter, int flags, if (py_mi_print_variables (filter, out, &opts, args_type, frame) == EXT_LANG_BT_ERROR) return EXT_LANG_BT_ERROR; - return EXT_LANG_BT_COMPLETED; + return EXT_LANG_BT_OK; } gdb::optional tuple; @@ -1270,7 +1270,7 @@ py_print_frame (PyObject *filter, int flags, } } - return EXT_LANG_BT_COMPLETED; + return EXT_LANG_BT_OK; } /* Helper function to initiate frame filter invocation at starting @@ -1328,7 +1328,7 @@ bootstrap_python_frame_filters (struct frame_info *frame, format, OUT is the output stream to print. FRAME_LOW is the beginning of the slice of frames to print, and FRAME_HIGH is the upper limit of the frames to count. Returns EXT_LANG_BT_ERROR on error, - or EXT_LANG_BT_COMPLETED on success. */ + or EXT_LANG_BT_OK on success. */ enum ext_lang_bt_status gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,