+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>
+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
}
static int
-tohex (int ch)
+fromhex (int ch)
{
if (ch >= '0' && ch <= '9')
{
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 */
#include "regcache.h"
#include "gdbthread.h"
#include "readline/readline.h"
+#include "rsp-low.h"
static char *dev_name;
static struct target_ops *targ_ops;
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