1 /* MI Interpreter Definitions and Commands for GDB, the GNU debugger.
3 Copyright (C) 2002-2005, 2007-2012 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "gdb_string.h"
23 #include "event-top.h"
24 #include "event-loop.h"
28 #include "exceptions.h"
32 #include "mi-console.h"
33 #include "mi-common.h"
35 #include "gdbthread.h"
39 /* These are the interpreter setup, etc. functions for the MI
42 static void mi_execute_command_wrapper (char *cmd
);
43 static void mi_execute_command_input_handler (char *cmd
);
44 static void mi_command_loop (int mi_version
);
46 /* These are hooks that we put in place while doing interpreter_exec
47 so we can report interesting things that happened "behind the MI's
48 back" in this command. */
50 static int mi_interp_query_hook (const char *ctlstr
, va_list ap
)
51 ATTRIBUTE_PRINTF (1, 0);
53 static void mi3_command_loop (void);
54 static void mi2_command_loop (void);
55 static void mi1_command_loop (void);
57 static void mi_insert_notify_hooks (void);
58 static void mi_remove_notify_hooks (void);
59 static void mi_on_normal_stop (struct bpstats
*bs
, int print_frame
);
61 static void mi_new_thread (struct thread_info
*t
);
62 static void mi_thread_exit (struct thread_info
*t
, int silent
);
63 static void mi_inferior_added (struct inferior
*inf
);
64 static void mi_inferior_appeared (struct inferior
*inf
);
65 static void mi_inferior_exit (struct inferior
*inf
);
66 static void mi_inferior_removed (struct inferior
*inf
);
67 static void mi_on_resume (ptid_t ptid
);
68 static void mi_solib_loaded (struct so_list
*solib
);
69 static void mi_solib_unloaded (struct so_list
*solib
);
70 static void mi_about_to_proceed (void);
71 static void mi_breakpoint_created (struct breakpoint
*b
);
72 static void mi_breakpoint_deleted (struct breakpoint
*b
);
73 static void mi_breakpoint_modified (struct breakpoint
*b
);
74 static void mi_command_param_changed (const char *param
, const char *value
);
76 static int report_initial_inferior (struct inferior
*inf
, void *closure
);
79 mi_interpreter_init (struct interp
*interp
, int top_level
)
81 struct mi_interp
*mi
= XMALLOC (struct mi_interp
);
85 /* Assign the output channel created at startup to its own global,
86 so that we can create a console channel that encapsulates and
87 prefixes all gdb_output-type bits coming from the rest of the
90 raw_stdout
= gdb_stdout
;
92 /* Create MI console channels, each with a different prefix so they
93 can be distinguished. */
94 mi
->out
= mi_console_file_new (raw_stdout
, "~", '"');
95 mi
->err
= mi_console_file_new (raw_stdout
, "&", '"');
97 mi
->targ
= mi_console_file_new (raw_stdout
, "@", '"');
98 mi
->event_channel
= mi_console_file_new (raw_stdout
, "=", 0);
100 name
= interp_name (interp
);
101 /* INTERP_MI selects the most recent released version. "mi2" was
102 released as part of GDB 6.0. */
103 if (strcmp (name
, INTERP_MI
) == 0)
105 else if (strcmp (name
, INTERP_MI1
) == 0)
107 else if (strcmp (name
, INTERP_MI2
) == 0)
109 else if (strcmp (name
, INTERP_MI3
) == 0)
112 gdb_assert_not_reached ("unhandled MI version");
114 mi
->uiout
= mi_out_new (mi_version
);
118 observer_attach_new_thread (mi_new_thread
);
119 observer_attach_thread_exit (mi_thread_exit
);
120 observer_attach_inferior_added (mi_inferior_added
);
121 observer_attach_inferior_appeared (mi_inferior_appeared
);
122 observer_attach_inferior_exit (mi_inferior_exit
);
123 observer_attach_inferior_removed (mi_inferior_removed
);
124 observer_attach_normal_stop (mi_on_normal_stop
);
125 observer_attach_target_resumed (mi_on_resume
);
126 observer_attach_solib_loaded (mi_solib_loaded
);
127 observer_attach_solib_unloaded (mi_solib_unloaded
);
128 observer_attach_about_to_proceed (mi_about_to_proceed
);
129 observer_attach_breakpoint_created (mi_breakpoint_created
);
130 observer_attach_breakpoint_deleted (mi_breakpoint_deleted
);
131 observer_attach_breakpoint_modified (mi_breakpoint_modified
);
132 observer_attach_command_param_changed (mi_command_param_changed
);
134 /* The initial inferior is created before this function is
135 called, so we need to report it explicitly. Use iteration in
136 case future version of GDB creates more than one inferior
138 iterate_over_inferiors (report_initial_inferior
, mi
);
145 mi_interpreter_resume (void *data
)
147 struct mi_interp
*mi
= data
;
149 /* As per hack note in mi_interpreter_init, swap in the output
151 gdb_setup_readline ();
153 /* These overwrite some of the initialization done in
154 _intialize_event_loop. */
155 call_readline
= gdb_readline2
;
156 input_handler
= mi_execute_command_input_handler
;
157 add_file_handler (input_fd
, stdin_event_handler
, 0);
158 async_command_editing_p
= 0;
159 /* FIXME: This is a total hack for now. PB's use of the MI
160 implicitly relies on a bug in the async support which allows
161 asynchronous commands to leak through the commmand loop. The bug
162 involves (but is not limited to) the fact that sync_execution was
163 erroneously initialized to 0. Duplicate by initializing it thus
167 gdb_stdout
= mi
->out
;
168 /* Route error and log output through the MI. */
169 gdb_stderr
= mi
->err
;
170 gdb_stdlog
= mi
->log
;
171 /* Route target output through the MI. */
172 gdb_stdtarg
= mi
->targ
;
173 /* Route target error through the MI as well. */
174 gdb_stdtargerr
= mi
->targ
;
176 /* Replace all the hooks that we know about. There really needs to
177 be a better way of doing this... */
178 clear_interpreter_hooks ();
180 deprecated_show_load_progress
= mi_load_progress
;
182 /* If we're _the_ interpreter, take control. */
183 if (current_interp_named_p (INTERP_MI1
))
184 deprecated_command_loop_hook
= mi1_command_loop
;
185 else if (current_interp_named_p (INTERP_MI2
))
186 deprecated_command_loop_hook
= mi2_command_loop
;
187 else if (current_interp_named_p (INTERP_MI3
))
188 deprecated_command_loop_hook
= mi3_command_loop
;
190 deprecated_command_loop_hook
= mi2_command_loop
;
196 mi_interpreter_suspend (void *data
)
198 gdb_disable_readline ();
202 static struct gdb_exception
203 mi_interpreter_exec (void *data
, const char *command
)
205 char *tmp
= alloca (strlen (command
) + 1);
207 strcpy (tmp
, command
);
208 mi_execute_command_wrapper (tmp
);
209 return exception_none
;
212 /* Never display the default GDB prompt in MI case. */
215 mi_interpreter_prompt_p (void *data
)
221 mi_cmd_interpreter_exec (char *command
, char **argv
, int argc
)
223 struct interp
*interp_to_use
;
225 char *mi_error_message
= NULL
;
226 struct cleanup
*old_chain
;
229 error (_("-interpreter-exec: "
230 "Usage: -interpreter-exec interp command"));
232 interp_to_use
= interp_lookup (argv
[0]);
233 if (interp_to_use
== NULL
)
234 error (_("-interpreter-exec: could not find interpreter \"%s\""),
237 if (!interp_exec_p (interp_to_use
))
238 error (_("-interpreter-exec: interpreter \"%s\" "
239 "does not support command execution"),
242 /* Insert the MI out hooks, making sure to also call the
243 interpreter's hooks if it has any. */
244 /* KRS: We shouldn't need this... Events should be installed and
245 they should just ALWAYS fire something out down the MI
247 mi_insert_notify_hooks ();
249 /* Now run the code. */
251 old_chain
= make_cleanup (null_cleanup
, 0);
252 for (i
= 1; i
< argc
; i
++)
254 struct gdb_exception e
= interp_exec (interp_to_use
, argv
[i
]);
258 mi_error_message
= xstrdup (e
.message
);
259 make_cleanup (xfree
, mi_error_message
);
264 mi_remove_notify_hooks ();
266 if (mi_error_message
!= NULL
)
267 error ("%s", mi_error_message
);
268 do_cleanups (old_chain
);
271 /* This inserts a number of hooks that are meant to produce
272 async-notify ("=") MI messages while running commands in another
273 interpreter using mi_interpreter_exec. The canonical use for this
274 is to allow access to the gdb CLI interpreter from within the MI,
275 while still producing MI style output when actions in the CLI
276 command change GDB's state. */
279 mi_insert_notify_hooks (void)
281 deprecated_query_hook
= mi_interp_query_hook
;
285 mi_remove_notify_hooks (void)
287 deprecated_query_hook
= NULL
;
291 mi_interp_query_hook (const char *ctlstr
, va_list ap
)
297 mi_execute_command_wrapper (char *cmd
)
299 mi_execute_command (cmd
, stdin
== instream
);
302 /* mi_execute_command_wrapper wrapper suitable for INPUT_HANDLER. */
305 mi_execute_command_input_handler (char *cmd
)
307 mi_execute_command_wrapper (cmd
);
309 fputs_unfiltered ("(gdb) \n", raw_stdout
);
310 gdb_flush (raw_stdout
);
314 mi1_command_loop (void)
320 mi2_command_loop (void)
326 mi3_command_loop (void)
332 mi_command_loop (int mi_version
)
334 /* Turn off 8 bit strings in quoted output. Any character with the
335 high bit set is printed using C's octal format. */
336 sevenbit_strings
= 1;
338 /* Tell the world that we're alive. */
339 fputs_unfiltered ("(gdb) \n", raw_stdout
);
340 gdb_flush (raw_stdout
);
346 mi_new_thread (struct thread_info
*t
)
348 struct mi_interp
*mi
= top_level_interpreter_data ();
349 struct inferior
*inf
= find_inferior_pid (ptid_get_pid (t
->ptid
));
353 fprintf_unfiltered (mi
->event_channel
,
354 "thread-created,id=\"%d\",group-id=\"i%d\"",
356 gdb_flush (mi
->event_channel
);
360 mi_thread_exit (struct thread_info
*t
, int silent
)
362 struct mi_interp
*mi
;
363 struct inferior
*inf
;
368 inf
= find_inferior_pid (ptid_get_pid (t
->ptid
));
370 mi
= top_level_interpreter_data ();
371 target_terminal_ours ();
372 fprintf_unfiltered (mi
->event_channel
,
373 "thread-exited,id=\"%d\",group-id=\"i%d\"",
375 gdb_flush (mi
->event_channel
);
379 mi_inferior_added (struct inferior
*inf
)
381 struct mi_interp
*mi
= top_level_interpreter_data ();
383 target_terminal_ours ();
384 fprintf_unfiltered (mi
->event_channel
,
385 "thread-group-added,id=\"i%d\"",
387 gdb_flush (mi
->event_channel
);
391 mi_inferior_appeared (struct inferior
*inf
)
393 struct mi_interp
*mi
= top_level_interpreter_data ();
395 target_terminal_ours ();
396 fprintf_unfiltered (mi
->event_channel
,
397 "thread-group-started,id=\"i%d\",pid=\"%d\"",
399 gdb_flush (mi
->event_channel
);
403 mi_inferior_exit (struct inferior
*inf
)
405 struct mi_interp
*mi
= top_level_interpreter_data ();
407 target_terminal_ours ();
408 if (inf
->has_exit_code
)
409 fprintf_unfiltered (mi
->event_channel
,
410 "thread-group-exited,id=\"i%d\",exit-code=\"%s\"",
411 inf
->num
, int_string (inf
->exit_code
, 8, 0, 0, 1));
413 fprintf_unfiltered (mi
->event_channel
,
414 "thread-group-exited,id=\"i%d\"", inf
->num
);
416 gdb_flush (mi
->event_channel
);
420 mi_inferior_removed (struct inferior
*inf
)
422 struct mi_interp
*mi
= top_level_interpreter_data ();
424 target_terminal_ours ();
425 fprintf_unfiltered (mi
->event_channel
,
426 "thread-group-removed,id=\"i%d\"",
428 gdb_flush (mi
->event_channel
);
432 mi_on_normal_stop (struct bpstats
*bs
, int print_frame
)
434 /* Since this can be called when CLI command is executing,
435 using cli interpreter, be sure to use MI uiout for output,
436 not the current one. */
437 struct ui_out
*mi_uiout
= interp_ui_out (top_level_interpreter ());
443 if (current_uiout
!= mi_uiout
)
445 /* The normal_stop function has printed frame information
446 into CLI uiout, or some other non-MI uiout. There's no
447 way we can extract proper fields from random uiout
448 object, so we print the frame again. In practice, this
449 can only happen when running a CLI command in MI. */
450 struct ui_out
*saved_uiout
= current_uiout
;
451 struct target_waitstatus last
;
454 current_uiout
= mi_uiout
;
456 get_last_target_status (&last_ptid
, &last
);
457 bpstat_print (bs
, last
.kind
);
459 print_stack_frame (get_selected_frame (NULL
), 0, SRC_AND_LOC
);
460 current_uiout
= saved_uiout
;
463 ui_out_field_int (mi_uiout
, "thread-id",
464 pid_to_thread_id (inferior_ptid
));
467 struct cleanup
*back_to
= make_cleanup_ui_out_list_begin_end
468 (mi_uiout
, "stopped-threads");
470 ui_out_field_int (mi_uiout
, NULL
,
471 pid_to_thread_id (inferior_ptid
));
472 do_cleanups (back_to
);
475 ui_out_field_string (mi_uiout
, "stopped-threads", "all");
477 core
= target_core_of_thread (inferior_ptid
);
479 ui_out_field_int (mi_uiout
, "core", core
);
482 fputs_unfiltered ("*stopped", raw_stdout
);
483 mi_out_put (mi_uiout
, raw_stdout
);
484 mi_out_rewind (mi_uiout
);
485 mi_print_timing_maybe ();
486 fputs_unfiltered ("\n", raw_stdout
);
487 gdb_flush (raw_stdout
);
491 mi_about_to_proceed (void)
493 /* Suppress output while calling an inferior function. */
495 if (!ptid_equal (inferior_ptid
, null_ptid
))
497 struct thread_info
*tp
= inferior_thread ();
499 if (tp
->control
.in_infcall
)
506 /* When the element is non-zero, no MI notifications will be emitted in
507 response to the corresponding observers. */
509 struct mi_suppress_notification mi_suppress_notification
=
515 /* Emit notification about a created breakpoint. */
518 mi_breakpoint_created (struct breakpoint
*b
)
520 struct mi_interp
*mi
= top_level_interpreter_data ();
521 struct ui_out
*mi_uiout
= interp_ui_out (top_level_interpreter ());
522 volatile struct gdb_exception e
;
524 if (mi_suppress_notification
.breakpoint
)
530 target_terminal_ours ();
531 fprintf_unfiltered (mi
->event_channel
,
532 "breakpoint-created");
533 /* We want the output from gdb_breakpoint_query to go to
534 mi->event_channel. One approach would be to just call
535 gdb_breakpoint_query, and then use mi_out_put to send the current
536 content of mi_outout into mi->event_channel. However, that will
537 break if anything is output to mi_uiout prior to calling the
538 breakpoint_created notifications. So, we use
540 ui_out_redirect (mi_uiout
, mi
->event_channel
);
541 TRY_CATCH (e
, RETURN_MASK_ERROR
)
542 gdb_breakpoint_query (mi_uiout
, b
->number
, NULL
);
543 ui_out_redirect (mi_uiout
, NULL
);
545 gdb_flush (mi
->event_channel
);
548 /* Emit notification about deleted breakpoint. */
551 mi_breakpoint_deleted (struct breakpoint
*b
)
553 struct mi_interp
*mi
= top_level_interpreter_data ();
555 if (mi_suppress_notification
.breakpoint
)
561 target_terminal_ours ();
563 fprintf_unfiltered (mi
->event_channel
, "breakpoint-deleted,id=\"%d\"",
566 gdb_flush (mi
->event_channel
);
569 /* Emit notification about modified breakpoint. */
572 mi_breakpoint_modified (struct breakpoint
*b
)
574 struct mi_interp
*mi
= top_level_interpreter_data ();
575 struct ui_out
*mi_uiout
= interp_ui_out (top_level_interpreter ());
576 volatile struct gdb_exception e
;
578 if (mi_suppress_notification
.breakpoint
)
584 target_terminal_ours ();
585 fprintf_unfiltered (mi
->event_channel
,
586 "breakpoint-modified");
587 /* We want the output from gdb_breakpoint_query to go to
588 mi->event_channel. One approach would be to just call
589 gdb_breakpoint_query, and then use mi_out_put to send the current
590 content of mi_outout into mi->event_channel. However, that will
591 break if anything is output to mi_uiout prior to calling the
592 breakpoint_created notifications. So, we use
594 ui_out_redirect (mi_uiout
, mi
->event_channel
);
595 TRY_CATCH (e
, RETURN_MASK_ERROR
)
596 gdb_breakpoint_query (mi_uiout
, b
->number
, NULL
);
597 ui_out_redirect (mi_uiout
, NULL
);
599 gdb_flush (mi
->event_channel
);
603 mi_output_running_pid (struct thread_info
*info
, void *arg
)
607 if (ptid_get_pid (*ptid
) == ptid_get_pid (info
->ptid
))
608 fprintf_unfiltered (raw_stdout
,
609 "*running,thread-id=\"%d\"\n",
616 mi_inferior_count (struct inferior
*inf
, void *arg
)
628 mi_on_resume (ptid_t ptid
)
630 struct thread_info
*tp
= NULL
;
632 if (ptid_equal (ptid
, minus_one_ptid
) || ptid_is_pid (ptid
))
633 tp
= inferior_thread ();
635 tp
= find_thread_ptid (ptid
);
637 /* Suppress output while calling an inferior function. */
638 if (tp
->control
.in_infcall
)
641 /* To cater for older frontends, emit ^running, but do it only once
642 per each command. We do it here, since at this point we know
643 that the target was successfully resumed, and in non-async mode,
644 we won't return back to MI interpreter code until the target
645 is done running, so delaying the output of "^running" until then
646 will make it impossible for frontend to know what's going on.
648 In future (MI3), we'll be outputting "^done" here. */
649 if (!running_result_record_printed
&& mi_proceeded
)
651 fprintf_unfiltered (raw_stdout
, "%s^running\n",
652 current_token
? current_token
: "");
655 if (PIDGET (ptid
) == -1)
656 fprintf_unfiltered (raw_stdout
, "*running,thread-id=\"all\"\n");
657 else if (ptid_is_pid (ptid
))
661 /* Backwards compatibility. If there's only one inferior,
662 output "all", otherwise, output each resumed thread
664 iterate_over_inferiors (mi_inferior_count
, &count
);
667 fprintf_unfiltered (raw_stdout
, "*running,thread-id=\"all\"\n");
669 iterate_over_threads (mi_output_running_pid
, &ptid
);
673 struct thread_info
*ti
= find_thread_ptid (ptid
);
676 fprintf_unfiltered (raw_stdout
, "*running,thread-id=\"%d\"\n", ti
->num
);
679 if (!running_result_record_printed
&& mi_proceeded
)
681 running_result_record_printed
= 1;
682 /* This is what gdb used to do historically -- printing prompt even if
683 it cannot actually accept any input. This will be surely removed
684 for MI3, and may be removed even earler. */
685 /* FIXME: review the use of target_is_async_p here -- is that
687 if (!target_is_async_p ())
688 fputs_unfiltered ("(gdb) \n", raw_stdout
);
690 gdb_flush (raw_stdout
);
694 mi_solib_loaded (struct so_list
*solib
)
696 struct mi_interp
*mi
= top_level_interpreter_data ();
698 target_terminal_ours ();
699 if (gdbarch_has_global_solist (target_gdbarch
))
700 fprintf_unfiltered (mi
->event_channel
,
701 "library-loaded,id=\"%s\",target-name=\"%s\","
702 "host-name=\"%s\",symbols-loaded=\"%d\"",
703 solib
->so_original_name
, solib
->so_original_name
,
704 solib
->so_name
, solib
->symbols_loaded
);
706 fprintf_unfiltered (mi
->event_channel
,
707 "library-loaded,id=\"%s\",target-name=\"%s\","
708 "host-name=\"%s\",symbols-loaded=\"%d\","
709 "thread-group=\"i%d\"",
710 solib
->so_original_name
, solib
->so_original_name
,
711 solib
->so_name
, solib
->symbols_loaded
,
712 current_inferior ()->num
);
714 gdb_flush (mi
->event_channel
);
718 mi_solib_unloaded (struct so_list
*solib
)
720 struct mi_interp
*mi
= top_level_interpreter_data ();
722 target_terminal_ours ();
723 if (gdbarch_has_global_solist (target_gdbarch
))
724 fprintf_unfiltered (mi
->event_channel
,
725 "library-unloaded,id=\"%s\",target-name=\"%s\","
727 solib
->so_original_name
, solib
->so_original_name
,
730 fprintf_unfiltered (mi
->event_channel
,
731 "library-unloaded,id=\"%s\",target-name=\"%s\","
732 "host-name=\"%s\",thread-group=\"i%d\"",
733 solib
->so_original_name
, solib
->so_original_name
,
734 solib
->so_name
, current_inferior ()->num
);
736 gdb_flush (mi
->event_channel
);
739 /* Emit notification about the command parameter change. */
742 mi_command_param_changed (const char *param
, const char *value
)
744 struct mi_interp
*mi
= top_level_interpreter_data ();
745 struct ui_out
*mi_uiout
= interp_ui_out (top_level_interpreter ());
747 if (mi_suppress_notification
.cmd_param_changed
)
750 target_terminal_ours ();
752 fprintf_unfiltered (mi
->event_channel
,
753 "cmd-param-changed");
755 ui_out_redirect (mi_uiout
, mi
->event_channel
);
757 ui_out_field_string (mi_uiout
, "param", param
);
758 ui_out_field_string (mi_uiout
, "value", value
);
760 ui_out_redirect (mi_uiout
, NULL
);
762 gdb_flush (mi
->event_channel
);
766 report_initial_inferior (struct inferior
*inf
, void *closure
)
768 /* This function is called from mi_intepreter_init, and since
769 mi_inferior_added assumes that inferior is fully initialized
770 and top_level_interpreter_data is set, we cannot call
772 struct mi_interp
*mi
= closure
;
774 target_terminal_ours ();
775 fprintf_unfiltered (mi
->event_channel
,
776 "thread-group-added,id=\"i%d\"",
778 gdb_flush (mi
->event_channel
);
782 static struct ui_out
*
783 mi_ui_out (struct interp
*interp
)
785 struct mi_interp
*mi
= interp_data (interp
);
790 /* Save the original value of raw_stdout here when logging, so we can
791 restore correctly when done. */
793 static struct ui_file
*saved_raw_stdout
;
795 /* Do MI-specific logging actions; save raw_stdout, and change all
796 the consoles to use the supplied ui-file(s). */
799 mi_set_logging (struct interp
*interp
, int start_log
,
800 struct ui_file
*out
, struct ui_file
*logfile
)
802 struct mi_interp
*mi
= interp_data (interp
);
809 /* The tee created already is based on gdb_stdout, which for MI
810 is a console and so we end up in an infinite loop of console
811 writing to ui_file writing to console etc. So discard the
812 existing tee (it hasn't been used yet, and MI won't ever use
813 it), and create one based on raw_stdout instead. */
816 ui_file_delete (out
);
817 out
= tee_file_new (raw_stdout
, 0, logfile
, 0);
820 saved_raw_stdout
= raw_stdout
;
825 raw_stdout
= saved_raw_stdout
;
826 saved_raw_stdout
= NULL
;
829 mi_console_set_raw (mi
->out
, raw_stdout
);
830 mi_console_set_raw (mi
->err
, raw_stdout
);
831 mi_console_set_raw (mi
->log
, raw_stdout
);
832 mi_console_set_raw (mi
->targ
, raw_stdout
);
833 mi_console_set_raw (mi
->event_channel
, raw_stdout
);
838 extern initialize_file_ftype _initialize_mi_interp
; /* -Wmissing-prototypes */
841 _initialize_mi_interp (void)
843 static const struct interp_procs procs
=
845 mi_interpreter_init
, /* init_proc */
846 mi_interpreter_resume
, /* resume_proc */
847 mi_interpreter_suspend
, /* suspend_proc */
848 mi_interpreter_exec
, /* exec_proc */
849 mi_interpreter_prompt_p
, /* prompt_proc_p */
850 mi_ui_out
, /* ui_out_proc */
851 mi_set_logging
/* set_logging_proc */
854 /* The various interpreter levels. */
855 interp_add (interp_new (INTERP_MI1
, &procs
));
856 interp_add (interp_new (INTERP_MI2
, &procs
));
857 interp_add (interp_new (INTERP_MI3
, &procs
));
858 interp_add (interp_new (INTERP_MI
, &procs
));