Call print_insn_mep in mep_gdb_print_insn
authorYao Qi <yao.qi@linaro.org>
Thu, 26 Jan 2017 14:29:19 +0000 (14:29 +0000)
committerYao Qi <yao.qi@linaro.org>
Thu, 26 Jan 2017 14:29:19 +0000 (14:29 +0000)
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-26  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/ChangeLog
gdb/mep-tdep.c

index 90d0cb32aafbfd69e1fe68f0fb1f42bc2aade47e..246d09e64ef0d3c79e8bd3a639f4157f4e215a11 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-26  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.
+
 2017-01-26  Pedro Alves  <palves@redhat.com>
            Yao Qi  <yao.qi@linaro.org>
 
index 68b0c4b0bd1301b50bc1cbf9022791a35261bba2..b1dcc863ef0b18472e2cbc123244b12ab397e7d1 100644 (file)
@@ -1266,13 +1266,12 @@ mep_pseudo_register_write (struct gdbarch *gdbarch,
 \f
 /* Disassembly.  */
 
-/* The mep disassembler needs to know about the section in order to
-   work correctly.  */
 static int
 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 +1279,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);
 }
 
 \f
This page took 0.027356 seconds and 4 git commands to generate.