GDB (xrefs)
Classes | Macros | Functions | Variables
cli-script.c File Reference
#include "defs.h"
#include "value.h"
#include "language.h"
#include <ctype.h>
#include "ui-out.h"
#include "top.h"
#include "breakpoint.h"
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
#include "cli/cli-script.h"
#include "extension.h"
#include "interps.h"
#include "compile/compile.h"

Go to the source code of this file.

Classes

struct  user_args
 
struct  source_cleanup_lines_args
 

Macros

#define MAXUSERARGS   10
 
#define END_MESSAGE   "End with a line saying just \"end\"."
 
#define MAX_TMPBUF   128
 
#define HOOK_STRING   "hook-"
 
#define HOOK_LEN   5
 
#define HOOK_POST_STRING   "hookpost-"
 
#define HOOK_POST_LEN   9
 

Functions

static enum command_control_type recurse_read_control_structure (char *(*read_next_line_func)(void), struct command_line *current_cmd, void(*validator)(char *, void *), void *closure)
 
static char * insert_args (char *line)
 
static struct cleanupsetup_user_args (char *p)
 
static char * read_next_line (void)
 
static int multi_line_command_p (enum command_control_type type)
 
static struct command_linebuild_command_line (enum command_control_type type, char *args)
 
struct command_lineget_command_line (enum command_control_type type, char *arg)
 
void print_command_lines (struct ui_out *uiout, struct command_line *cmd, unsigned int depth)
 
static void clear_hook_in_cleanup (void *data)
 
void execute_cmd_pre_hook (struct cmd_list_element *c)
 
void execute_cmd_post_hook (struct cmd_list_element *c)
 
static void do_restore_user_call_depth (void *call_depth)
 
void execute_user_command (struct cmd_list_element *c, char *args)
 
void reset_command_nest_depth (void)
 
void print_command_trace (const char *cmd)
 
enum command_control_type execute_control_command (struct command_line *cmd)
 
enum command_control_type execute_control_command_untraced (struct command_line *cmd)
 
static void while_command (char *arg, int from_tty)
 
static void if_command (char *arg, int from_tty)
 
static void arg_cleanup (void *ignore)
 
static char * locate_arg (char *p)
 
static void realloc_body_list (struct command_line *command, int new_length)
 
static enum misc_command_type process_next_line (char *p, struct command_line **command, int parse_commands, void(*validator)(char *, void *), void *closure)
 
static void restore_interp (void *arg)
 
struct command_lineread_command_lines (char *prompt_arg, int from_tty, int parse_commands, void(*validator)(char *, void *), void *closure)
 
struct command_lineread_command_lines_1 (char *(*read_next_line_func)(void), int parse_commands, void(*validator)(char *, void *), void *closure)
 
void free_command_lines (struct command_line **lptr)
 
static void do_free_command_lines_cleanup (void *arg)
 
struct cleanupmake_cleanup_free_command_lines (struct command_line **arg)
 
struct command_linecopy_command_lines (struct command_line *cmds)
 
static struct cmd_list_element ** validate_comname (char **comname)
 
static void user_defined_command (char *ignore, int from_tty)
 
static void define_command (char *comname, int from_tty)
 
static void document_command (char *comname, int from_tty)
 
static void source_cleanup_lines (void *args)
 
void script_from_file (FILE *stream, const char *file)
 
void show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name, struct ui_file *stream)
 
void _initialize_cli_script (void)
 

Variables

static int control_level
 
static int command_nest_depth = 1
 
static int suppress_next_print_command_trace = 0
 
struct user_argsuser_args
 
initialize_file_ftype _initialize_cli_script
 

Macro Definition Documentation

#define END_MESSAGE   "End with a line saying just \"end\"."

Definition at line 1256 of file cli-script.c.

Referenced by read_command_lines().

#define HOOK_LEN   5

Referenced by define_command().

#define HOOK_POST_LEN   9

Referenced by define_command().

#define HOOK_POST_STRING   "hookpost-"

Referenced by define_command().

#define HOOK_STRING   "hook-"

Referenced by define_command().

#define MAX_TMPBUF   128

Referenced by define_command().

#define MAXUSERARGS   10

Definition at line 60 of file cli-script.c.

Referenced by setup_user_args().

Function Documentation

void _initialize_cli_script ( void  )
static void arg_cleanup ( void *  ignore)
static

Definition at line 702 of file cli-script.c.

References _, user_args::command, internal_error(), user_args::next, user_args, and xfree().

Referenced by setup_user_args().

static struct command_line* build_command_line ( enum command_control_type  type,
char *  args 
)
static
static void clear_hook_in_cleanup ( void *  data)
static

Definition at line 311 of file cli-script.c.

References cmd_list_element::hook_in.

Referenced by execute_cmd_post_hook(), and execute_cmd_pre_hook().

struct command_line* copy_command_lines ( struct command_line cmds)
static void define_command ( char *  comname,
int  from_tty 
)
static
static void do_free_command_lines_cleanup ( void *  arg)
static

Definition at line 1399 of file cli-script.c.

References free_command_lines().

Referenced by make_cleanup_free_command_lines().

static void do_restore_user_call_depth ( void *  call_depth)
static

Definition at line 345 of file cli-script.c.

References in_user_command.

Referenced by execute_user_command().

static void document_command ( char *  comname,
int  from_tty 
)
static
void execute_cmd_post_hook ( struct cmd_list_element c)
void execute_cmd_pre_hook ( struct cmd_list_element c)
enum command_control_type execute_control_command ( struct command_line cmd)
enum command_control_type execute_control_command_untraced ( struct command_line cmd)
void execute_user_command ( struct cmd_list_element c,
char *  args 
)
void free_command_lines ( struct command_line **  lptr)
struct command_line* get_command_line ( enum command_control_type  type,
char *  arg 
)
static void if_command ( char *  arg,
int  from_tty 
)
static
static char * insert_args ( char *  line)
static
static char* locate_arg ( char *  p)
static

Definition at line 800 of file cli-script.c.

References startswith().

Referenced by insert_args().

struct cleanup* make_cleanup_free_command_lines ( struct command_line **  arg)
static int multi_line_command_p ( enum command_control_type  type)
static
void print_command_lines ( struct ui_out uiout,
struct command_line cmd,
unsigned int  depth 
)
void print_command_trace ( const char *  cmd)
static enum misc_command_type process_next_line ( char *  p,
struct command_line **  command,
int  parse_commands,
void(*)(char *, void *)  validator,
void *  closure 
)
static
struct command_line* read_command_lines ( char *  prompt_arg,
int  from_tty,
int  parse_commands,
void(*)(char *, void *)  validator,
void *  closure 
)
struct command_line* read_command_lines_1 ( char *(*)(void)  read_next_line_func,
int  parse_commands,
void(*)(char *, void *)  validator,
void *  closure 
)
static char * read_next_line ( void  )
static
static void realloc_body_list ( struct command_line command,
int  new_length 
)
static
static enum command_control_type recurse_read_control_structure ( char *(*)(void)  read_next_line_func,
struct command_line current_cmd,
void(*)(char *, void *)  validator,
void *  closure 
)
static
void reset_command_nest_depth ( void  )

Definition at line 407 of file cli-script.c.

Referenced by display_gdb_prompt().

static void restore_interp ( void *  arg)
static

Definition at line 1242 of file cli-script.c.

References interp_name(), and interp_set_temp().

Referenced by read_command_lines().

void script_from_file ( FILE *  stream,
const char *  file 
)
static struct cleanup * setup_user_args ( char *  p)
static
void show_user_1 ( struct cmd_list_element c,
const char *  prefix,
const char *  name,
struct ui_file stream 
)
static void source_cleanup_lines ( void *  args)
static
static void user_defined_command ( char *  ignore,
int  from_tty 
)
static

Definition at line 1496 of file cli-script.c.

Referenced by define_command().

static struct cmd_list_element** validate_comname ( char **  comname)
static

Definition at line 1447 of file cli-script.c.

References _, cmdlist, error(), error_no_arg(), lookup_cmd(), and cmd_list_element::prefixlist.

Referenced by define_command(), and document_command().

static void while_command ( char *  arg,
int  from_tty 
)
static

Variable Documentation

initialize_file_ftype _initialize_cli_script

Definition at line 1754 of file cli-script.c.

Referenced by initialize_all_files().

int command_nest_depth = 1
static

Definition at line 54 of file cli-script.c.

Referenced by print_command_trace().

int control_level
static

Definition at line 51 of file cli-script.c.

Referenced by read_next_line().

int suppress_next_print_command_trace = 0
static

Definition at line 57 of file cli-script.c.

struct user_args * user_args

Referenced by arg_cleanup(), and setup_user_args().