2005-01-19 Fred Fish <fnf@specifixinc.com>

* mips-dis.c (no_aliases): New disassembly option flag.
	(set_default_mips_dis_options): Init no_aliases to zero.
	(parse_mips_dis_option): Handle no-aliases option.
	(print_insn_mips): Ignore table entries that are aliases
	if no_aliases is set.
	(print_insn_mips16): Ditto.
	* mips-opc.c (mips_builtin_opcodes): Add initializer column for
	new pinfo2 member and add INSN_ALIAS initializers as needed.  Also
	move WR_MACC and RD_MACC initializers from pinfo to pinfo2.
	* mips16-opc.c (mips16_opcodes): Ditto.
This commit is contained in:
Fred Fish
2005-01-19 23:31:15 +00:00
parent dc9a9f39cc
commit 986e18a5a9
4 changed files with 1220 additions and 1191 deletions

View File

@ -414,6 +414,9 @@ static const struct mips_cp0sel_name *mips_cp0sel_names;
static int mips_cp0sel_names_len;
static const char * const *mips_hwr_names;
/* Other options */
static int no_aliases; /* If set disassemble as most general inst. */
static const struct mips_abi_choice *choose_abi_by_name
PARAMS ((const char *, unsigned int));
static const struct mips_arch_choice *choose_arch_by_name
@ -503,6 +506,7 @@ set_default_mips_dis_options (info)
mips_cp0sel_names = NULL;
mips_cp0sel_names_len = 0;
mips_hwr_names = mips_hwr_names_numeric;
no_aliases = 0;
/* If an ELF "newabi" binary, use the n32/(n)64 GPR names. */
if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
@ -544,6 +548,13 @@ parse_mips_dis_option (option, len)
const struct mips_abi_choice *chosen_abi;
const struct mips_arch_choice *chosen_arch;
/* Try to match options that are simple flags */
if (strncmp (option, "no-aliases", 10) == 0)
{
no_aliases = 1;
return;
}
/* Look for the = that delimits the end of the option name. */
for (i = 0; i < len; i++)
{
@ -1071,7 +1082,8 @@ print_insn_mips (memaddr, word, info)
{
for (op = mips_opcodes; op < &mips_opcodes[NUMOPCODES]; op++)
{
if (op->pinfo == INSN_MACRO)
if (op->pinfo == INSN_MACRO
|| (no_aliases && (op->pinfo2 & INSN_ALIAS)))
continue;
if (i == ((op->match >> OP_SH_OP) & OP_MASK_OP))
{
@ -1098,7 +1110,9 @@ print_insn_mips (memaddr, word, info)
{
for (; op < &mips_opcodes[NUMOPCODES]; op++)
{
if (op->pinfo != INSN_MACRO && (word & op->mask) == op->match)
if (op->pinfo != INSN_MACRO
&& !(no_aliases && (op->pinfo2 & INSN_ALIAS))
&& (word & op->mask) == op->match)
{
register const char *d;
@ -1296,7 +1310,9 @@ print_insn_mips16 (memaddr, info)
opend = mips16_opcodes + bfd_mips16_num_opcodes;
for (op = mips16_opcodes; op < opend; op++)
{
if (op->pinfo != INSN_MACRO && (insn & op->mask) == op->match)
if (op->pinfo != INSN_MACRO
&& !(no_aliases && (op->pinfo2 & INSN_ALIAS))
&& (insn & op->mask) == op->match)
{
const char *s;