Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Masao Uebayashi <uebayasi@gmail.com>
To: cgd@google.com
Cc: gdb@sourceware.org
Subject: Re: mips sim syscall
Date: Fri, 06 Jun 2008 10:23:00 -0000	[thread overview]
Message-ID: <20080606.192335.58006236.uebayasi@gmail.com> (raw)
In-Reply-To: <2e7be40c0806060007n1a237cbfya34c58208a57add1@mail.gmail.com>

Thanks for the reply.

My intention at the moment is to run GCC testsuite in cross manner.
I'll visit to fix ld.elf_so for NetBSD/mips N32 support later. :)

On NetBSD (and probably other *nixes) syscall number is put in V0
rather than exception vector offset.  I cheated the `reason' parameter
to bet set the correct syscall number.  I could kind of run a simplest
program calling _exit() implicitly with this patch.

(I'll look further to run GDB testsuite next Monday.)

Masao

Index: gnu/dist/gdb/sim/mips/interp.c
===================================================================
RCS file: /cvsroot/seil3/src/gnu/dist/gdb/sim/mips/interp.c,v
retrieving revision 1.2
diff -u -d -r1.2 interp.c
--- gnu/dist/gdb/sim/mips/interp.c	9 Dec 2007 12:40:27 -0000	1.2
+++ gnu/dist/gdb/sim/mips/interp.c	6 Jun 2008 10:17:52 -0000
@@ -699,10 +699,18 @@
       sim_write (sd, 0x80000000, (char *) halt, sizeof (halt));
       sim_write (sd, 0x80000180, (char *) halt, sizeof (halt));
       sim_write (sd, 0x80000200, (char *) halt, sizeof (halt));
+/*
+ * XXXNETBSD
+ * http://www.cygwin.com/ml/gdb-patches/2002-04/msg00604.html
+ */
+#if 0
+      /* This is wrong.  We're not supposed to write code to the
+	 vector tables, but rather pointers to code.  */
       /* XXX: Write here unconditionally? */
       sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
       sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
       sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));
+#endif
     }
   }
 
@@ -1219,6 +1227,7 @@
 	break;
       }
 
+    case 1: /* void exit() */
     case 17: /* void _exit() */
       {
 	sim_io_eprintf (sd, "sim_monitor(17): _exit(int reason) to be coded\n");
@@ -1716,7 +1725,12 @@
           perform this magic. */
        if ((instruction & RSVD_INSTRUCTION_MASK) == RSVD_INSTRUCTION)
 	 {
+/* XXXNETBSD */
+#if 0
 	   int reason = (instruction >> RSVD_INSTRUCTION_ARG_SHIFT) & RSVD_INSTRUCTION_ARG_MASK;
+#else
+	   int reason = V0 << 1;
+#endif
 	   if (!sim_monitor (SD, CPU, cia, reason))
 	     sim_io_error (sd, "sim_monitor: unhandled reason = %d, pc = 0x%s\n", reason, pr_addr (cia));
 


  reply	other threads:[~2008-06-06 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  6:20 Masao Uebayashi
2008-06-06  7:08 ` Chris Demetriou
2008-06-06 10:23   ` Masao Uebayashi [this message]
2008-06-06 17:13     ` David Daney
2008-06-11  1:14       ` Masao Uebayashi
2008-06-11 16:27         ` David Daney

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=20080606.192335.58006236.uebayasi@gmail.com \
    --to=uebayasi@gmail.com \
    --cc=cgd@google.com \
    --cc=gdb@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