[PATCH] Return TARGET_XFER_EOF if reading at the end of TARGET_OBJECT_SIGNAL_INFO.
John Baldwin
jhb@FreeBSD.org
Thu May 9 23:25:00 GMT 2019
This fixes an assertion failure if a request is made to read just past
the end of a native thread's signal information structure.
gdb/ChangeLog:
* fbsd-nat.c (fbsd_nat_target::xfer_partial) [USE_SIGINFO]: Return
TARGET_XFER_EOF if len is zero.
---
gdb/ChangeLog | 5 +++++
gdb/fbsd-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5b0a9fde61..de24a26a59 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-09 John Baldwin <jhb@FreeBSD.org>
+
+ * fbsd-nat.c (fbsd_nat_target::xfer_partial) [USE_SIGINFO]: Return
+ TARGET_XFER_EOF if len is zero.
+
2019-05-08 Tom Tromey <tom@tromey.com>
* gdbtypes.c (objfile_type_data): Change type.
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index d4f4c8cf35..35188b44fa 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -720,7 +720,7 @@ fbsd_nat_target::xfer_partial (enum target_object object,
memcpy (readbuf, ((gdb_byte *) &pl.pl_siginfo) + offset, len);
*xfered_len = len;
- return TARGET_XFER_OK;
+ return len == 0 ? TARGET_XFER_EOF : TARGET_XFER_OK;
}
#endif
#ifdef KERN_PROC_AUXV
--
2.21.0
More information about the Gdb-patches
mailing list