aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c8
-rw-r--r--gdb/cli/cli-script.c23
2 files changed, 26 insertions, 5 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 9374c1d..bfcd975 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1225,7 +1225,7 @@ show_user (char *args, int from_tty)
const char *comname = args;
c = lookup_cmd (&comname, cmdlist, "", 0, 1);
- /* c->user_commands would be NULL if it's a python command. */
+ /* c->user_commands would be NULL if it's a python/scheme command. */
if (c->class != class_user || !c->user_commands)
error (_("Not a user command."));
show_user_1 (c, "", args, gdb_stdout);
@@ -1831,7 +1831,7 @@ you must type \"disassemble 'foo.c'::bar\" and not \"disassemble foo.c:bar\"."))
Run the ``make'' program using the rest of the line as arguments."));
set_cmd_completer (c, filename_completer);
add_cmd ("user", no_class, show_user, _("\
-Show definitions of non-python user defined commands.\n\
+Show definitions of non-python/scheme user defined commands.\n\
Argument is the name of the user defined command.\n\
With no argument, show definitions of all user defined commands."), &showlist);
add_com ("apropos", class_support, apropos_command,
@@ -1839,8 +1839,8 @@ With no argument, show definitions of all user defined commands."), &showlist);
add_setshow_uinteger_cmd ("max-user-call-depth", no_class,
&max_user_call_depth, _("\
-Set the max call depth for non-python user-defined commands."), _("\
-Show the max call depth for non-python user-defined commands."), NULL,
+Set the max call depth for non-python/scheme user-defined commands."), _("\
+Show the max call depth for non-python/scheme user-defined commands."), NULL,
NULL,
show_max_user_call_depth,
&setlist, &showlist);
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 47cad75..246fcc9 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -91,6 +91,7 @@ multi_line_command_p (enum command_control_type type)
case while_stepping_control:
case commands_control:
case python_control:
+ case guile_control:
return 1;
default:
return 0;
@@ -274,6 +275,19 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd,
continue;
}
+ if (list->control_type == guile_control)
+ {
+ ui_out_field_string (uiout, NULL, "guile");
+ ui_out_text (uiout, "\n");
+ print_command_lines (uiout, *list->body_list, depth + 1);
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_field_string (uiout, NULL, "end");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
/* Ignore illegal command type and try next. */
list = list->next;
} /* while (list) */
@@ -589,6 +603,7 @@ execute_control_command (struct command_line *cmd)
}
case python_control:
+ case guile_control:
{
eval_ext_lang_from_control_command (cmd);
ret = simple_control;
@@ -1028,6 +1043,11 @@ process_next_line (char *p, struct command_line **command, int parse_commands,
here. */
*command = build_command_line (python_control, "");
}
+ else if (p_end - p == 5 && !strncmp (p, "guile", 5))
+ {
+ /* Note that we ignore the inline "guile command" form here. */
+ *command = build_command_line (guile_control, "");
+ }
else if (p_end - p == 10 && !strncmp (p, "loop_break", 10))
{
*command = (struct command_line *)
@@ -1115,7 +1135,8 @@ recurse_read_control_structure (char * (*read_next_line_func) (void),
next = NULL;
val = process_next_line (read_next_line_func (), &next,
- current_cmd->control_type != python_control,
+ current_cmd->control_type != python_control
+ && current_cmd->control_type != guile_control,
validator, closure);
/* Just skip blanks and comments. */