From: Doug Evans <xdje42@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v3 08/15] extension language API for GDB: mi changes
Date: Tue, 24 Dec 2013 18:49:00 -0000 [thread overview]
Message-ID: <52b9d744.4a14450a.3598.7895@mx.google.com> (raw)
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 <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..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 <ctype.h>
#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 <ctype.h>
#include <sys/time.h>
@@ -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;
reply other threads:[~2013-12-24 18:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52b9d744.4a14450a.3598.7895@mx.google.com \
--to=xdje42@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).