This is the mail archive of the
mailing list for the binutils project.
[PATCH] [ARC] Pass arc_opcode to GDB as an architecture specific data
- From: Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- To: binutils at sourceware dot org
- Cc: Anton Kolesov <Anton dot Kolesov at synopsys dot com>, 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: Fri, 30 Sep 2016 20:33:24 +0300
- Subject: [PATCH] [ARC] Pass arc_opcode to GDB as an architecture specific data
- Authentication-results: sourceware.org; auth=none
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.
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.
* arc-dis.c (print_insn_arc): Pass arc_opcode to GDB as private_data.
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
opcodes/arc-dis.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index e4df678..a6552b8 100644
@@ -1231,6 +1231,12 @@ print_insn_arc (bfd_vma memaddr,
+ /* Assign arc_opcode as a private data of disassemble_info to give GDB more
+ information about instruction. For example to do prologue analysis GDB
+ needs to know what instruction does, what are instruction operands,
+ whether it has condition code, etc. */
+ info->private_data = (void *) opcode;