replace hexify with bin2hex
authorTom Tromey <tromey@redhat.com>
Sun, 19 Jan 2014 02:30:20 +0000 (19:30 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 12 Feb 2014 16:59:17 +0000 (09:59 -0700)
This removes hexify in favor of bin2hex.
The choice of which to keep was arbitrary.

2014-02-12  Tom Tromey  <tromey@redhat.com>

* common/rsp-low.h (hexify): Don't declare.
* common/rsp-low.c (hexify): Remove.

2014-02-12  Tom Tromey  <tromey@redhat.com>

* remote-utils.c (look_up_one_symbol, monitor_output): Use
bin2hex, not hexify.
* tracepoint.c (cmd_qtstatus): Likewise.

gdb/ChangeLog
gdb/common/rsp-low.c
gdb/common/rsp-low.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/remote-utils.c
gdb/gdbserver/tracepoint.c

index e8521c9ac171e01b14a4603064f23ba0dac676fe..a0d6bc17c532ca4b163b28bbf136e3b0e04938d6 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-12  Tom Tromey  <tromey@redhat.com>
+
+       * common/rsp-low.h (hexify): Don't declare.
+       * common/rsp-low.c (hexify): Remove.
+
 2014-02-12  Tom Tromey  <tromey@redhat.com>
 
        * common/rsp-low.c (hexify): Never take strlen of argument.
index fd6f56345c6a3cb414bfcb7ee04a3c71dfb25874..a7b001446c8c31cb7e3866f1717ca99f5777d07a 100644 (file)
@@ -172,20 +172,6 @@ bin2hex (const gdb_byte *bin, char *hex, int count)
   return i;
 }
 
-int
-hexify (char *hex, const char *bin, int count)
-{
-  int i;
-
-  for (i = 0; i < count; i++)
-    {
-      *hex++ = tohex ((*bin >> 4) & 0xf);
-      *hex++ = tohex (*bin++ & 0xf);
-    }
-  *hex = 0;
-  return i;
-}
-
 void
 convert_int_to_ascii (const unsigned char *from, char *to, int n)
 {
index 161c4a2f1e13341ef664dac523365c02293bbadf..2ef5e6d8fb3808f4164ee954be1eb04b125fa355 100644 (file)
@@ -42,8 +42,6 @@ extern void convert_ascii_to_int (const char *from, unsigned char *to, int n);
 
 extern int bin2hex (const gdb_byte *bin, char *hex, int count);
 
-extern int hexify (char *hex, const char *bin, int count);
-
 extern void convert_int_to_ascii (const unsigned char *from, char *to, int n);
 
 /* Convert BUFFER, binary data at least LEN bytes long, into escaped
index 35303dfc05b49c823b1cddf5556e3413cac489aa..dc2c078d4aff2f4a32ebd0c00046c0d836d322b6 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-12  Tom Tromey  <tromey@redhat.com>
+
+       * remote-utils.c (look_up_one_symbol, monitor_output): Use
+       bin2hex, not hexify.
+       * tracepoint.c (cmd_qtstatus): Likewise.
+
 2014-02-12  Tom Tromey  <tromey@redhat.com>
 
        * remote-utils.c (monitor_output): Pass explicit length to
index 8fd7c4a01ecabb6a137b0495ffdff7f6df2c8410..a81a739008a1f4f72c515f6658e0159075a013d4 100644 (file)
@@ -1399,7 +1399,8 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb)
 
   /* Send the request.  */
   strcpy (own_buf, "qSymbol:");
-  hexify (own_buf + strlen ("qSymbol:"), name, strlen (name));
+  bin2hex ((const gdb_byte *) name, own_buf + strlen ("qSymbol:"),
+         strlen (name));
   if (putpkt (own_buf) < 0)
     return -1;
 
@@ -1562,7 +1563,7 @@ monitor_output (const char *msg)
   char *buf = xmalloc (len * 2 + 2);
 
   buf[0] = 'O';
-  hexify (buf + 1, msg, len);
+  bin2hex ((const gdb_byte *) msg, buf + 1, len);
 
   putpkt (buf);
   free (buf);
index c61f1d5c376583955acb397cc755cabdc3bb6dac..3ae3bdd29297fd505ccf3248df7bfb84f3bf8080 100644 (file)
@@ -3623,17 +3623,17 @@ cmd_qtstatus (char *packet)
   str = (tracing_user_name ? tracing_user_name : "");
   slen = strlen (str);
   buf1 = (char *) alloca (slen * 2 + 1);
-  hexify (buf1, str, slen);
+  bin2hex ((gdb_byte *) str, buf1, slen);
 
   str = (tracing_notes ? tracing_notes : "");
   slen = strlen (str);
   buf2 = (char *) alloca (slen * 2 + 1);
-  hexify (buf2, str, slen);
+  bin2hex ((gdb_byte *) str, buf2, slen);
 
   str = (tracing_stop_note ? tracing_stop_note : "");
   slen = strlen (str);
   buf3 = (char *) alloca (slen * 2 + 1);
-  hexify (buf3, str, slen);
+  bin2hex ((gdb_byte *) str, buf3, slen);
 
   trace_debug ("Returning trace status as %d, stop reason %s",
               tracing, tracing_stop_reason);
This page took 0.051042 seconds and 4 git commands to generate.