From patchwork Fri Mar 23 20:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 26447 Received: (qmail 17136 invoked by alias); 23 Mar 2018 20:55:20 -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 16799 invoked by uid 89); 23 Mar 2018 20:55:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:ui_out_ X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.70.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Mar 2018 20:55:17 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 5450540108391 for ; Fri, 23 Mar 2018 15:55:16 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id zTiWebNfFQUwqzTiWeS0tV; Fri, 23 Mar 2018 15:55:16 -0500 Received: from 174-29-60-18.hlrn.qwest.net ([174.29.60.18]:33476 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ezTiW-001cSz-3z; Fri, 23 Mar 2018 15:55:16 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA v3 04/13] Remove EXT_LANG_BT_COMPLETED Date: Fri, 23 Mar 2018 14:55:03 -0600 Message-Id: <20180323205512.14434-5-tom@tromey.com> In-Reply-To: <20180323205512.14434-1-tom@tromey.com> References: <20180323205512.14434-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1ezTiW-001cSz-3z X-Source-Sender: 174-29-60-18.hlrn.qwest.net (bapiya.Home) [174.29.60.18]:33476 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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. gdb/ChangeLog 2018-03-23 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/extension.h b/gdb/extension.h index a97292875a..c675ae2446 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 aae8d5decf..1dc15ae14e 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, frame_filter_flags 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, frame_filter_flags 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,