public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Julio Guerra" <julio@farjump.io>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "Pedro Alves" <palves@redhat.com>, "Julio Guerra" <julio@farjump.io>
Subject: [PATCH] Do not clear the value of st_dev in File I/O's stat()
Date: Thu, 17 May 2018 10:32:00 -0000	[thread overview]
Message-ID: <010201636d368a34-7edcde92-3661-4c9a-94b4-a894b9c8e90a-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <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


       reply	other threads:[~2018-05-17  8:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180517082631.26855-1-julio@farjump.io>
2018-05-17 10:32 ` Julio Guerra [this message]
2018-05-17 15:31   ` Pedro Alves
     [not found]     ` <496efebf-0f96-4586-de39-0a1857994f04@farjump.io>
2018-05-18 18:29       ` Julio Guerra
2018-05-28 10:50     ` Corinna Vinschen
     [not found]       ` <6f5980ae-247c-1991-ba3c-884fe04a94c5@farjump.io>
2018-05-28 12:49         ` Julio Guerra
2018-05-28 13:18           ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010201636d368a34-7edcde92-3661-4c9a-94b4-a894b9c8e90a-000000@eu-west-1.amazonses.com \
    --to=julio@farjump.io \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).