From patchwork Tue Apr 4 10:13:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 19814 Received: (qmail 46459 invoked by alias); 4 Apr 2017 10:13:41 -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 46432 invoked by uid 89); 4 Apr 2017 10:13:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=6777 X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20073.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 10:13:39 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0102.eurprd08.prod.outlook.com (10.160.211.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Tue, 4 Apr 2017 10:13:37 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::5931:f431:f97d:943d]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::5931:f431:f97d:943d%16]) with mapi id 15.01.1005.018; Tue, 4 Apr 2017 10:13:37 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE Date: Tue, 4 Apr 2017 10:13:37 +0000 Message-ID: <15D6C0CC-388D-4C9D-AC2F-5A924908D09F@arm.com> authentication-results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-microsoft-exchange-diagnostics: 1; AM3PR08MB0102; 7:J+7Rv1cdamlOZz/Jnhp6nchJcMxMzWzymFTb21iyAyB+vyJ47ObqQdVSi44FbsJk5mzA2IulSTT8hBPcqAs4cWhq1O44noxWEvVJsMdobATNtcCAyqrQsuJlSgWiKDCtCE2Dq0qJvxWToEu1h7Hgk/Y4fkXBLoAPRe4VifwSmaPYM71O/n4vIDKsPRdVhFqTTGCEx215qagjhL/aFx+eLZyeXJ1kSwexIZnVOdzAOn1gh6AsvWdEyBZvjynrVoZUGncW3Ow9Yap1/lru0rDv2Y72c6JaSJOB4G8MoEX6q1tMSF2V8ENlHYNB8lZx/0mLt9pNE0Cruo7ftSUQ822j+A==; 20:/3byG8HPJM4ZRuVART3qaF026hGNg3b5V7q/KkoC2VcO0lSwcIRdbPQ8ma3bu901InoRXg2eILRTmYeWh+Yh7cnN24ywQptVGfWhQfAJ1b1pys8rIlbMi+avkEY3PP42d0soU4KoRutDkXaa7Bw1OTVXty2X2cTidnmyzRiEewo= x-ms-office365-filtering-correlation-id: 9722bf99-9505-4278-5085-08d47b434259 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:AM3PR08MB0102; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:AM3PR08MB0102; BCL:0; PCL:0; RULEID:; SRVR:AM3PR08MB0102; x-forefront-prvs: 0267E514F9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39860400002)(39450400003)(39850400002)(39400400002)(39840400002)(377424004)(8936002)(2351001)(4326008)(81166006)(8676002)(25786009)(6916009)(5250100002)(575784001)(2906002)(86362001)(50986999)(33656002)(2900100001)(54356999)(189998001)(3660700001)(3846002)(110136004)(38730400002)(6486002)(83716003)(6506006)(66066001)(36756003)(7736002)(99286003)(5660300001)(5640700003)(82746002)(6436002)(53936002)(6116002)(305945005)(3280700002)(6512007)(102836003)(2501003)(15760500002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0102; H:AM3PR08MB0101.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <8FE4F08ECD1DFA45B44D181FE82956CE@eurprd08.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2017 10:13:37.1456 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0102 Max size set to 32bits, which I determined using regformats/reg-m32r.dat Tested on a --enable-targets=all build using make check with board files unix and native-gdbserver. I do not have an M32R machine to test on. Ok to commit? Alan. 2017-04-04 Alan Hayward * m32r-tdep.c (m32r_push_dummy_call): Use M32R_MAX_REGISTER_SIZE. * m32r-tdep.h (M32R_MAX_REGISTER_SIZE): Add. diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h index 102cccecd200b7c192ade124a2fb9d9c59bdb5dd..037fd8965a7c01bd8c3ec0d1eb4a49a70d4478e6 100644 --- a/gdb/m32r-tdep.h +++ b/gdb/m32r-tdep.h @@ -47,4 +47,7 @@ enum m32r_regnum #define M32R_NUM_REGS 25 +/* Big enough to hold the size of the largest register in bytes. */ +#define M32R_MAX_REGISTER_SIZE 4 + #endif /* m32r-tdep.h */ diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 40f29d343b91f254cce2dd783553795c9c990eff..cb53a352b2d47068ad7cd5dacd3325d66bd77964 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -677,7 +677,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum type_code typecode; CORE_ADDR regval; gdb_byte *val; - gdb_byte valbuf[MAX_REGISTER_SIZE]; + gdb_byte valbuf[M32R_MAX_REGISTER_SIZE]; int len; /* First force sp to a 4-byte alignment. */