From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10190 invoked by alias); 24 Dec 2013 18:49:49 -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 10111 invoked by uid 89); 24 Dec 2013 18:49:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f41.google.com Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 24 Dec 2013 18:49:43 +0000 Received: by mail-pa0-f41.google.com with SMTP id lf10so6808749pab.28 for ; Tue, 24 Dec 2013 10:49:41 -0800 (PST) X-Received: by 10.66.66.202 with SMTP id h10mr34383176pat.70.1387910981713; Tue, 24 Dec 2013 10:49:41 -0800 (PST) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id ha10sm43423316pbd.17.2013.12.24.10.49.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Dec 2013 10:49:40 -0800 (PST) Message-ID: <52b9d744.4a14450a.3598.7895@mx.google.com> Received: by sspiff.org (sSMTP sendmail emulation); Tue, 24 Dec 2013 10:49:15 -0800 Date: Tue, 24 Dec 2013 18:49:00 -0000 From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH v3 08/15] extension language API for GDB: mi changes X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00912.txt.bz2 This patch contains the changes to MI. They're pretty simple and straightforward. Changes from v2: - in mi-cmd-stack.c, replace #include "python/python.h" with "extension.h" Changes from v1: - updates for scripting -> extension renaming 2013-12-24 Doug Evans * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Update to use enum ext_lang_bt_status values. Update call to apply_ext_lang_frame_filter. (mi_cmd_stack_list_locals): Ditto. (mi_cmd_stack_list_args): Ditto. (mi_cmd_stack_list_variables): Ditto. * mi/mi-main.c: Delete #include "python/python-internal.h". Add #include "extension.h". (mi_cmd_list_features): Replace reference to python internal variable gdb_python_initialized with call to ext_lang_initialized_p. diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index eb71366..80e9799 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -33,7 +33,7 @@ #include "exceptions.h" #include "utils.h" #include "mi-getopt.h" -#include "python/python.h" +#include "extension.h" #include #include "mi-parse.h" @@ -69,7 +69,7 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc) int i; struct cleanup *cleanup_stack; struct frame_info *fi; - enum py_bt_status result = PY_BT_ERROR; + enum ext_lang_bt_status result = EXT_LANG_BT_ERROR; int raw_arg = 0; int oind = 0; enum opt @@ -141,14 +141,14 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc) if (py_frame_low == -1) py_frame_low++; - result = apply_frame_filter (get_current_frame (), flags, - NO_VALUES, current_uiout, - py_frame_low, frame_high); + result = apply_ext_lang_frame_filter (get_current_frame (), flags, + NO_VALUES, current_uiout, + py_frame_low, frame_high); } /* Run the inbuilt backtrace if there are no filters registered, or if "--no-frame-filters" has been specified from the command. */ - if (! frame_filters || raw_arg || result == PY_BT_NO_FILTERS) + if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS) { /* Now let's print the frames up to frame_high, or until there are frames in the stack. */ @@ -200,7 +200,7 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc) { struct frame_info *frame; int raw_arg = 0; - enum py_bt_status result = PY_BT_ERROR; + enum ext_lang_bt_status result = EXT_LANG_BT_ERROR; int print_value; int oind = 0; int skip_unavailable = 0; @@ -254,13 +254,13 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc) { int flags = PRINT_LEVEL | PRINT_LOCALS; - result = apply_frame_filter (frame, flags, print_value, - current_uiout, 0, 0); + result = apply_ext_lang_frame_filter (frame, flags, print_value, + current_uiout, 0, 0); } /* Run the inbuilt backtrace if there are no filters registered, or if "--no-frame-filters" has been specified from the command. */ - if (! frame_filters || raw_arg || result == PY_BT_NO_FILTERS) + if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS) { list_args_or_locals (locals, print_value, frame, skip_unavailable); @@ -284,7 +284,7 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) int raw_arg = 0; int oind = 0; int skip_unavailable = 0; - enum py_bt_status result = PY_BT_ERROR; + enum ext_lang_bt_status result = EXT_LANG_BT_ERROR; enum opt { NO_FRAME_FILTERS, @@ -360,14 +360,14 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) if (py_frame_low == -1) py_frame_low++; - result = apply_frame_filter (get_current_frame (), flags, - print_values, current_uiout, - py_frame_low, frame_high); + result = 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 if "--no-frame-filters" has been specified from the command. */ - if (! frame_filters || raw_arg || result == PY_BT_NO_FILTERS) + if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS) { /* Now let's print the frames up to frame_high, or until there are frames in the stack. */ @@ -397,7 +397,7 @@ mi_cmd_stack_list_variables (char *command, char **argv, int argc) { struct frame_info *frame; int raw_arg = 0; - enum py_bt_status result = PY_BT_ERROR; + enum ext_lang_bt_status result = EXT_LANG_BT_ERROR; int print_value; int oind = 0; int skip_unavailable = 0; @@ -450,13 +450,13 @@ mi_cmd_stack_list_variables (char *command, char **argv, int argc) { int flags = PRINT_LEVEL | PRINT_ARGS | PRINT_LOCALS; - result = apply_frame_filter (frame, flags, print_value, - current_uiout, 0, 0); + result = apply_ext_lang_frame_filter (frame, flags, print_value, + current_uiout, 0, 0); } /* Run the inbuilt backtrace if there are no filters registered, or if "--no-frame-filters" has been specified from the command. */ - if (! frame_filters || raw_arg || result == PY_BT_NO_FILTERS) + if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS) { list_args_or_locals (all, print_value, frame, skip_unavailable); diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 63456cd..0ee8d93 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -52,9 +52,7 @@ #include "ctf.h" #include "ada-lang.h" #include "linespec.h" -#ifdef HAVE_PYTHON -#include "python/python-internal.h" -#endif +#include "extension.h" #include #include @@ -1820,10 +1818,8 @@ mi_cmd_list_features (char *command, char **argv, int argc) ui_out_field_string (uiout, NULL, "undefined-command-error-code"); ui_out_field_string (uiout, NULL, "exec-run-start-option"); -#if HAVE_PYTHON - if (gdb_python_initialized) + if (ext_lang_initialized_p (get_ext_lang_defn (EXT_LANG_PYTHON))) ui_out_field_string (uiout, NULL, "python"); -#endif do_cleanups (cleanup); return;