diff options
author | Tom Tromey <tromey@redhat.com> | 2014-01-18 19:41:08 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-12 09:59:19 -0700 |
commit | ff0e980e6f720fe49608a5a0a37be3a28258c9d7 (patch) | |
tree | c50140e487463bea1072b5dfceba6973d2194f92 /gdb/gdbserver | |
parent | e9371aff2d8c31adf23483aebe85018e11f534f3 (diff) | |
download | gdb-ff0e980e6f720fe49608a5a0a37be3a28258c9d7.zip gdb-ff0e980e6f720fe49608a5a0a37be3a28258c9d7.tar.gz gdb-ff0e980e6f720fe49608a5a0a37be3a28258c9d7.tar.bz2 |
replace unhexify with hex2bin
unhexify and hex2bin are identical, so this removes unhexify. The
particular choice of which to keep was made on the basis of
parallelism with the earlier patch that removed hexify.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.h (unhexify): Don't declare.
* common/rsp-low.c (unhexify): Remove.
2014-02-12 Tom Tromey <tromey@redhat.com>
* server.c (handle_query, handle_v_run): Use hex2bin, not
unhexify.
* tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/server.c | 5 | ||||
-rw-r--r-- | gdb/gdbserver/tracepoint.c | 10 |
3 files changed, 14 insertions, 7 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index cacc74b..f0d092d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,11 @@ 2014-02-12 Tom Tromey <tromey@redhat.com> + * server.c (handle_query, handle_v_run): Use hex2bin, not + unhexify. + * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise. + +2014-02-12 Tom Tromey <tromey@redhat.com> + * ax.c (gdb_unparse_agent_expr): Use bin2hex, not convert_int_to_ascii. * regcache.c (registers_to_string, collect_register_as_string): diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index e582598..1ea1bde 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -2025,7 +2025,8 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p) return; } - if ((len % 2) != 0 || unhexify (mon, own_buf + 6, len / 2) != len / 2) + if ((len % 2) != 0 + || hex2bin (own_buf + 6, (gdb_byte *) mon, len / 2) != len / 2) { write_enn (own_buf); free (mon); @@ -2408,7 +2409,7 @@ handle_v_run (char *own_buf) { /* FIXME: Fail request if out of memory instead of dying. */ new_argv[i] = xmalloc (1 + (next_p - p) / 2); - unhexify (new_argv[i], p, (next_p - p) / 2); + hex2bin (p, (gdb_byte *) new_argv[i], (next_p - p) / 2); new_argv[i][(next_p - p) / 2] = '\0'; } diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index df32005..8e294f6 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -2708,7 +2708,7 @@ cmd_qtdpsrc (char *own_buf) packet = unpack_varlen_hex (packet, &slen); ++packet; /* skip a colon */ src = xmalloc (slen + 1); - nbytes = unhexify (src, packet, strlen (packet) / 2); + nbytes = hex2bin (packet, (gdb_byte *) src, strlen (packet) / 2); src[nbytes] = '\0'; newlast = xmalloc (sizeof (struct source_string)); @@ -2750,7 +2750,7 @@ cmd_qtdv (char *own_buf) nbytes = strlen (packet) / 2; varname = xmalloc (nbytes + 1); - nbytes = unhexify (varname, packet, nbytes); + nbytes = hex2bin (packet, (gdb_byte *) varname, nbytes); varname[nbytes] = '\0'; tsv = create_trace_state_variable (num, 1); @@ -4108,7 +4108,7 @@ cmd_qtnotes (char *own_buf) packet = strchr (packet, ';'); nbytes = (packet - saved) / 2; user = xmalloc (nbytes + 1); - nbytes = unhexify (user, saved, nbytes); + nbytes = hex2bin (saved, (gdb_byte *) user, nbytes); user[nbytes] = '\0'; ++packet; /* skip the semicolon */ trace_debug ("User is '%s'", user); @@ -4122,7 +4122,7 @@ cmd_qtnotes (char *own_buf) packet = strchr (packet, ';'); nbytes = (packet - saved) / 2; notes = xmalloc (nbytes + 1); - nbytes = unhexify (notes, saved, nbytes); + nbytes = hex2bin (saved, (gdb_byte *) notes, nbytes); notes[nbytes] = '\0'; ++packet; /* skip the semicolon */ trace_debug ("Notes is '%s'", notes); @@ -4136,7 +4136,7 @@ cmd_qtnotes (char *own_buf) packet = strchr (packet, ';'); nbytes = (packet - saved) / 2; stopnote = xmalloc (nbytes + 1); - nbytes = unhexify (stopnote, saved, nbytes); + nbytes = hex2bin (saved, (gdb_byte *) stopnote, nbytes); stopnote[nbytes] = '\0'; ++packet; /* skip the semicolon */ trace_debug ("tstop note is '%s'", stopnote); |