#endif /* PTRACE_EVENT_FORK */
+#if (defined __bfin__ || defined __frv__ || defined __sh__) \
+ && !defined PTRACE_GETFDPIC
+#define PTRACE_GETFDPIC 31
+#define PTRACE_GETFDPIC_EXEC 0
+#define PTRACE_GETFDPIC_INTERP 1
+#endif
+
/* We can't always assume that this flag is available, but all systems
with the ptrace event handlers also have __WALL, so it's safe to use
in some contexts. */
+2011-09-29 Mike Frysinger <vapier@gentoo.org>
+
+ * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
+ ifdef check.
+ [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
+ [!PT_GETDSBT] (target_loadmap): New definition.
+ (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
+ (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
+ LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
+ and PT_GETDSBT to LINUX_LOADMAP.
+ [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
+ (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
+
2011-09-21 Ulrich Weigand <ulrich.weigand@linaro.org>
* linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
return ret;
}
-#if defined PT_GETDSBT
+#if defined PT_GETDSBT || defined PTRACE_GETFDPIC
struct target_loadseg
{
/* Core address to which the segment is mapped. */
Elf32_Word p_memsz;
};
+# if defined PT_GETDSBT
struct target_loadmap
{
/* Protocol version number, must be zero. */
/* The actual memory map. */
struct target_loadseg segs[/*nsegs*/];
};
-#endif
+# define LINUX_LOADMAP PT_GETDSBT
+# define LINUX_LOADMAP_EXEC PTRACE_GETDSBT_EXEC
+# define LINUX_LOADMAP_INTERP PTRACE_GETDSBT_INTERP
+# else
+struct target_loadmap
+{
+ /* Protocol version number, must be zero. */
+ Elf32_Half version;
+ /* Number of segments in this map. */
+ Elf32_Half nsegs;
+ /* The actual memory map. */
+ struct target_loadseg segs[/*nsegs*/];
+};
+# define LINUX_LOADMAP PTRACE_GETFDPIC
+# define LINUX_LOADMAP_EXEC PTRACE_GETFDPIC_EXEC
+# define LINUX_LOADMAP_INTERP PTRACE_GETFDPIC_INTERP
+# endif
-#if defined PT_GETDSBT
static int
linux_read_loadmap (const char *annex, CORE_ADDR offset,
unsigned char *myaddr, unsigned int len)
unsigned int actual_length, copy_length;
if (strcmp (annex, "exec") == 0)
- addr= (int) PTRACE_GETDSBT_EXEC;
+ addr = (int) LINUX_LOADMAP_EXEC;
else if (strcmp (annex, "interp") == 0)
- addr = (int) PTRACE_GETDSBT_INTERP;
+ addr = (int) LINUX_LOADMAP_INTERP;
else
return -1;
- if (ptrace (PT_GETDSBT, pid, addr, &data) != 0)
+ if (ptrace (LINUX_LOADMAP, pid, addr, &data) != 0)
return -1;
if (data == NULL)
memcpy (myaddr, (char *) data + offset, copy_length);
return copy_length;
}
-#endif /* defined PT_GETDSBT */
+#else
+# define linux_read_loadmap NULL
+#endif /* defined PT_GETDSBT || defined PTRACE_GETFDPIC */
static void
linux_process_qsupported (const char *query)
NULL,
#endif
linux_common_core_of_thread,
-#if defined PT_GETDSBT
linux_read_loadmap,
-#else
- NULL,
-#endif
linux_process_qsupported,
linux_supports_tracepoints,
linux_read_pc,