void _initialize_tui_interp (void) { static const struct interp_procs procs = { tui_init, tui_resume, tui_suspend, tui_exec, tui_display_prompt_p, tui_command_loop, }; struct interp *tui_interp; /* Create a default uiout builder for the TUI. */ tui_out = tui_out_new (gdb_stdout); interp_add (interp_new (INTERP_TUI, NULL, tui_out, &procs)); if (interpreter_p && strcmp (interpreter_p, INTERP_TUI) == 0) tui_start_enabled = 1; if (interpreter_p && strcmp (interpreter_p, INTERP_CONSOLE) == 0) { xfree (interpreter_p); interpreter_p = xstrdup (INTERP_TUI); } }
void _initialize_tui_interp (void) { static const struct interp_procs procs = { tui_init, tui_resume, tui_suspend, tui_exec, tui_ui_out, NULL, cli_command_loop }; /* Create a default uiout builder for the TUI. */ tui_interp = interp_new (INTERP_TUI, &procs); interp_add (tui_interp); if (interpreter_p && strcmp (interpreter_p, INTERP_TUI) == 0) tui_start_enabled = 1; if (interpreter_p && strcmp (interpreter_p, INTERP_CONSOLE) == 0) { xfree (interpreter_p); interpreter_p = xstrdup (INTERP_TUI); } }
void _initialize_cli_interp (void) { static const struct interp_procs procs = { cli_interpreter_init, /* init_proc */ cli_interpreter_resume, /* resume_proc */ cli_interpreter_suspend, /* suspend_proc */ cli_interpreter_exec, /* exec_proc */ cli_interpreter_display_prompt_p, /* prompt_proc_p */ /* APPLE LOCAL cli_command_loop */ cli_command_loop, /* APPLE LOCAL completion */ cli_interpreter_complete }; struct interp *cli_interp; /* APPLE LOCAL begin console-quoted interpreter */ /* And here we initialize the console-quoted interpreter. */ static const struct interp_procs quoted_procs = { cli_interpreter_init, /* init_proc */ cli_quoted_interpreter_resume, /* resume_proc */ cli_interpreter_suspend, /* suspend_proc */ cli_interpreter_exec, /* exec_proc */ cli_interpreter_display_prompt_p, /* prompt_proc_p */ cli_command_loop, cli_interpreter_complete }; struct ui_out *tmp_ui_out; struct ui_file *raw_stdout; /* APPLE LOCAL end console-quoted interpreter */ /* Create a default uiout builder for the CLI. */ cli_uiout = cli_out_new (gdb_stdout); cli_interp = interp_new (INTERP_CONSOLE, NULL, cli_uiout, &procs); interp_add (cli_interp); /* APPLE LOCAL begin console-quoted interpreter */ raw_stdout = stdio_fileopen (stdout); tmp_ui_out = cli_quoted_out_new (raw_stdout); cli_interp = interp_new ("console-quoted", NULL, tmp_ui_out, "ed_procs); interp_add (cli_interp); /* second call */ /* APPLE LOCAL end console-quoted interpreter */ }
void _initialize_mi_interp (void) { static const struct interp_procs procs = { mi_interpreter_init, /* init_proc */ mi_interpreter_resume, /* resume_proc */ mi_interpreter_suspend, /* suspend_proc */ mi_interpreter_exec, /* exec_proc */ mi_ui_out, /* ui_out_proc */ mi_set_logging, /* set_logging_proc */ mi_command_loop /* command_loop_proc */ }; /* The various interpreter levels. */ interp_add (interp_new (INTERP_MI1, &procs)); interp_add (interp_new (INTERP_MI2, &procs)); interp_add (interp_new (INTERP_MI3, &procs)); interp_add (interp_new (INTERP_MI, &procs)); }
void _initialize_mi_interp (void) { static const struct interp_procs procs = { mi_interpreter_init, /* init_proc */ mi_interpreter_resume, /* resume_proc */ mi_interpreter_suspend, /* suspend_proc */ mi_interpreter_exec, /* exec_proc */ mi_interpreter_prompt_p /* prompt_proc_p */ }; /* The various interpreter levels. */ interp_add (interp_new (INTERP_MI1, NULL, mi_out_new (1), &procs)); interp_add (interp_new (INTERP_MI2, NULL, mi_out_new (2), &procs)); interp_add (interp_new (INTERP_MI3, NULL, mi_out_new (3), &procs)); /* "mi" selects the most recent released version. "mi2" was released as part of GDB 6.0. */ interp_add (interp_new (INTERP_MI, NULL, mi_out_new (2), &procs)); }
void _initialize_gdbtk_interp (void) { static const struct interp_procs procs = { gdbtk_interpreter_init, /* init_proc */ gdbtk_interpreter_resume, /* resume_proc */ gdbtk_interpreter_suspend, /* suspend_proc */ gdbtk_interpreter_exec, /* exec_proc */ gdbtk_interpreter_display_prompt_p, /* prompt_proc_p */ gdbtk_interpreter_ui_out /* ui_out_proc */ }; interp_add (interp_new ("insight", &procs)); }
int main() { interp_t *interp; setenv("LUA_PATH", "?/init.lua;?.lua;?", 1); interp_free(NULL); /* should not crash */ interp = interp_new(0, -1); EXPECT(*interp_errstr(interp) == '\0', "%s", interp_errstr(interp)); EXPECT(interp != NULL, "interp was NULL"); EXPECT(interp_load(interp, "IAHUHF.EAHFE.FHE.FH") == BIRK_ERROR, "unexpected success of nonexistent library"); EXPECT(interp_load(interp, "birk.irc_test") == BIRK_OK, "%s", interp_errstr(interp)); interp_free(interp); return EXIT_SUCCESS; }
void _initialize_cli_interp (void) { static const struct interp_procs procs = { cli_interpreter_init, /* init_proc */ cli_interpreter_resume, /* resume_proc */ cli_interpreter_suspend, /* suspend_proc */ cli_interpreter_exec, /* exec_proc */ cli_interpreter_display_prompt_p /* prompt_proc_p */ }; struct interp *cli_interp; /* Create a default uiout builder for the CLI. */ cli_uiout = cli_out_new (gdb_stdout); cli_interp = interp_new (INTERP_CONSOLE, NULL, cli_uiout, &procs); interp_add (cli_interp); }
void _initialize_gdbtk_interp (void) { static const struct interp_procs procs = { gdbtk_interpreter_init, /* init_proc */ gdbtk_interpreter_resume, /* resume_proc */ gdbtk_interpreter_suspend, /* suspend_proc */ gdbtk_interpreter_exec, /* exec_proc */ gdbtk_interpreter_display_prompt_p /* prompt_proc_p */ }; struct interp *gdbtk_interp; gdbtk_data = (struct gdbtk_interp_data *) xmalloc (sizeof (struct gdbtk_interp_data)); memset (gdbtk_data, 0, sizeof (struct gdbtk_interp_data)); gdbtk_data->_stdout = gdbtk_fileopen (); gdbtk_data->_stderr = gdbtk_fileopen (); gdbtk_data->_stdlog = gdbtk_fileopen (); gdbtk_data->_stdtarg = gdbtk_fileopen (); gdbtk_interp = interp_new ("insight", gdbtk_data, cli_out_new (gdbtk_data->_stdout), &procs); interp_add (gdbtk_interp); }