aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-03-23 11:17:22 +0000
committerAlan Hayward <alan.hayward@arm.com>2018-03-23 14:49:09 +0000
commitdff7492c9b221aacd4efa6675bb288dfb5d50f80 (patch)
tree914a6406fcf307dad3581725f6c091cb8b5e52f1 /gdb
parent8fd75781892c7458702f72b3b9cb1927609716de (diff)
downloadgdb-dff7492c9b221aacd4efa6675bb288dfb5d50f80.zip
gdb-dff7492c9b221aacd4efa6675bb288dfb5d50f80.tar.gz
gdb-dff7492c9b221aacd4efa6675bb288dfb5d50f80.tar.bz2
Make gdbserver find_register_by_number static
gdbserver/ * regcache.c (find_register_by_number): Make static. (find_regno): Use find_register_by_number * regcache.h (struct reg): Remove declaration.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/regcache.c20
-rw-r--r--gdb/gdbserver/regcache.h4
3 files changed, 14 insertions, 16 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 093eec7..c07d40a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2018-03-23 Alan Hayward <alan.hayward@arm.com>
+ * regcache.c (find_register_by_number): Make static.
+ (find_regno): Use find_register_by_number
+ * regcache.h (struct reg): Remove declaration.
+
+2018-03-23 Alan Hayward <alan.hayward@arm.com>
+
* tdesc.c (target_desc::~target_desc): Move to here.
(target_desc::operator==): Likewise.
* tdesc.h (target_desc::~target_desc): Move from here.
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index 1bb1590..d6511fd 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -196,6 +196,13 @@ regcache_cpy (struct regcache *dst, struct regcache *src)
dst->registers_valid = src->registers_valid;
}
+/* Return a pointer to the description of register N. */
+
+static const struct reg *
+find_register_by_number (const struct target_desc *tdesc, int n)
+{
+ return tdesc->reg_defs[n];
+}
#ifndef IN_PROCESS_AGENT
@@ -244,24 +251,13 @@ find_regno (const struct target_desc *tdesc, const char *name)
{
for (int i = 0; i < tdesc->reg_defs.size (); ++i)
{
- struct reg *reg = tdesc->reg_defs[i];
-
- if (strcmp (name, reg->name) == 0)
+ if (strcmp (name, find_register_by_number (tdesc, i)->name) == 0)
return i;
}
internal_error (__FILE__, __LINE__, "Unknown register %s requested",
name);
}
-#endif
-
-struct reg *
-find_register_by_number (const struct target_desc *tdesc, int n)
-{
- return tdesc->reg_defs[n];
-}
-
-#ifndef IN_PROCESS_AGENT
static void
free_register_cache_thread (struct thread_info *thread)
{
diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h
index 3a75ce3..6ff1308 100644
--- a/gdb/gdbserver/regcache.h
+++ b/gdb/gdbserver/regcache.h
@@ -94,10 +94,6 @@ void registers_from_string (struct regcache *regcache, char *buf);
void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
-/* Return a pointer to the description of register ``n''. */
-
-struct reg *find_register_by_number (const struct target_desc *tdesc, int n);
-
int register_cache_size (const struct target_desc *tdesc);
int register_size (const struct target_desc *tdesc, int n);