The cached reads lack the big endian adjustments done in the fallback
path.
Signed-off-by: Andreas Krebbel <krebbel@linux.ibm.com>
+2020-11-19 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * linux-pid-attach.c (pid_memory_read): Shift the upper 4 bytes
+ down on big endian 64 bit targets.
+
2020-11-12 Timm Bäder <tbaeder@redhat.com>
* dwfl_segment_report_module.c (dwfl_segment_report_module): Remove
{
struct __libdwfl_pid_arg *pid_arg = arg;
pid_t tid = pid_arg->tid_attached;
+ Dwfl_Process *process = dwfl->process;
assert (tid > 0);
#ifdef HAVE_PROCESS_VM_READV
if (read_cached_memory (pid_arg, addr, result))
+ {
+#if SIZEOF_LONG == 8
+# if BYTE_ORDER == BIG_ENDIAN
+ if (ebl_get_elfclass (process->ebl) == ELFCLASS32)
+ *result >>= 32;
+# endif
+#endif
return true;
+ }
#endif
- Dwfl_Process *process = dwfl->process;
if (ebl_get_elfclass (process->ebl) == ELFCLASS64)
{
#if SIZEOF_LONG == 8