[ARC] Allow CPU to be enforced via disassemble_info options
authorAnton Kolesov <Anton.Kolesov@synopsys.com>
Thu, 16 Mar 2017 12:21:31 +0000 (15:21 +0300)
committerAnton Kolesov <Anton.Kolesov@synopsys.com>
Tue, 30 May 2017 13:54:02 +0000 (16:54 +0300)
commit10045478d984f9924cb945423388ba25b7dd3ffe
tree0f5dd12a962563711bec6ec32ff73e0b6966cc8c
parent940171d08654a9ff5bf9b8886f76e8189a02cf09
[ARC] Allow CPU to be enforced via disassemble_info options

Currently print_insn_arc relies on BFD mach and ELF private headers to
distinguish between various ARC architectures.  Sometimes those values are not
correct or available, mainly in the case of debugging targets without and ELF
file available.  Changing a BFD mach is not a problem for the debugger, because
this is a generic BFD field, and GDB, for example, already sets it according to
information provided in XML target description or specified via GDB 'set arch'
command.  However, things are more complicated for ELF private headers, since
it requires existing of an actual ELF file.  To workaround this problem this
patch allows CPU model to be specified via disassemble info options.  If CPU is
specified in options, then it will take a higher precedence than whatever might
be specified in ELF file.

This is mostly needed for ARC EM and ARC HS, because they have the same
"architecture" (mach) ARCv2 and differ in their private ELF headers.  Other ARC
architectures can be distinguished between each other purely via "mach" field.

Proposed disassemble option format is "cpu=<CPU>", where CPU can be any valid
ARC CPU name as supported by GAS.  Note that this creates a seeming redundancy
with objdump -m/--architecture option, however -mEM and -mHS still result in
"ARCv2" architecture internally, while -Mcpu={HS,EM} would have an actual
effect on disassembler.

opcodes/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

* arc-dis.c (enforced_isa_mask): Declare.
(cpu_types): Likewise.
(parse_cpu_option): New function.
(parse_disassembler_options): Use it.
(print_insn_arc): Use enforced_isa_mask.
(print_arc_disassembler_options): Document new options.

binutils/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

* doc/binutils.texi: Document new cpu=... disassembler options for ARC.
binutils/ChangeLog
binutils/doc/binutils.texi
opcodes/ChangeLog
opcodes/arc-dis.c
This page took 0.028148 seconds and 4 git commands to generate.