This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH v2] arc: Select CPU model properly before disassembling


> 
> I'd think that the "set/show disassembler-options" setting wouldn't ever be
> changed by connecting to a target and that whatever the user explicitly set
> should be respected.
> 
> I.e., gdb / opcodes would choose which cpu to use for disassembly based on
> this logical sequence:
> 
>  - if user specified cpu, use that,
>  - otherwise, if tdesc specified cpu, use that,
>  - otherwise, infer cpu from bfd/elf section,
>  - otherwise, use default cpu

However for ARC we don't support "set disassembler-options", because this
option requires valid disassembler_options to be provided, and arc-tdep.c doesn't
do this - so currently "set disassembler-options ..." reports as unsupported. I
agree that in general this option that comes from XML description probably
should be hidden from the user and not shown via "show disassembler-options".
One possible way is that CPU from target description will be stored in the ARC
gdbarch_tdep, and then will be appended to disassemble_info options in the
arc_delayed_print_insn if cpu= hasn't been specified by the user.  As far as I
can see this situation is pretty specific to ARC, because we have two
bfd_arch_info instances sharing the same machine number (to be compatible with
our proprietary toolchain), so <architecture> tag in XML description doesn't
work the way it should - it selects the first of those two architectures in the
internal BFD list, regardless of which one was actually in the description.

Anton

> 
> Thanks,
> Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]