[PATCH] [ARC] Pass arc_opcode to GDB as an architecture specific data

Yao Qi qiyaoltc@gmail.com
Wed Oct 5 16:47:00 GMT 2016


On Fri, Sep 30, 2016 at 6:33 PM, Anton Kolesov
<Anton.Kolesov@synopsys.com> wrote:
> To do prologue analysis GDB needs to know a lot of information about
> instructions that is not provided by generic disassemble_info structure.  For
> example, disassemble_info doesn't provide information about instruction
> operands, or whether instruction is has is a predicated (which means that it is
> effectively a branch and in general prologue analysis halts immediately on
> branches).  To close the information gap between disassembly and GDB it is
> required to pass architecture-specific structure "arc_opcode" to GDB as a value
> of "private_data" field of disassemble_info structure. Structure "arc_opcode"
> contains most of the information needed by GDB.

How do you use disassemble_info in prologue analysis?  I am not sure
disassemble_info can be used for something other than disassembly.

>
> Alternative solution would be to do a complete instruction decoding in GDB
> instead of using opcodes, however that would create a lot of unnecessary
> duplication, which would be especially problematic because ARC doesn't have a
> clear instruction encoding format organization, so handling all of the various
> instruction formats is quite a task.
>

Right, alternatively, you can add a new api, like arc_decode_insn, and it
returns structure "arc_opcode", so that GDB can use it in prologue
analysis and somewhere else if instruction decoding is needed.  We
did the same in aarch64, see how aarch64_decode_insn is used in
aarch64-tdep.c:aarch64_analyze_prologue.

-- 
Yao (齐尧)



More information about the Binutils mailing list