OpenOCD
openocd.c File Reference
Include dependency graph for openocd.c:

Go to the source code of this file.

Macros

#define OPENOCD_VERSION    "Open On-Chip Debugger " VERSION RELSTR
 

Functions

 COMMAND_HANDLER (handle_add_script_search_dir_command)
 
 COMMAND_HANDLER (handle_init_command)
 
 COMMAND_HANDLER (handle_noinit_command)
 
 COMMAND_HANDLER (handler_version_command)
 
static int log_target_callback_event_handler (struct target *target, enum target_event event, void *priv)
 
int openocd_main (int argc, char *argv[])
 Different applications can define this entry point to override the default openocd main function. More...
 
static int openocd_register_commands (struct command_context *cmd_ctx)
 
static int openocd_thread (int argc, char *argv[], struct command_context *cmd_ctx)
 OpenOCD runtime meat that can become single-thread in future. More...
 
static struct command_contextsetup_command_handler (Jim_Interp *interp)
 

Variables

struct command_contextglobal_cmd_ctx
 
static bool init_at_startup = true
 
static const struct command_registration openocd_command_handlers []
 
static const char openocd_startup_tcl []
 

Macro Definition Documentation

◆ OPENOCD_VERSION

#define OPENOCD_VERSION    "Open On-Chip Debugger " VERSION RELSTR

Definition at line 44 of file openocd.c.

Function Documentation

◆ COMMAND_HANDLER() [1/4]

COMMAND_HANDLER ( handle_add_script_search_dir_command  )

◆ COMMAND_HANDLER() [2/4]

◆ COMMAND_HANDLER() [3/4]

COMMAND_HANDLER ( handle_noinit_command  )

Definition at line 99 of file openocd.c.

References CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and init_at_startup.

◆ COMMAND_HANDLER() [4/4]

COMMAND_HANDLER ( handler_version_command  )

◆ log_target_callback_event_handler()

static int log_target_callback_event_handler ( struct target target,
enum target_event  event,
void *  priv 
)
static

◆ openocd_main()

int openocd_main ( int  argc,
char *  argv[] 
)

◆ openocd_register_commands()

static int openocd_register_commands ( struct command_context cmd_ctx)
static

Definition at line 228 of file openocd.c.

References NULL, openocd_command_handlers, and register_commands().

Referenced by setup_command_handler().

◆ openocd_thread()

static int openocd_thread ( int  argc,
char *  argv[],
struct command_context cmd_ctx 
)
static

OpenOCD runtime meat that can become single-thread in future.

It parse commandline, reads configuration, sets up the target and starts server loop. Commandline arguments are passed into this function from openocd_main().

Definition at line 282 of file openocd.c.

References command_run_line(), ERROR_COMMAND_CLOSE_CONNECTION, ERROR_FAIL, ERROR_OK, init_at_startup, last_signal, parse_cmdline_args(), parse_config_file(), server_init(), server_loop(), server_preinit(), and server_quit().

Referenced by openocd_main().

◆ setup_command_handler()

Variable Documentation

◆ global_cmd_ctx

struct command_context* global_cmd_ctx

◆ init_at_startup

bool init_at_startup = true
static

Definition at line 97 of file openocd.c.

Referenced by COMMAND_HANDLER(), and openocd_thread().

◆ openocd_command_handlers

const struct command_registration openocd_command_handlers[]
static

Definition at line 183 of file openocd.c.

Referenced by openocd_register_commands().

◆ openocd_startup_tcl

const char openocd_startup_tcl[]
static
Initial value:
= {
0
}

Definition at line 48 of file openocd.c.

Referenced by setup_command_handler().