From: Øyvind H. <go...@us...> - 2010-06-16 09:02:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 814c2a8f9a41a6445f131ee35474dced4bbed210 (commit) via 818120d4092be0d0a7cae50140dc339581cae7fc (commit) via 5104d56e5c37defaf2f6c5c8607bac45b8b49b32 (commit) via cd9c61cc068635fa707981decfea600ee7e94201 (commit) via 9bbbbdc0bd244b09f846b1acdf28327da2a166d8 (commit) from f4958d61ef4188ed02629968d21c3a4de3a89121 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 814c2a8f9a41a6445f131ee35474dced4bbed210 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 16 08:33:32 2010 +0200 build: enable -Wshadow by default Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/configure.in b/configure.in index d93b21a..7f31e1d 100644 --- a/configure.in +++ b/configure.in @@ -1090,7 +1090,7 @@ fi AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).]) # set default gcc warnings -GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security" +GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security -Wshadow" if test "${gcc_wextra}" = yes; then GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter" GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast" commit 818120d4092be0d0a7cae50140dc339581cae7fc Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 16 08:27:50 2010 +0200 gdb: -Wshadow warning fixes Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 8ed9e74..a1ff7c8 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2245,7 +2245,6 @@ static int gdb_input_inner(struct connection *connection) case 'c': case 's': { - struct gdb_connection *gdb_con = connection->priv; log_add_callback(gdb_log_callback, connection); if (gdb_con->mem_write_error) commit 5104d56e5c37defaf2f6c5c8607bac45b8b49b32 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 16 08:24:51 2010 +0200 gdb: clean up error handling in step/continue if step/continue fails, then the error should be reported to the calling fn. The calling fn decides if the connection has to be aborted or if packet processing can continue. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 029bdf8..8ed9e74 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2151,7 +2151,17 @@ static int gdb_input_inner(struct connection *connection) struct gdb_connection *gdb_con = connection->priv; static int extended_protocol = 0; - /* drain input buffer */ + /* drain input buffer. If one of the packets fail, then an error + * packet is replied, if applicable. + * + * This loop will terminate and the error code is returned. + * + * The calling fn will check if this error is something that + * can be recovered from, or if the connection must be closed. + * + * If the error is recoverable, this fn is called again to + * drain the rest of the buffer. + */ do { packet_size = GDB_BUFFER_SIZE-1; @@ -2235,8 +2245,6 @@ static int gdb_input_inner(struct connection *connection) case 'c': case 's': { - int retval = ERROR_OK; - struct gdb_connection *gdb_con = connection->priv; log_add_callback(gdb_log_callback, connection); @@ -2271,7 +2279,7 @@ static int gdb_input_inner(struct connection *connection) } gdb_con->sync = false; - if ((retval!=ERROR_OK) || (!already_running && nostep)) + if (!already_running && nostep) { /* Either the target isn't in the halted state, then we can't * step/continue. This might be early setup, etc. @@ -2294,7 +2302,9 @@ static int gdb_input_inner(struct connection *connection) if (!already_running) { - int retval = gdb_step_continue_packet(connection, target, packet, packet_size); + /* Here we don't want packet processing to stop even if this fails, + * so we use a local variable instead of retval. */ + retval = gdb_step_continue_packet(connection, target, packet, packet_size); if (retval != ERROR_OK) { /* we'll never receive a halted condition... issue a false one.. */ commit cd9c61cc068635fa707981decfea600ee7e94201 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 16 08:19:25 2010 +0200 xsvf: -Wshadow warning fixes I think this fixed an error message where the error message would show the *previous* uc code rather than the current unsupported uc code. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index dff1a1e..51d0e7b 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -269,7 +269,6 @@ COMMAND_HANDLER(handle_xsvf_command) */ if (collecting_path) { tap_state_t mystate; - uint8_t uc; switch (opcode) { case XCOMMENT: @@ -565,7 +564,6 @@ COMMAND_HANDLER(handle_xsvf_command) case XSTATE: { tap_state_t mystate; - uint8_t uc; if (read(xsvf_fd, &uc, 1) < 0) { commit 9bbbbdc0bd244b09f846b1acdf28327da2a166d8 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jun 16 08:17:27 2010 +0200 svf: -Wshadow warning fixes Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/svf/svf.c b/src/svf/svf.c index 6e951e2..62e2324 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -272,7 +272,7 @@ static unsigned svf_get_mask_u32(int bitlen) int svf_add_statemove(tap_state_t state_to) { tap_state_t state_from = cmd_queue_cur_state; - uint8_t index; + unsigned index_var; /* when resetting, be paranoid and ignore current state */ if (state_to == TAP_RESET) { @@ -280,18 +280,18 @@ int svf_add_statemove(tap_state_t state_to) return ERROR_OK; } - for (index = 0; index < ARRAY_SIZE(svf_statemoves); index++) + for (index_var = 0; index_var < ARRAY_SIZE(svf_statemoves); index_var++) { - if ((svf_statemoves[index].from == state_from) - && (svf_statemoves[index].to == state_to)) + if ((svf_statemoves[index_var].from == state_from) + && (svf_statemoves[index_var].to == state_to)) { /* recorded path includes current state ... avoid extra TCKs! */ - if (svf_statemoves[index].num_of_moves > 1) - jtag_add_pathmove(svf_statemoves[index].num_of_moves - 1, - svf_statemoves[index].paths + 1); + if (svf_statemoves[index_var].num_of_moves > 1) + jtag_add_pathmove(svf_statemoves[index_var].num_of_moves - 1, + svf_statemoves[index_var].paths + 1); else - jtag_add_pathmove(svf_statemoves[index].num_of_moves, - svf_statemoves[index].paths); + jtag_add_pathmove(svf_statemoves[index_var].num_of_moves, + svf_statemoves[index_var].paths); return ERROR_OK; } } @@ -723,22 +723,22 @@ static int svf_copy_hexstring_to_binary(char *str, uint8_t **bin, int orig_bit_l static int svf_check_tdo(void) { - int i, len, index; + int i, len, index_var; for (i = 0; i < svf_check_tdo_para_index; i++) { - index = svf_check_tdo_para[i].buffer_offset; + index_var = svf_check_tdo_para[i].buffer_offset; len = svf_check_tdo_para[i].bit_len; if ((svf_check_tdo_para[i].enabled) - && buf_cmp_mask(&svf_tdi_buffer[index], &svf_tdo_buffer[index], &svf_mask_buffer[index], len)) + && buf_cmp_mask(&svf_tdi_buffer[index_var], &svf_tdo_buffer[index_var], &svf_mask_buffer[index_var], len)) { unsigned bitmask; unsigned received, expected, tapmask; bitmask = svf_get_mask_u32(svf_check_tdo_para[i].bit_len); - memcpy(&received, svf_tdi_buffer + index, sizeof(unsigned)); - memcpy(&expected, svf_tdo_buffer + index, sizeof(unsigned)); - memcpy(&tapmask, svf_mask_buffer + index, sizeof(unsigned)); + memcpy(&received, svf_tdi_buffer + index_var, sizeof(unsigned)); + memcpy(&expected, svf_tdo_buffer + index_var, sizeof(unsigned)); + memcpy(&tapmask, svf_mask_buffer + index_var, sizeof(unsigned)); LOG_ERROR("tdo check error at line %d", svf_check_tdo_para[i].line_num); LOG_ERROR("read = 0x%X, want = 0x%X, mask = 0x%X", ----------------------------------------------------------------------- Summary of changes: configure.in | 2 +- src/server/gdb_server.c | 21 +++++++++++++++------ src/svf/svf.c | 30 +++++++++++++++--------------- src/xsvf/xsvf.c | 2 -- 4 files changed, 31 insertions(+), 24 deletions(-) hooks/post-receive -- Main OpenOCD repository |