parse.c (write_dollar_variable): call new function target_map_name_to_register
so that targets can define their own register name aliases. infcmd.c (registers_info): call target_map_name_to_register so that "print $reg" and "info reg $reg" share the same register alias set. mips-tdep.c: separate MIPS_R5900_REGS from NUM_REGS so that sky registers can be printed separately. txvu-tdep.c: print registers according to current CPU context. tm-txvu.h: define SKY registers and conditionalize register interpretation macros. txvu.mt: Don't bother building remote-mips.o for sky target.
This commit is contained in:
parent
486c714a26
commit
678fa7ffe3
2 changed files with 45 additions and 13 deletions
|
@ -1,3 +1,11 @@
|
|||
Sun Feb 15 16:10:50 1998 Ron Unrau <runrau@cygnus.com>
|
||||
|
||||
* parse.c (write_dollar_variable): call new function
|
||||
target_map_name_to_register to allow targets to define their own
|
||||
register name aliases.
|
||||
* infcmd.c (registers_info): use target_map_name_to_register so that
|
||||
"print $reg" and "info reg $reg" use the same register name aliases.
|
||||
|
||||
Fri Feb 13 16:40:30 1998 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* config/i386/i386mk.mt (OBJFORMATS): Delete, no longer used.
|
||||
|
|
50
gdb/parse.c
50
gdb/parse.c
|
@ -101,6 +101,40 @@ unsigned num_std_regs = (sizeof std_regs / sizeof std_regs[0]);
|
|||
|
||||
#endif
|
||||
|
||||
/* The generic method for targets to specify how their registers are named.
|
||||
The mapping can be derived from three sources: reg_names; std_regs; or
|
||||
a target specific alias hook. */
|
||||
|
||||
int
|
||||
target_map_name_to_register (str, len)
|
||||
char *str;
|
||||
int len;
|
||||
{
|
||||
int i;
|
||||
|
||||
/* First search architectural register name space. */
|
||||
for (i = 0; i < NUM_REGS; i++)
|
||||
if (reg_names[i] && len == strlen (reg_names[i])
|
||||
&& STREQN (str, reg_names[i], len))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Try standard aliases */
|
||||
for (i = 0; i < num_std_regs; i++)
|
||||
if (std_regs[i].name && len == strlen (std_regs[i].name)
|
||||
&& STREQN (str, std_regs[i].name, len))
|
||||
{
|
||||
return std_regs[i].regnum;
|
||||
}
|
||||
|
||||
/* Try target specific aliases */
|
||||
#ifdef REGISTER_NAME_ALIAS_HOOK
|
||||
return REGISTER_NAME_ALIAS_HOOK (str, len);
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Begin counting arguments for a function call,
|
||||
saving the data about any containing call. */
|
||||
|
@ -455,19 +489,9 @@ write_dollar_variable (str)
|
|||
|
||||
/* Handle tokens that refer to machine registers:
|
||||
$ followed by a register name. */
|
||||
for (i = 0; i < NUM_REGS; i++)
|
||||
if (reg_names[i] && str.length - 1 == strlen (reg_names[i])
|
||||
&& STREQN (str.ptr + 1, reg_names[i], str.length - 1))
|
||||
{
|
||||
goto handle_register;
|
||||
}
|
||||
for (i = 0; i < num_std_regs; i++)
|
||||
if (std_regs[i].name && str.length - 1 == strlen (std_regs[i].name)
|
||||
&& STREQN (str.ptr + 1, std_regs[i].name, str.length - 1))
|
||||
{
|
||||
i = std_regs[i].regnum;
|
||||
goto handle_register;
|
||||
}
|
||||
i = target_map_name_to_register( str.ptr + 1, str.length - 1 );
|
||||
if( i >= 0 )
|
||||
goto handle_register;
|
||||
|
||||
/* Any other names starting in $ are debugger internal variables. */
|
||||
|
||||
|
|
Loading…
Reference in a new issue