X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=eb83daebbc8d00ad3a952943bd4c21049d33ee53;hb=dc7b32ea4a00a425a71b3309f3fceb07b8467592;hp=033fc07142b7d77c368d7b1283003c606506b70e;hpb=54ef790149918df40e6bc2220ffd52ade1b9669b;p=openocd.git diff --git a/src/target/target.c b/src/target/target.c index 033fc07142..eb83daebbc 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -637,7 +637,18 @@ int target_resume(struct target *target, int current, target_addr_t address, * we poll. The CPU can even halt at the current PC as a result of * a software breakpoint being inserted by (a bug?) the application. */ + /* + * resume() triggers the event 'resumed'. The execution of TCL commands + * in the event handler causes the polling of targets. If the target has + * already halted for a breakpoint, polling will run the 'halted' event + * handler before the pending 'resumed' handler. + * Disable polling during resume() to guarantee the execution of handlers + * in the correct order. + */ + bool save_poll = jtag_poll_get_enabled(); + jtag_poll_set_enabled(false); retval = target->type->resume(target, current, address, handle_breakpoints, debug_execution); + jtag_poll_set_enabled(save_poll); if (retval != ERROR_OK) return retval; @@ -4934,6 +4945,11 @@ no_params: } if (goi->isconfigure) { + /* START_DEPRECATED_TPIU */ + if (n->value == TARGET_EVENT_TRACE_CONFIG) + LOG_INFO("DEPRECATED target event %s", n->name); + /* END_DEPRECATED_TPIU */ + bool replace = true; if (teap == NULL) { /* create new */ @@ -5710,9 +5726,6 @@ static int target_create(Jim_GetOptInfo *goi) memcpy(target->type, target_types[x], sizeof(struct target_type)); - /* will be set by "-endian" */ - target->endianness = TARGET_ENDIAN_UNKNOWN; - /* default to first core, override with -coreid */ target->coreid = 0;