gas 0f handling
[deliverable/binutils-gdb.git] / gdb / disasm.c
index 25d87d70846df775195940e41a530d2e12367e9e..483df01d2092c05b2afcb68ed1fab9e7c505b4f1 100644 (file)
@@ -1,6 +1,6 @@
 /* Disassemble support for GDB.
 
-   Copyright (C) 2000-2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2000-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,7 +21,6 @@
 #include "target.h"
 #include "value.h"
 #include "ui-out.h"
-#include "gdb_string.h"
 #include "disasm.h"
 #include "gdbcore.h"
 #include "dis-asm.h"
@@ -47,7 +46,7 @@ static int
 dis_asm_read_memory (bfd_vma memaddr, gdb_byte *myaddr, unsigned int len,
                     struct disassemble_info *info)
 {
-  return target_read_memory (memaddr, myaddr, len);
+  return target_read_code (memaddr, myaddr, len);
 }
 
 /* Like memory_error with slightly different parameters.  */
@@ -122,7 +121,9 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
            num_displayed++;
        }
       ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-      ui_out_text (uiout, pc_prefix (pc));
+
+      if ((flags & DISASSEMBLY_OMIT_PC) == 0)
+       ui_out_text (uiout, pc_prefix (pc));
       ui_out_field_core_addr (uiout, "address", gdbarch, pc);
 
       if (!build_address_symbolic (gdbarch, pc, 0, &name, &offset, &filename,
@@ -374,7 +375,7 @@ fprintf_disasm (void *stream, const char *format, ...)
   return 0;
 }
 
-static struct disassemble_info
+struct disassemble_info
 gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
 {
   struct disassemble_info di;
@@ -409,23 +410,22 @@ gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
   struct ui_file *stb = mem_fileopen ();
   struct cleanup *cleanups = make_cleanup_ui_file_delete (stb);
   struct disassemble_info di = gdb_disassemble_info (gdbarch, stb);
-  /* To collect the instruction outputted from opcodes.  */
-  struct symtab *symtab = NULL;
+  struct symtab *symtab;
   struct linetable_entry *le = NULL;
   int nlines = -1;
 
   /* Assume symtab is valid for whole PC range.  */
-  symtab = find_pc_symtab (low);
+  symtab = find_pc_line_symtab (low);
 
-  if (symtab != NULL && symtab->linetable != NULL)
+  if (symtab != NULL && SYMTAB_LINETABLE (symtab) != NULL)
     {
       /* Convert the linetable to a bunch of my_line_entry's.  */
-      le = symtab->linetable->item;
-      nlines = symtab->linetable->nitems;
+      le = SYMTAB_LINETABLE (symtab)->item;
+      nlines = SYMTAB_LINETABLE (symtab)->nitems;
     }
 
   if (!(flags & DISASSEMBLY_SOURCE) || nlines <= 0
-      || symtab == NULL || symtab->linetable == NULL)
+      || symtab == NULL || SYMTAB_LINETABLE (symtab) == NULL)
     do_assembly_only (gdbarch, uiout, &di, low, high, how_many, flags, stb);
 
   else if (flags & DISASSEMBLY_SOURCE)
This page took 0.026002 seconds and 4 git commands to generate.