]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove fromhex implementation from gdbreplay
authorTom Tromey <tom@tromey.com>
Sat, 1 Jun 2019 15:16:04 +0000 (09:16 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 2 Jun 2019 18:23:02 +0000 (12:23 -0600)
gdbreplay had its own implementation of fromhex.  This patch changes
it to use the one in common/.

gdb/gdbserver/ChangeLog
2019-06-02  Tom Tromey  <tom@tromey.com>

* gdbreplay.c (fromhex): Remove.
* Makefile.in (GDBREPLAY_OBS): Add rsp-low.o.

gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/gdbreplay.c

index e15395d695431e5bb540453184ba66e726827dcf..a769b15baf58d8ae674fecc062ebcc0468eecab9 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-02  Tom Tromey  <tom@tromey.com>
+
+       * gdbreplay.c (fromhex): Remove.
+       * Makefile.in (GDBREPLAY_OBS): Add rsp-low.o.
+
 2019-05-29  Tom Tromey  <tromey@adacore.com>
 
        * configure: Rebuild.
index f5fc55034ee9bb66018a9478e594f6f43cd0feba..71865508d7a30eaf19d7d418c31ae9ebfa409c48 100644 (file)
@@ -291,6 +291,7 @@ GDBREPLAY_OBS = \
        common/cleanups.o \
        common/common-exceptions.o \
        common/common-utils.o \
+       common/rsp-low.o \
        common/errors.o \
        common/netstuff.o \
        common/print-utils.o \
index 2800e7834dfe50aa043a22809f055569afab1838..f4fd5686ef7f98e55c4a43383ba7c43ff0eb6e67 100644 (file)
@@ -49,6 +49,7 @@
 #endif
 
 #include "common/netstuff.h"
+#include "common/rsp-low.h"
 
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;
@@ -288,26 +289,6 @@ remote_open (char *name)
   fflush (stderr);
 }
 
-static int
-fromhex (int ch)
-{
-  if (ch >= '0' && ch <= '9')
-    {
-      return (ch - '0');
-    }
-  if (ch >= 'A' && ch <= 'F')
-    {
-      return (ch - 'A' + 10);
-    }
-  if (ch >= 'a' && ch <= 'f')
-    {
-      return (ch - 'a' + 10);
-    }
-  fprintf (stderr, "\nInvalid hex digit '%c'\n", ch);
-  fflush (stderr);
-  exit (1);
-}
-
 static int
 logchar (FILE *fp)
 {