From: Spencer Oliver Date: Mon, 17 May 2010 09:17:21 +0000 (+0100) Subject: gdbserver: gdb cmds returning failure on success X-Git-Tag: v0.5.0-rc1~683 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3ecc191b361d913d3bdf156568454de57f093aee;p=openocd gdbserver: gdb cmds returning failure on success The gdb_memory_map cmd for example fell through and returned ERROR_COMMAND_SYNTAX_ERROR on success - behaviour is now as expected. Signed-off-by: Spencer Oliver --- diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 5b4fb7a6..a84c618a 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2503,26 +2503,29 @@ COMMAND_HANDLER(handle_gdb_port_command) COMMAND_HANDLER(handle_gdb_memory_map_command) { - if (CMD_ARGC == 1) - COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_use_memory_map); + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; - return ERROR_COMMAND_SYNTAX_ERROR; + COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_use_memory_map); + return ERROR_OK; } COMMAND_HANDLER(handle_gdb_flash_program_command) { - if (CMD_ARGC == 1) - COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_flash_program); + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; - return ERROR_COMMAND_SYNTAX_ERROR; + COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_flash_program); + return ERROR_OK; } COMMAND_HANDLER(handle_gdb_report_data_abort_command) { - if (CMD_ARGC == 1) - COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_report_data_abort); + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; - return ERROR_COMMAND_SYNTAX_ERROR; + COMMAND_PARSE_ENABLE(CMD_ARGV[0], gdb_report_data_abort); + return ERROR_OK; } /* gdb_breakpoint_override */