diff options
author | Pedro Alves <palves@redhat.com> | 2017-09-29 12:33:41 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-09-29 13:10:39 +0100 |
commit | 5b9ca4d43ba0313612e8ad6e50221e8f20ebd129 (patch) | |
tree | c291d2d9d5e2ebef31ef0a37367e629006dbc8bd /gdb/gdbserver/proc-service.c | |
parent | 94c207e097a3a30ce71fc8f700325113968c276b (diff) | |
download | gdb-5b9ca4d43ba0313612e8ad6e50221e8f20ebd129.zip gdb-5b9ca4d43ba0313612e8ad6e50221e8f20ebd129.tar.gz gdb-5b9ca4d43ba0313612e8ad6e50221e8f20ebd129.tar.bz2 |
gdbserver/libthread_db: Don't ignore memory reading failures
If we had this in place before, then the regression fixed by the
previous commit would have been been visible is all test runs. E.g.:
Running src/gdb/testsuite/gdb.threads/multi-create-ns-info-thr.exp ...
FAIL: gdb.threads/multi-create-ns-info-thr.exp: continue to breakpoint 6
Debugging manually we'd see this:
gdbserver: Cannot get thread handle for LWP 1467: generic error
Instead of:
gdbserver: PID mismatch! Expected 27472, got 27471
which is misleading - gdbserver didn't 27471, that was stale stack
data from previous function invocations.
gdb/gdbserver/ChangeLog:
2017-09-29 Pedro Alves <palves@redhat.com>
* proc-service.c (ps_pdread): Return PS_ERR if reading memory
fails.
Diffstat (limited to 'gdb/gdbserver/proc-service.c')
-rw-r--r-- | gdb/gdbserver/proc-service.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/gdbserver/proc-service.c b/gdb/gdbserver/proc-service.c index 98d6acd..5b058fd 100644 --- a/gdb/gdbserver/proc-service.c +++ b/gdb/gdbserver/proc-service.c @@ -80,7 +80,8 @@ ps_err_e ps_pdread (gdb_ps_prochandle_t ph, psaddr_t addr, gdb_ps_read_buf_t buf, gdb_ps_size_t size) { - read_inferior_memory ((uintptr_t) addr, (gdb_byte *) buf, size); + if (read_inferior_memory ((uintptr_t) addr, (gdb_byte *) buf, size) != 0) + return PS_ERR; return PS_OK; } |