aboutsummaryrefslogtreecommitdiff
path: root/opcodes/mips-dis.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2005-01-19 23:31:15 +0000
committerFred Fish <fnf@specifix.com>2005-01-19 23:31:15 +0000
commit986e18a5a9fd736df281b9ceab32c390fb8bd9b6 (patch)
treeeed2c605f1dc3f8158af2fa9c9f2294d978ab64a /opcodes/mips-dis.c
parentdc9a9f39cc1454a6627d1a06e455cbef68979b18 (diff)
downloadfsf-binutils-gdb-986e18a5a9fd736df281b9ceab32c390fb8bd9b6.zip
fsf-binutils-gdb-986e18a5a9fd736df281b9ceab32c390fb8bd9b6.tar.gz
fsf-binutils-gdb-986e18a5a9fd736df281b9ceab32c390fb8bd9b6.tar.bz2
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.
Diffstat (limited to 'opcodes/mips-dis.c')
-rw-r--r--opcodes/mips-dis.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index 43fcb3c..ee50bbb 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -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;