armv7m_trace: get rid of the old tpiu code
[openocd.git] / src / target / target.c
index 3c1a6338e915a561fb1d08f7f4ee79161753dc2c..eb83daebbc8d00ad3a952943bd4c21049d33ee53 100644 (file)
@@ -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;
 
@@ -803,6 +814,13 @@ static int target_soft_reset_halt(struct target *target)
  * algorithm.
  *
  * @param target used to run the algorithm
+ * @param num_mem_params
+ * @param mem_params
+ * @param num_reg_params
+ * @param reg_param
+ * @param entry_point
+ * @param exit_point
+ * @param timeout_ms
  * @param arch_info target-specific description of the algorithm.
  */
 int target_run_algorithm(struct target *target,
@@ -838,6 +856,12 @@ done:
  * Executes a target-specific native code algorithm and leaves it running.
  *
  * @param target used to run the algorithm
+ * @param num_mem_params
+ * @param mem_params
+ * @param num_reg_params
+ * @param reg_params
+ * @param entry_point
+ * @param exit_point
  * @param arch_info target-specific description of the algorithm.
  */
 int target_start_algorithm(struct target *target,
@@ -876,6 +900,12 @@ done:
  * Waits for an algorithm started with target_start_algorithm() to complete.
  *
  * @param target used to run the algorithm
+ * @param num_mem_params
+ * @param mem_params
+ * @param num_reg_params
+ * @param reg_params
+ * @param exit_point
+ * @param timeout_ms
  * @param arch_info target-specific description of the algorithm.
  */
 int target_wait_algorithm(struct target *target,
@@ -947,6 +977,7 @@ done:
  * @param entry_point address on the target to execute to start the algorithm
  * @param exit_point address at which to set a breakpoint to catch the
  *     end of the algorithm; can be 0 if target triggers a breakpoint itself
+ * @param arch_info
  */
 
 int target_run_flash_async_algorithm(struct target *target,
@@ -4036,7 +4067,7 @@ COMMAND_HANDLER(handle_wp_command)
        }
 
        enum watchpoint_rw type = WPT_ACCESS;
-       uint32_t addr = 0;
+       target_addr_t addr = 0;
        uint32_t length = 0;
        uint32_t data_value = 0x0;
        uint32_t data_mask = 0xffffffff;
@@ -4066,7 +4097,7 @@ COMMAND_HANDLER(handle_wp_command)
                /* fall through */
        case 2:
                COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length);
-               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
+               COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr);
                break;
 
        default:
@@ -4086,8 +4117,8 @@ COMMAND_HANDLER(handle_rwp_command)
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       uint32_t addr;
-       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
+       target_addr_t addr;
+       COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr);
 
        struct target *target = get_current_target(CMD_CTX);
        watchpoint_remove(target, addr);
@@ -4914,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 */
@@ -5123,6 +5159,7 @@ no_params:
                                e = Jim_GetOpt_String(goi, &s, NULL);
                                if (e != JIM_OK)
                                        return e;
+                               free(target->gdb_port_override);
                                target->gdb_port_override = strdup(s);
                        } else {
                                if (goi->argc != 0)
@@ -5689,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;
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)