Add Guile as an extension language.
[deliverable/binutils-gdb.git] / gdb / cli / cli-script.c
index 47cad75da5c1a3ac589b546605a3f2ba732a8393..246fcc9fbb24d841462151859da190311c2618f1 100644 (file)
@@ -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.  */
This page took 0.024597 seconds and 4 git commands to generate.