public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Add unlink support to moxie simulator
Date: Mon, 16 Dec 2019 15:42:00 -0000	[thread overview]
Message-ID: <fb46334198d8d4f82133033758cb75f086d864ad@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT fb46334198d8d4f82133033758cb75f086d864ad ***

commit fb46334198d8d4f82133033758cb75f086d864ad
Author:     Anthony Green <green@moxielogic.com>
AuthorDate: Sat Dec 14 05:23:20 2019 -0500
Commit:     Anthony Green <green@moxielogic.com>
CommitDate: Sat Dec 14 05:33:39 2019 -0500

    Add unlink support to moxie simulator
    
    This change adds support for the unlink system call, which is
    required by the GCC testsuite.  It also switches read/write/open
    system calls to use the sim_io_* functions.
    
    2019-12-14  Anthony Green  <green@moxielogic.com>
    
            * interp.c (sim_engine_run): Make use of sim_io_* functions for
            read/write/open system calls.  Implement the unlink system call.

diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog
index 86fb334108..9f21b3c90e 100644
--- a/sim/moxie/ChangeLog
+++ b/sim/moxie/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-14  Anthony Green  <green@moxielogic.com>
+
+	* interp.c (sim_engine_run): Make use of sim_io_* functions for
+	read/write/open system calls.  Implement the unlink system call.
+
 2017-09-06  John Baldwin  <jhb@FreeBSD.org>
 
 	* configure: Regenerate.
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index ecea5b42f3..fe770093e5 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -32,6 +32,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-main.h"
 #include "sim-base.h"
 #include "sim-options.h"
+#include "sim-io.h"
 
 typedef int word;
 typedef unsigned int uword;
@@ -942,9 +943,10 @@ sim_engine_run (SIM_DESC sd,
 		      char fname[1024];
 		      int mode = (int) convert_target_flags ((unsigned) cpu.asregs.regs[3]);
 		      int perm = (int) cpu.asregs.regs[4];
-		      int fd = open (fname, mode, perm);
+		      int fd;
 		      sim_core_read_buffer (sd, scpu, read_map, fname,
 					    cpu.asregs.regs[2], 1024);
+		      fd = sim_io_open (sd, fname, mode);
 		      /* FIXME - set errno */
 		      cpu.asregs.regs[2] = fd;
 		      break;
@@ -954,7 +956,7 @@ sim_engine_run (SIM_DESC sd,
 		      int fd = cpu.asregs.regs[2];
 		      unsigned len = (unsigned) cpu.asregs.regs[4];
 		      char *buf = malloc (len);
-		      cpu.asregs.regs[2] = read (fd, buf, len);
+		      cpu.asregs.regs[2] = sim_io_read (sd, fd, buf, len);
 		      sim_core_write_buffer (sd, scpu, write_map, buf,
 					     cpu.asregs.regs[3], len);
 		      free (buf);
@@ -968,11 +970,22 @@ sim_engine_run (SIM_DESC sd,
 		      str = malloc (len);
 		      sim_core_read_buffer (sd, scpu, read_map, str,
 					    cpu.asregs.regs[3], len);
-		      count = write (cpu.asregs.regs[2], str, len);
+		      count = sim_io_write (sd, cpu.asregs.regs[2], str, len);
 		      free (str);
 		      cpu.asregs.regs[2] = count;
 		      break;
 		    }
+		  case 0x7: /* SYS_unlink */
+		    {
+		      char fname[1024];
+		      int fd;
+		      sim_core_read_buffer (sd, scpu, read_map, fname,
+					    cpu.asregs.regs[2], 1024);
+		      fd = sim_io_unlink (sd, fname);
+		      /* FIXME - set errno */
+		      cpu.asregs.regs[2] = fd;
+		      break;
+		    }
 		  case 0xffffffff: /* Linux System Call */
 		    {
 		      unsigned int handler = cpu.asregs.sregs[1];


             reply	other threads:[~2019-12-16 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 15:42 gdb-buildbot [this message]
2019-12-16 15:25 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2019-12-16 16:00 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-18  3:44 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-12-18  3:44 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-18  4:02 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-18  4:04 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-18  4:14 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-18  4:42 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-18  4:51 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-12-18  6:10 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=fb46334198d8d4f82133033758cb75f086d864ad@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /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).