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>
This commit is contained in:
committed by
Øyvind Harboe
parent
80f78acf73
commit
3d62c3df6d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user