This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Do not clear the value of st_dev in File I/O's stat()
- From: Julio Guerra <julio at farjump dot io>
- To: gdb-patches at sourceware dot org <gdb-patches at sourceware dot org>
- Cc: Pedro Alves <palves at redhat dot com>, Julio Guerra <julio at farjump dot io>
- Date: Thu, 17 May 2018 08:28:00 +0000
- Subject: [PATCH] Do not clear the value of st_dev in File I/O's stat()
- Feedback-id: 1.eu-west-1.b24dn6frgCi6dh20skzbuMRr7UL8M6Soir/3ogtEjHQ=:AmazonSES
- References: <20180517082631.26855-1-julio@farjump.io>
Do not clear the value of st_dev in the fileio stat structure sent to the
target. It prevents from being able to check the file type on the target.
Note that the fileio function fstat `remote_fileio_func_fstat()` doesn't clear
this field.
2018-05-16 Julio Guerra <julio@farjump.io>
* remote-fileio.c: do not clear the value of st_dev in File I/O's stat().
Signed-off-by: Julio Guerra <julio@farjump.io>
---
gdb/ChangeLog | 4 ++++
gdb/remote-fileio.c | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7217be67b6..34e7995e5a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-16 Julio Guerra <julio@farjump.io>
+
+ * remote-fileio.c: do not clear the value of st_dev in File I/O's stat().
+
2018-05-16 Julio Guerra <julio@farjump.io>
* remote-fileio.c: allow using File I/O function open() with special
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index fa3cb15033..e855c682a0 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -870,7 +870,6 @@ remote_fileio_func_stat (char *buf)
if (statptr)
{
host_to_fileio_stat (&st, &fst);
- host_to_fileio_uint (0, fst.fst_dev);
errno = target_write_memory (statptr, (gdb_byte *) &fst, sizeof fst);
if (errno != 0)
--
2.17.0