diff options
author | Lancelot SIX <lancelot.six@amd.com> | 2022-05-25 09:37:54 +0100 |
---|---|---|
committer | Lancelot SIX <lancelot.six@amd.com> | 2022-05-26 09:42:47 +0100 |
commit | 284b6bb5c639735735246c4c60c0e06427e5c449 (patch) | |
tree | bb2396ad3bcedba7fdbbdf01939227a942849d15 /gdb/linux-nat.c | |
parent | bfcd7c2160fd145a9d7ff215ff28cdf5e406af5a (diff) | |
download | binutils-284b6bb5c639735735246c4c60c0e06427e5c449.zip binutils-284b6bb5c639735735246c4c60c0e06427e5c449.tar.gz binutils-284b6bb5c639735735246c4c60c0e06427e5c449.tar.bz2 |
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
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 3b54008..b9164e6 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3917,7 +3917,7 @@ linux_proc_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf, linux_nat_debug_printf ("accessing fd %d for pid %d failed: %s (%d)", fd, inferior_ptid.pid (), safe_strerror (errno), errno); - return TARGET_XFER_EOF; + return TARGET_XFER_E_IO; } else if (ret == 0) { |