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.
This commit is contained in:
Alan Hayward 2018-03-23 11:17:22 +00:00
parent 8fd7578189
commit dff7492c9b
3 changed files with 14 additions and 16 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -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)
{

View File

@ -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);