From 88ed7edbc632245fad33145e723d27976b6732ca Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 1 Jun 2019 09:16:04 -0600 Subject: [PATCH] Remove fromhex implementation from gdbreplay 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 * gdbreplay.c (fromhex): Remove. * Makefile.in (GDBREPLAY_OBS): Add rsp-low.o. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/Makefile.in | 1 + gdb/gdbserver/gdbreplay.c | 21 +-------------------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index e15395d6954..a769b15baf5 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2019-06-02 Tom Tromey + + * gdbreplay.c (fromhex): Remove. + * Makefile.in (GDBREPLAY_OBS): Add rsp-low.o. + 2019-05-29 Tom Tromey * configure: Rebuild. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index f5fc55034ee..71865508d7a 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -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 \ diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index 2800e7834df..f4fd5686ef7 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -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) { -- 2.30.2