This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] [ARC] Pass arc_opcode to GDB as an architecture specific data
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- Cc: binutils at sourceware dot org, Francois Bedard <Francois dot Bedard at synopsys dot com>, Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- Date: Wed, 5 Oct 2016 17:47:05 +0100
- Subject: Re: [PATCH] [ARC] Pass arc_opcode to GDB as an architecture specific data
- Authentication-results: sourceware.org; auth=none
- References: <1475256804-22812-1-git-send-email-Anton.Kolesov@synopsys.com>
On Fri, Sep 30, 2016 at 6:33 PM, Anton Kolesov
> 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