From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22502 invoked by alias); 12 Apr 2005 19:05:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22471 invoked from network); 12 Apr 2005 19:04:56 -0000 Received: from unknown (HELO smtp.ecoscentric.com) (194.153.168.165) by sourceware.org with SMTP; 12 Apr 2005 19:04:56 -0000 Received: by smtp.ecoscentric.com (Postfix, from userid 99) id D815C65C0BA; Tue, 12 Apr 2005 20:04:55 +0100 (BST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by smtp.ecoscentric.com (Postfix) with ESMTP id 5BE1A65C057 for ; Tue, 12 Apr 2005 20:04:55 +0100 (BST) Message-ID: <425C1BD6.6020105@eCosCentric.com> Date: Tue, 12 Apr 2005 19:05:00 -0000 From: Jonathan Larmour User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: SH simulator build fix Content-Type: multipart/mixed; boundary="------------040307050902010701010803" X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on norbert.ecoscentric.com X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,UPPERCASE_25_50 autolearn=no version=2.63 X-SW-Source: 2005-04/txt/msg00100.txt.bz2 This is a multi-part message in MIME format. --------------040307050902010701010803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 855 The SH simulator doesn't build on slightly older GCC. gencode.c relies on the C99 ability (like C++) to define variables after code in a function. So for example it would generate source code in code.c like: case 37: { { RAISE_EXCEPTION_IF_IN_DELAY_SLOT (); int i; where RAISE_EXCEPTION_IF_IN_DELAY_SLOT is: #define RAISE_EXCEPTION_IF_IN_DELAY_SLOT() \ if (in_delay_slot) RAISE_EXCEPTION (SIGILL) Fortunately the fix is trivial, and attached! 2005-04-12 Jonathan Larmour * gencode.c (tab): Avoid inserting code before variables all declared. I have CVS write access to src, so I can do the check-in assuming that's easier. Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine --------------040307050902010701010803 Content-Type: text/x-patch; name="gdb-6.3-shsim.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-6.3-shsim.patch" Content-length: 1716 diff -ur gdb-6.3/sim/sh/gencode.c gdb-6.3x/sim/sh/gencode.c --- gdb-6.3/sim/sh/gencode.c 2004-09-08 10:11:50.000000000 +0100 +++ gdb-6.3x/sim/sh/gencode.c 2005-04-12 19:44:42.141676053 +0100 @@ -102,8 +102,8 @@ { "", "n", "bit32 #imm3,@(disp12,)", "0011nnnni8*11001", "/* 32-bit logical bit-manipulation instructions. */", - "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "int word2 = RIAT (nip);", + "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "i >>= 4; /* BOGUS: Using only three bits of 'i'. */", "/* MSB of 'i' must be zero. */", "if (i > 7)", @@ -238,9 +238,9 @@ "saved_state.asregs.regstack[bankn].regs[regn] = R0;", }, { "", "", "resbank", "0000000001011011", + "int i;", "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", /* FIXME: cdef all */ - "int i;", "if (BO) { /* Bank Overflow */", /* FIXME: how do we know when to reset BO? */ " for (i = 0; i <= 14; i++) {", @@ -587,8 +587,8 @@ " and mov.bwl , @(disp12,)", " and mov.bwl @(disp12,),", " and movu.bw @(disp12,),. */", - "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "int word2 = RIAT (nip);", + "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "SET_NIP (nip + 2); /* Consume 2 more bytes. */", "MA (1);", "do_long_move_insn (word2 & 0xf000, word2 & 0x0fff, m, n, &thislock);", @@ -1493,8 +1493,8 @@ }, { "0", "", "trapa #", "11000011i8*1....", - "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "long imm = 0xff & i;", + "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "if (i < 20 || i == 33 || i == 34 || i == 0xc3)", " nip += trap (i, &R0, PC, memory, maskl, maskw, endianw);", #if 0 --------------040307050902010701010803--