+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.
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
{
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)
{
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);