From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12324 invoked by alias); 6 Jun 2008 10:23:57 -0000 Received: (qmail 12315 invoked by uid 22791); 6 Jun 2008 10:23:57 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.246) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jun 2008 10:23:31 +0000 Received: by rv-out-0708.google.com with SMTP id b17so1045403rvf.48 for ; Fri, 06 Jun 2008 03:23:30 -0700 (PDT) Received: by 10.141.18.14 with SMTP id v14mr1605565rvi.125.1212747810205; Fri, 06 Jun 2008 03:23:30 -0700 (PDT) Received: from localhost ( [202.232.30.196]) by mx.google.com with ESMTPS id l31sm6970503rvb.6.2008.06.06.03.23.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Jun 2008 03:23:29 -0700 (PDT) Date: Fri, 06 Jun 2008 10:23:00 -0000 Message-Id: <20080606.192335.58006236.uebayasi@gmail.com> To: cgd@google.com Cc: gdb@sourceware.org Subject: Re: mips sim syscall From: Masao Uebayashi In-Reply-To: <2e7be40c0806060007n1a237cbfya34c58208a57add1@mail.gmail.com> References: <20080606.152013.212798583.uebayasi@gmail.com> <2e7be40c0806060007n1a237cbfya34c58208a57add1@mail.gmail.com> X-Mailer: Mew version 5.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00041.txt.bz2 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));