target: use correct target in target-prefixed commands and event handlers
[openocd.git] / src / server / tcl_server.c
index 789eee8b6f35f645a7157d39a4601e9bf7b86716..7c40f7dce9c49908e09b234183137288f6ebc2ae 100644 (file)
@@ -13,9 +13,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -107,7 +105,7 @@ static int tcl_target_callback_trace_handler(struct target *target,
        if (tclc->tc_trace) {
                hex = malloc(hex_len);
                buf = malloc(max_len);
        if (tclc->tc_trace) {
                hex = malloc(hex_len);
                buf = malloc(max_len);
-               hexify(hex, (const char *)data, len, hex_len);
+               hexify(hex, data, len, hex_len);
                snprintf(buf, max_len, "%s%s%s", header, hex, trailer);
                tcl_output(connection, buf, strlen(buf));
                free(hex);
                snprintf(buf, max_len, "%s%s%s", header, hex, trailer);
                tcl_output(connection, buf, strlen(buf));
                free(hex);
@@ -159,7 +157,7 @@ static int tcl_new_connection(struct connection *connection)
 
        connection->priv = tclc;
 
 
        connection->priv = tclc;
 
-       struct target *target = get_target_by_num(connection->cmd_ctx->current_target);
+       struct target *target = get_current_target(connection->cmd_ctx);
        if (target != NULL)
                tclc->tc_laststate = target->state;
 
        if (target != NULL)
                tclc->tc_laststate = target->state;
 

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)