aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2015-06-15 17:08:49 +0200
committerJan Kratochvil <jan.kratochvil@redhat.com>2015-06-15 17:08:49 +0200
commit909c2cdaa78f5c33ce61a3b47e86f831025d0a02 (patch)
tree5172e07fec31ef80fcfc87f7261bee1c0942f644
parent03aef70fecec83e109c65337a59600ad36def6bf (diff)
downloadgdb-909c2cdaa78f5c33ce61a3b47e86f831025d0a02.zip
gdb-909c2cdaa78f5c33ce61a3b47e86f831025d0a02.tar.gz
gdb-909c2cdaa78f5c33ce61a3b47e86f831025d0a02.tar.bz2
Merge multiple hex conversions
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.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/gdbreplay.c6
-rw-r--r--gdb/monitor.c16
4 files changed, 18 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f7e1167..eeded49 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,13 @@
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>
+
Move utility functions to common/.
* cli/cli-utils.c (skip_spaces, skip_spaces_const, skip_to_space_const):
Move defs to common/common-utils.c.
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5d5f0a4..c1d589a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -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
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index a02a824..79aa8aa 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -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 */
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 548dae3..c7f5fc7 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -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