This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/8] Call print_insn_mep in mep_gdb_print_insn
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Tue, 10 Jan 2017 12:26:12 +0000
- Subject: [PATCH 2/8] Call print_insn_mep in mep_gdb_print_insn
- Authentication-results: sourceware.org; auth=none
- References: <1484051178-16013-1-git-send-email-yao.qi@linaro.org>
opcodes/mep-dis.c:mep_print_insn has already had the code to
handle the case when info->section is NULL,
/* Picking the right ISA bitmask for the current context is tricky. */
if (info->section)
{
}
else /* sid or gdb */
{
}
so that we can still cal print_insn_mep even section can't be found.
On the other hand, user can disassemble an arbitrary address which
doesn't map to any section at all.
gdb:
2017-01-10 Yao Qi <yao.qi@linaro.org>
* mep-tdep.c (mep_gdb_print_insn): Set info->arch
to bfd_arch_mep. Don't return 0 if section is not
found. Call print_insn_mep.
---
gdb/mep-tdep.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 68b0c4b..7d04983 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -1273,6 +1273,7 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info)
{
struct obj_section * s = find_pc_section (pc);
+ info->arch = bfd_arch_mep;
if (s)
{
/* The libopcodes disassembly code uses the section to find the
@@ -1280,12 +1281,9 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info)
the me_module index, and the me_module index to select the
right instructions to print. */
info->section = s->the_bfd_section;
- info->arch = bfd_arch_mep;
-
- return print_insn_mep (pc, info);
}
-
- return 0;
+
+ return print_insn_mep (pc, info);
}
--
1.9.1