return ERROR_OK;
}
-int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc != 0)
{
}
/* daemon configuration command gdb_port */
-int handle_gdb_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
return server_port_command(cmd_ctx, cmd, args, argc, &gdb_port);
}
-int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 1)
{
}
/* gdb_breakpoint_override */
-int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 0)
{
int gdb_register_commands(command_context_t *command_context)
{
- register_command(command_context, NULL, "gdb_sync", handle_gdb_sync_command,
- COMMAND_ANY, "next stepi will return immediately allowing GDB fetch register state without affecting target state");
- register_command(command_context, NULL, "gdb_port", handle_gdb_port_command,
- COMMAND_ANY, "daemon configuration command gdb_port");
- register_command(command_context, NULL, "gdb_memory_map", handle_gdb_memory_map_command,
- COMMAND_CONFIG, "enable or disable memory map");
- register_command(command_context, NULL, "gdb_flash_program", handle_gdb_flash_program_command,
- COMMAND_CONFIG, "enable or disable flash program");
- register_command(command_context, NULL, "gdb_report_data_abort", handle_gdb_report_data_abort_command,
- COMMAND_CONFIG, "enable or disable reporting data aborts");
- register_command(command_context, NULL, "gdb_breakpoint_override", handle_gdb_breakpoint_override_command,
- COMMAND_EXEC, "hard/soft/disable - force breakpoint type for gdb 'break' commands.");
+ register_command(command_context, NULL, "gdb_sync",
+ handle_gdb_sync_command, COMMAND_ANY,
+ "next stepi will return immediately allowing GDB to "
+ "fetch register state without affecting target state");
+ register_command(command_context, NULL, "gdb_port",
+ handle_gdb_port_command, COMMAND_ANY,
+ "daemon configuration command gdb_port");
+ register_command(command_context, NULL, "gdb_memory_map",
+ handle_gdb_memory_map_command, COMMAND_CONFIG,
+ "enable or disable memory map");
+ register_command(command_context, NULL, "gdb_flash_program",
+ handle_gdb_flash_program_command, COMMAND_CONFIG,
+ "enable or disable flash program");
+ register_command(command_context, NULL, "gdb_report_data_abort",
+ handle_gdb_report_data_abort_command, COMMAND_CONFIG,
+ "enable or disable reporting data aborts");
+ register_command(command_context, NULL, "gdb_breakpoint_override",
+ handle_gdb_breakpoint_override_command, COMMAND_EXEC,
+ "hard/soft/disable - force type of breakpoint "
+ "used by gdb 'break' commands.");
return ERROR_OK;
}
/* shutdown_openocd == 1: exit the main event loop, and quit the debugger */
static int shutdown_openocd = 0;
-int handle_shutdown_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* set when using pipes rather than tcp */
int server_use_pipes = 0;
return ERROR_OK;
}
-int server_register_commands(command_context_t *context)
+/* tell the server we want to shut down */
+static int handle_shutdown_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
{
- register_command(context, NULL, "shutdown", handle_shutdown_command,
- COMMAND_ANY, "shut the server down");
+ shutdown_openocd = 1;
- return ERROR_OK;
+ return ERROR_COMMAND_CLOSE_CONNECTION;
}
-/* tell the server we want to shut down */
-int handle_shutdown_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+int server_register_commands(command_context_t *context)
{
- shutdown_openocd = 1;
+ register_command(context, NULL, "shutdown",
+ handle_shutdown_command, COMMAND_ANY,
+ "shut the server down");
- return ERROR_COMMAND_CLOSE_CONNECTION;
+ return ERROR_OK;
}
+
int server_port_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc, unsigned short *out)
{
static unsigned short tcl_port = 6666;
-/* commands */
-static int handle_tcl_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
/* handlers */
static int tcl_new_connection(connection_t *connection);
static int tcl_input(connection_t *connection);
return retval;
}
-int tcl_register_commands(command_context_t *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "tcl_port", handle_tcl_port_command, COMMAND_CONFIG, "port on which to listen for incoming TCL syntax");
- return ERROR_OK;
-}
-
static int handle_tcl_port_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc)
{
return server_port_command(cmd_ctx, cmd, args, argc, &tcl_port);
}
+
+int tcl_register_commands(command_context_t *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "tcl_port",
+ handle_tcl_port_command, COMMAND_CONFIG,
+ "port on which to listen for incoming TCL syntax");
+ return ERROR_OK;
+}
static unsigned short telnet_port = 4444;
-int handle_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_telnet_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
static char *negotiate =
"\xFF\xFB\x03" /* IAC WILL Suppress Go Ahead */
"\xFF\xFB\x01" /* IAC WILL Echo */
return ERROR_OK;
}
-int telnet_register_commands(command_context_t *command_context)
-{
- register_command(command_context, NULL, "exit", handle_exit_command,
- COMMAND_EXEC, "exit telnet session");
-
- register_command(command_context, NULL, "telnet_port", handle_telnet_port_command,
- COMMAND_ANY, "port on which to listen for incoming telnet connections");
-
- return ERROR_OK;
-}
-
/* daemon configuration command telnet_port */
-int handle_telnet_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_telnet_port_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
{
return server_port_command(cmd_ctx, cmd, args, argc, &telnet_port);
}
-int handle_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_exit_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
{
return ERROR_COMMAND_CLOSE_CONNECTION;
}
+
+int telnet_register_commands(command_context_t *command_context)
+{
+ register_command(command_context, NULL, "exit",
+ &handle_exit_command, COMMAND_EXEC,
+ "exit telnet session");
+
+ register_command(command_context, NULL, "telnet_port",
+ &handle_telnet_port_command, COMMAND_ANY,
+ "port on which to listen for incoming telnet connections");
+
+ return ERROR_OK;
+}
+
+