Merge multiple hex conversions
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Jun 2015 15:08:49 +0000 (17:08 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 15 Jun 2015 15:08:49 +0000 (17:08 +0200)
gdb/ChangeLog
2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
    Jan Kratochvil  <jan.kratochvil@redhat.com>

Merge multiple hex conversions.
* monitor.c: Include rsp-low.h.
(fromhex): Remove definition.

gdb/gdbserver/ChangeLog
2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
    Jan Kratochvil  <jan.kratochvil@redhat.com>

Merge multiple hex conversions.
* gdbreplay.c (tohex): Rename to 'fromhex'.
(logchar): Use fromhex.

gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/gdbreplay.c
gdb/monitor.c

index f7e116728082a65f1c7bd1d013143203d70d42f0..eeded49e65c57d0585e8394f7d09c07b1b4efa34 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
+           Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Merge multiple hex conversions.
+       * monitor.c: Include rsp-low.h.
+       (fromhex): Remove definition.
+
 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
            Jan Kratochvil  <jan.kratochvil@redhat.com>
 
index 5d5f0a435afd1ce48fcc181a6600e82a0684afbe..c1d589ac3b2c5fd480868650e85e4d18b15b29cf 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
+           Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Merge multiple hex conversions.
+       * gdbreplay.c (tohex): Rename to 'fromhex'.
+       (logchar): Use fromhex.
+
 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * server.c (handle_qxfer_libraries): Set `version' attribute for
index a02a824072b0998cfdde5cdfb1858b07b04631bb..79aa8aa8a859dbe1c8ef9bdd2960fc8c8ffc17ae 100644 (file)
@@ -259,7 +259,7 @@ remote_open (char *name)
 }
 
 static int
-tohex (int ch)
+fromhex (int ch)
 {
   if (ch >= '0' && ch <= '9')
     {
@@ -322,11 +322,11 @@ logchar (FILE *fp)
          ch2 = fgetc (fp);
          fputc (ch2, stdout);
          fflush (stdout);
-         ch = tohex (ch2) << 4;
+         ch = fromhex (ch2) << 4;
          ch2 = fgetc (fp);
          fputc (ch2, stdout);
          fflush (stdout);
-         ch |= tohex (ch2);
+         ch |= fromhex (ch2);
          break;
        default:
          /* Treat any other char as just itself */
index 548dae3d5b3408a929e0932065a3b036cb70210e..c7f5fc70ce9fe6d30bce64f148bc2fe9cb1e95cf 100644 (file)
@@ -54,6 +54,7 @@
 #include "regcache.h"
 #include "gdbthread.h"
 #include "readline/readline.h"
+#include "rsp-low.h"
 
 static char *dev_name;
 static struct target_ops *targ_ops;
@@ -225,21 +226,6 @@ monitor_error (char *function, char *message,
           message, safe_string);
 }
 
-/* Convert hex digit A to a number.  */
-
-static int
-fromhex (int a)
-{
-  if (a >= '0' && a <= '9')
-    return a - '0';
-  else if (a >= 'a' && a <= 'f')
-    return a - 'a' + 10;
-  else if (a >= 'A' && a <= 'F')
-    return a - 'A' + 10;
-  else
-    error (_("Invalid hex digit %d"), a);
-}
-
 /* monitor_vsprintf - similar to vsprintf but handles 64-bit addresses
 
    This function exists to get around the problem that many host platforms
This page took 0.035363 seconds and 4 git commands to generate.