aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/linux.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2013-01-31 17:01:19 +0000
committerØyvind Harboe <oyvindharboe@gmail.com>2013-02-26 20:49:49 +0000
commit3d62c3df6ddb09f1485c25d665e248856989d180 (patch)
treef4bd01d270d85f49f1f9876abedea4195fd5ec68 /src/rtos/linux.c
parent80f78acf7350ca9f812b520ec80f9bc6159d7f0c (diff)
downloadriscv-openocd-3d62c3df6ddb09f1485c25d665e248856989d180.zip
riscv-openocd-3d62c3df6ddb09f1485c25d665e248856989d180.tar.gz
riscv-openocd-3d62c3df6ddb09f1485c25d665e248856989d180.tar.bz2
gdbserver: use common hexify/unhexify routines
Change-Id: I9989b625666e9c60ec9867cf6f4d94f41c998c3f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1105 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src/rtos/linux.c')
-rw-r--r--src/rtos/linux.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 9c95597..68b2d1d 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1217,7 +1217,7 @@ int linux_thread_extra_info(struct target *target,
char *tmp_str = (char *)calloc(1, str_size + 50);
char *tmp_str_ptr = tmp_str;
- /* discriminate cuurent task */
+ /* discriminate current task */
if (temp->status == 3)
tmp_str_ptr += sprintf(tmp_str_ptr, "%s",
pid_current);
@@ -1229,10 +1229,9 @@ int linux_thread_extra_info(struct target *target,
tmp_str_ptr += sprintf(tmp_str_ptr, "%s", " | ");
sprintf(tmp_str_ptr, "%s", name);
sprintf(tmp_str_ptr, "%s", temp->name);
- char *hex_str =
- (char *)calloc(1, strlen(tmp_str) * 2 + 1);
- str_to_hex(hex_str, tmp_str);
- gdb_put_packet(connection, hex_str, strlen(hex_str));
+ char *hex_str = (char *)calloc(1, strlen(tmp_str) * 2 + 1);
+ int pkt_len = hexify(hex_str, tmp_str, 0, strlen(tmp_str) * 2 + 1);
+ gdb_put_packet(connection, hex_str, pkt_len);
free(hex_str);
free(tmp_str);
return ERROR_OK;