Ejemplo n.º 1
0
Archivo: python.c Proyecto: ILyoan/gdb
static void
python_command (char *arg, int from_tty)
{
  struct cleanup *cleanup;

  cleanup = ensure_python_env (get_current_arch (), current_language);

  make_cleanup_restore_integer (&interpreter_async);
  interpreter_async = 0;

  while (arg && *arg && isspace (*arg))
    ++arg;
  if (arg && *arg)
    {
      if (PyRun_SimpleString (arg))
	error (_("Error while executing Python code."));
    }
  else
    {
      struct command_line *l = get_command_line (python_control, "");

      make_cleanup_free_command_lines (&l);
      execute_control_command_untraced (l);
    }

  do_cleanups (cleanup);
}
Ejemplo n.º 2
0
static void
guile_command (char *arg, int from_tty)
{
  struct cleanup *cleanup;

  cleanup = make_cleanup_restore_integer (&interpreter_async);
  interpreter_async = 0;

  arg = skip_spaces (arg);

  if (arg && *arg)
    {
      char *msg = gdbscm_safe_eval_string (arg, 1);

      if (msg != NULL)
	{
	  make_cleanup (xfree, msg);
	  error ("%s", msg);
	}
    }
  else
    {
      struct command_line *l = get_command_line (guile_control, "");

      make_cleanup_free_command_lines (&l);
      execute_control_command_untraced (l);
    }

  do_cleanups (cleanup);
}
Ejemplo n.º 3
0
static void
if_command (const char *arg, int from_tty)
{
  control_level = 1;
  command_line_up command = get_command_line (if_control, arg);

  if (command == NULL)
    return;

  scoped_restore save_async = make_scoped_restore (&current_ui->async, 0);

  execute_control_command_untraced (command.get ());
}
Ejemplo n.º 4
0
static void
guile_command (char *arg, int from_tty)
{
  arg = skip_spaces (arg);
  if (arg && *arg)
    error (_("Guile scripting is not supported in this copy of GDB."));
  else
    {
      /* Even if Guile isn't enabled, we still have to slurp the
	 command list to the corresponding "end".  */
      struct command_line *l = get_command_line (guile_control, "");
      struct cleanup *cleanups = make_cleanup_free_command_lines (&l);

      execute_control_command_untraced (l);
      do_cleanups (cleanups);
    }
}
Ejemplo n.º 5
0
void
if_command (char *arg, int from_tty)
{
  struct command_line *command = NULL;
  struct cleanup *old_chain;

  control_level = 1;
  command = get_command_line (if_control, arg);

  if (command == NULL)
    return;

  old_chain = make_cleanup_restore_integer (&interpreter_async);
  interpreter_async = 0;

  execute_control_command_untraced (command);
  free_command_lines (&command);

  do_cleanups (old_chain);
}