This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 08/13] script language API for GDB: mi changes


This patch contains the changes to MI.
They're pretty simple and straightforward.

Changes from v1:
- updates for scripting -> extension renaming

2013-12-10  Doug Evans  <xdje42@gmail.com>

	* 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..7b995ed 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -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 07f1dc1..a55a1d6 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 <ctype.h>
 #include <sys/time.h>
@@ -1819,10 +1817,8 @@ mi_cmd_list_features (char *command, char **argv, int argc)
       ui_out_field_string (uiout, NULL, "info-gdb-mi-command");
       ui_out_field_string (uiout, NULL, "undefined-command-error-code");
 
-#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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]