From patchwork Mon Feb 9 23:20:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 4992 Received: (qmail 12387 invoked by alias); 9 Feb 2015 23:21: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 12368 invoked by uid 89); 9 Feb 2015 23:21:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Feb 2015 23:21:38 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t19NLblF017314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 9 Feb 2015 18:21:37 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t19NKkug026307 for ; Mon, 9 Feb 2015 18:21:36 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 17/36] mi/mi-cmd-stack.c|frame filters: print_values <-> ext_lang_frame_args Date: Mon, 9 Feb 2015 23:20:27 +0000 Message-Id: <1423524046-20605-18-git-send-email-palves@redhat.com> In-Reply-To: <1423524046-20605-1-git-send-email-palves@redhat.com> References: <1423524046-20605-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 The enums are value compatible by design, but building in C++ mode trips on them, like: ... gdb/mi/mi-cmd-stack.c:363:34: error: cannot convert ‘print_values’ to ‘ext_lang_frame_args’ for argument ‘3’ to ‘ext_lang_bt_status apply_ext_lang_frame_filter(frame_info*, int, ext_lang_frame_args, ui_out*, int, int)’ ... Fix this by adding a helper function. gdb/ChangeLog: 2015-02-09 Pedro Alves * mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): New function. (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables): Use it. --- gdb/mi/mi-cmd-stack.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 2cbb9bf..18a357e 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -53,6 +53,22 @@ mi_cmd_enable_frame_filters (char *command, char **argv, int argc) frame_filters = 1; } +/* Like apply_ext_lang_frame_filter, but take a print_values */ + +static enum ext_lang_bt_status +mi_apply_ext_lang_frame_filter (struct frame_info *frame, int flags, + enum print_values print_values, + struct ui_out *out, + int frame_low, int frame_high) +{ + /* ext_lang_frame_args's MI options are compatible with MI print + values. */ + return apply_ext_lang_frame_filter (frame, flags, + (enum ext_lang_frame_args) print_values, + out, + frame_low, frame_high); +} + /* Print a list of the stack frames. Args can be none, in which case we want to print the whole backtrace, or a pair of numbers specifying the frame numbers at which to start and stop the @@ -252,8 +268,8 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc) { int flags = PRINT_LEVEL | PRINT_LOCALS; - result = apply_ext_lang_frame_filter (frame, flags, print_value, - current_uiout, 0, 0); + result = mi_apply_ext_lang_frame_filter (frame, flags, print_value, + current_uiout, 0, 0); } /* Run the inbuilt backtrace if there are no filters registered, or @@ -358,9 +374,9 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) if (py_frame_low == -1) py_frame_low++; - result = apply_ext_lang_frame_filter (get_current_frame (), flags, - print_values, current_uiout, - py_frame_low, frame_high); + result = mi_apply_ext_lang_frame_filter (get_current_frame (), flags, + print_values, current_uiout, + py_frame_low, frame_high); } /* Run the inbuilt backtrace if there are no filters registered, or @@ -448,8 +464,9 @@ mi_cmd_stack_list_variables (char *command, char **argv, int argc) { int flags = PRINT_LEVEL | PRINT_ARGS | PRINT_LOCALS; - result = apply_ext_lang_frame_filter (frame, flags, print_value, - current_uiout, 0, 0); + result = mi_apply_ext_lang_frame_filter (frame, flags, + print_value, + current_uiout, 0, 0); } /* Run the inbuilt backtrace if there are no filters registered, or