From patchwork Thu Feb 19 10:52:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amrita Honap X-Patchwork-Id: 5168 Received: (qmail 20669 invoked by alias); 19 Feb 2015 10:52:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20651 invoked by uid 89); 19 Feb 2015 10:52:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_05, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: APAC01-SG1-obe.outbound.protection.outlook.com Received: from mail-sg1on0085.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) (134.170.132.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Thu, 19 Feb 2015 10:52:51 +0000 Received: from SG2PR03MB0730.apcprd03.prod.outlook.com (25.161.10.144) by SG2PR03MB0731.apcprd03.prod.outlook.com (25.161.10.145) with Microsoft SMTP Server (TLS) id 15.1.87.18; Thu, 19 Feb 2015 10:52:46 +0000 Received: from SG2PR03MB0730.apcprd03.prod.outlook.com ([25.161.10.144]) by SG2PR03MB0730.apcprd03.prod.outlook.com ([25.161.10.144]) with mapi id 15.01.0093.004; Thu, 19 Feb 2015 10:52:46 +0000 From: Amrita Honap To: "gdb-patches@sourceware.org" Subject: [PATCH RL78]:Fix offset for mem_get_si in sim Date: Thu, 19 Feb 2015 10:52:46 +0000 Message-ID: authentication-results: sourceware.org; dkim=none (message not signed) header.d=none; x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:SG2PR03MB0731; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:; SRVR:SG2PR03MB0731; x-forefront-prvs: 0492FD61DD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(377424004)(74316001)(2656002)(92566002)(19580395003)(19580405001)(87936001)(33656002)(450100001)(110136001)(229853001)(107886001)(77156002)(62966003)(2351001)(102836002)(54356999)(46102003)(40100003)(86362001)(122556002)(2900100001)(50986999)(76576001)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:SG2PR03MB0731; H:SG2PR03MB0730.apcprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: kpit.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2015 10:52:46.0455 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3539451e-b46e-4a26-a242-ff61502855c7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR03MB0731 Hi, The following patch fixes the handling of the offset that is generated for the mem_get_si. The mem_get_si reads the 0th,1st and 2nd byte correctly and fails on the 3rd byte, where it is again reading the 2nd byte. This patch should fix this problem. Regards, Amrita Honap =========================End Of Patch================================ Apologies for any company disclaimer that may get added to this e-mail. =======================Start of Patch================================ Changelog 2015-02-19 Amrita Honap * rl78/mem.c (mem_get_si) : Fix offset for mem_get_si diff -rNup src/gdb-7.8.2/sim/rl78/mem.c.orig src/gdb-7.8.2/sim/rl78/mem.c --- src/gdb-7.8.2/sim/rl78/mem.c.orig 2015-02-19 16:01:39.199243028 +0530 +++ src/gdb-7.8.2/sim/rl78/mem.c 2015-02-19 15:56:14.891262201 +0530 @@ -435,7 +435,7 @@ mem_get_si (int address) v = mem_get_byte (address) | mem_get_byte (address + 1) * 256 | mem_get_byte (address + 2) * 65536 - | mem_get_byte (address + 2) * 16777216; + | mem_get_byte (address + 3) * 16777216; CHECK_ALIGNMENT (address, v, 3); tprintf ("(\033[35m[%05X]->%04X)\033[0m", address, v); return v;