* cris.h (R_CRIS_32_IE): New relocation.
[deliverable/binutils-gdb.git] / gdb / rs6000-aix-tdep.c
index 43a3a0a1bb333a555c08f7a0bdb7eacb74c6a822..a6e40fca00647a77a21b20048d41094c50996370 100644 (file)
@@ -570,11 +570,22 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
   struct obj_section *s;
 
   s = find_pc_section (addr);
-  if (s && s->the_bfd_section->flags & SEC_CODE)
-    return addr;
 
-  /* ADDR is in the data space, so it's a special function pointer. */
-  return read_memory_unsigned_integer (addr, gdbarch_tdep (gdbarch)->wordsize);
+  /* Normally, functions live inside a section that is executable.
+     So, if ADDR points to a non-executable section, then treat it
+     as a function descriptor and return the target address iff
+     the target address itself points to a section that is executable.  */
+  if (s && (s->the_bfd_section->flags & SEC_CODE) == 0)
+    {
+      CORE_ADDR pc =
+        read_memory_unsigned_integer (addr, gdbarch_tdep (gdbarch)->wordsize);
+      struct obj_section *pc_section = find_pc_section (pc);
+
+      if (pc_section && (pc_section->the_bfd_section->flags & SEC_CODE))
+        return pc;
+    }
+
+  return addr;
 }
 
 
@@ -703,6 +714,13 @@ rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
   set_gdbarch_software_single_step (gdbarch, rs6000_software_single_step);
 
+  /* Displaced stepping is currently not supported in combination with
+     software single-stepping.  */
+  set_gdbarch_displaced_step_copy_insn (gdbarch, NULL);
+  set_gdbarch_displaced_step_fixup (gdbarch, NULL);
+  set_gdbarch_displaced_step_free_closure (gdbarch, NULL);
+  set_gdbarch_displaced_step_location (gdbarch, NULL);
+
   set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call);
   set_gdbarch_return_value (gdbarch, rs6000_return_value);
   set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
This page took 0.023773 seconds and 4 git commands to generate.