gdb/linux-nat: xfer_memory_partial return E_IO on error
authorLancelot SIX <lancelot.six@amd.com>
Wed, 25 May 2022 08:37:54 +0000 (09:37 +0100)
committerLancelot SIX <lancelot.six@amd.com>
Thu, 26 May 2022 08:42:47 +0000 (09:42 +0100)
commit284b6bb5c639735735246c4c60c0e06427e5c449
treebb2396ad3bcedba7fdbbdf01939227a942849d15
parentbfcd7c2160fd145a9d7ff215ff28cdf5e406af5a
gdb/linux-nat: xfer_memory_partial return E_IO on error

When accessing /proc/PID/mem, if pread64/pwrite64/read/write encounters
an error and return -1, linux_proc_xfer_memory_partial return
TARGET_XFER_EOF.

I think it should return TARGET_XFER_E_IO in this case.  TARGET_XFER_EOF
is returned when pread64/pwrite64/read/frite returns 0, which indicates
that the address space is gone and the whole process has exited or
execed.

This patch makes this change.

Regression tested on x86_64-linux-gnu.

Change-Id: I6030412459663b8d7933483fdda22a6c2c5d7221
gdb/linux-nat.c