Is this "gdb disassembler" code still needed?

Richard Sandiford
2013-06-26T18:35:13Z

Hi,

opcodes/mips-dis.c has some code marked "For gdb disassembler, ...".

(1) For jumps in the standard encoding:

/* For gdb disassembler, force odd address on jalx. */
if (info->flavour == bfd_target_unknown_flavour
&& strcmp (opp->name, "jalx") == 0)
info->target |= 1;

(2) For MIPS16 branches:

if (pcrel && branch
&& info->flavour == bfd_target_unknown_flavour)
/* For gdb disassembler, maintain odd address. */
info->target |= 1;

(3) For MIPS16 jumps:

if (!jalx && info->flavour == bfd_target_unknown_flavour)
/* For gdb disassembler, maintain odd address. */
l |= 1;

(4) For microMIPS jumps:

/* For gdb disassembler, force odd address on jalx. */
if (info->flavour == bfd_target_unknown_flavour
&& strcmp (op->name, "jalx") == 0)
info->target |= 1;

(4) seems like it's doing the opposite of (3), whereas I'd have expected
it to do the same. It doesn't like microMIPS has the equivalent of (2).
(Hope I'm reading this right.)

Do you know if this special handling is still needed? If so, is the
current behaviour intentional?

Thanks,
Richard