include/
[external/binutils.git] / gdb / rs6000-nat.c
index ae2806d..4e6cf96 100644 (file)
@@ -75,7 +75,7 @@
 #ifndef ARCH3264
 # define ARCH64() 0
 #else
-# define ARCH64() (register_size (current_gdbarch, 0) == 8)
+# define ARCH64() (register_size (target_gdbarch, 0) == 8)
 #endif
 
 /* Union of 32-bit and 64-bit versions of ld_info. */
@@ -581,6 +581,7 @@ exec_one_dummy_insn (struct regcache *regcache)
 {
 #define        DUMMY_INSN_ADDR AIX_TEXT_SEGMENT_BASE+0x200
 
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   int ret, status, pid;
   CORE_ADDR prev_pc;
   void *bp;
@@ -589,7 +590,7 @@ exec_one_dummy_insn (struct regcache *regcache)
      assume that this address will never be executed again by the real
      code. */
 
-  bp = deprecated_insert_raw_breakpoint (DUMMY_INSN_ADDR);
+  bp = deprecated_insert_raw_breakpoint (gdbarch, NULL, DUMMY_INSN_ADDR);
 
   /* You might think this could be done with a single ptrace call, and
      you'd be correct for just about every platform I've ever worked
@@ -613,7 +614,7 @@ exec_one_dummy_insn (struct regcache *regcache)
   while (pid != PIDGET (inferior_ptid));
 
   regcache_write_pc (regcache, prev_pc);
-  deprecated_remove_raw_breakpoint (bp);
+  deprecated_remove_raw_breakpoint (gdbarch, bp);
 }
 \f
 
@@ -691,8 +692,8 @@ objfile_symbol_add (void *arg)
 {
   struct objfile *obj = (struct objfile *) arg;
 
-  syms_from_objfile (obj, NULL, 0, 0, 0, 0);
-  new_symfile_objfile (obj, 0, 0);
+  syms_from_objfile (obj, NULL, 0, 0, 0);
+  new_symfile_objfile (obj, 0);
   return 1;
 }
 
@@ -736,8 +737,8 @@ add_vmap (LdInfo *ldi)
 
   filename = LDI_FILENAME (ldi, arch64);
   mem = filename + strlen (filename) + 1;
-  mem = savestring (mem, strlen (mem));
-  objname = savestring (filename, strlen (filename));
+  mem = xstrdup (mem);
+  objname = xstrdup (filename);
 
   fd = LDI_FD (ldi, arch64);
   if (fd < 0)
@@ -914,7 +915,7 @@ If in fact that file has symbols which the mapped files listed by\n\
 symbols to the proper address)."),
               symfile_objfile->name);
       free_objfile (symfile_objfile);
-      symfile_objfile = NULL;
+      gdb_assert (symfile_objfile == NULL);
     }
   breakpoint_re_set ();
 }
@@ -934,33 +935,32 @@ vmap_exec (void)
 {
   static bfd *execbfd;
   int i;
+  struct target_section_table *table = target_get_section_table (&exec_ops);
 
   if (execbfd == exec_bfd)
     return;
 
   execbfd = exec_bfd;
 
-  if (!vmap || !exec_ops.to_sections)
-    error (_("vmap_exec: vmap or exec_ops.to_sections == 0."));
+  if (!vmap || !table->sections)
+    error (_("vmap_exec: vmap or table->sections == 0."));
 
-  for (i = 0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
+  for (i = 0; &table->sections[i] < table->sections_end; i++)
     {
-      if (strcmp (".text", exec_ops.to_sections[i].the_bfd_section->name) == 0)
+      if (strcmp (".text", table->sections[i].the_bfd_section->name) == 0)
        {
-         exec_ops.to_sections[i].addr += vmap->tstart - vmap->tvma;
-         exec_ops.to_sections[i].endaddr += vmap->tstart - vmap->tvma;
+         table->sections[i].addr += vmap->tstart - vmap->tvma;
+         table->sections[i].endaddr += vmap->tstart - vmap->tvma;
        }
-      else if (strcmp (".data",
-                      exec_ops.to_sections[i].the_bfd_section->name) == 0)
+      else if (strcmp (".data", table->sections[i].the_bfd_section->name) == 0)
        {
-         exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
-         exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
+         table->sections[i].addr += vmap->dstart - vmap->dvma;
+         table->sections[i].endaddr += vmap->dstart - vmap->dvma;
        }
-      else if (strcmp (".bss",
-                      exec_ops.to_sections[i].the_bfd_section->name) == 0)
+      else if (strcmp (".bss", table->sections[i].the_bfd_section->name) == 0)
        {
-         exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
-         exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
+         table->sections[i].addr += vmap->dstart - vmap->dvma;
+         table->sections[i].endaddr += vmap->dstart - vmap->dvma;
        }
     }
 }
@@ -1160,8 +1160,7 @@ xcoff_relocate_core (struct target_ops *target)
        {
          struct target_section *stp;
 
-         target_resize_to_sections (target, 2);
-         stp = target->to_sections_end - 2;
+         stp = deprecated_core_resize_section_table (2);
 
          stp->bfd = vp->bfd;
          stp->the_bfd_section = bfd_get_section_by_name (stp->bfd, ".text");