From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47857 invoked by alias); 4 Apr 2017 10:14:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 47750 invoked by uid 89); 4 Apr 2017 10:14:12 -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= X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0068.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 10:14:10 +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:14:09 +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:14:08 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PATCH 6/11] Add ALPHA_MAX_REGISTER_SIZE Date: Tue, 04 Apr 2017 10:14:00 -0000 Message-ID: <772F5764-0F2A-4F53-BC41-C36AF15BED21@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:hfqgejhXzfYN9D2Glr2MsVKvWZ/5+e4UIGCRqmC16bFLtd3ifw+ly1uvahH/Hnjva/lGHGLv+LaUcxgAr98on2mrCLZoC3aFsrKSTQrEejVuuFzHoa8eBTkIn/Oawju/zhyVEa1RcBgZevHoVCcrchr16DIVWpbA/ngQ8pk28dSeaCRwLTMr64eEc1tgChO5F782GJlNpmkMaxr7z0Qj6gtPaSv0IceiZYkn5aCszywq25h/kOXiNP+z29KK1QsGU67Zuo24L2O0KkqKYAaXJFt/+nJKtwuFSZfJWOi36FB8+uo51Kf2HtWDoIIsI7FNDpGdjE2t89SsdB06aDiY7A==;20:dIp1h0+sFd0AMHGaZ+ZgoMiIqVzzuvvt8BaSpcGKe8ayFz94npZ8sCxoxVOsbMNN3hz+l84qF3QYQ5fCbGqEUlvypMhKafU4MR0v0HnZR59GjR8iZadtfp7fEo2nwQnaiV6nFAsMD2QKza38iTveUqYiT/m7jn5bjBIxqMzpotY= x-ms-office365-filtering-correlation-id: 4fcc4f15-1bc1-4e79-7116-08d47b435520 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);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-Type: text/plain; charset="us-ascii" Content-ID: <785C3D351B691649B33259D0D0B5999E@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2017 10:14:08.6206 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0102 X-SW-Source: 2017-04/txt/msg00014.txt.bz2 Max size set to 64bits, which I determined using alpha_register_type() Tested on a --enable-targets=3Dall build using make check with board files unix and native-gdbserver. I do not have an ALPHA machine to test on. Ok to commit? Alan. 2017-04-04 Alan Hayward * alpha-tdep.c (alpha_register_to_value): Use ALPHA_MAX_REGISTER_SIZE (alpha_value_to_register): Likewise. * alpha-tdep.h (ALPHA_MAX_REGISTER_SIZE): Add. diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index ab46ba56bef1ffb1cea541c506ffed6a5ae9b556..316d94d0bb53e9bc7943d406bf8= 1f7d597437ff3 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -26,6 +26,9 @@ struct regcache; real way to know how big a register is. */ #define ALPHA_REGISTER_SIZE 8 +/* Big enough to hold the size of the largest register in bytes. */ +#define ALPHA_MAX_REGISTER_SIZE 8 + /* Number of machine registers. */ #define ALPHA_NUM_REGS 67 diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 4dd65c58cc2896ea6038399128e3eb376d1ee672..5a1024e8697a14963b226d275c1= 9721cb6d4e327 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -244,7 +244,7 @@ alpha_register_to_value (struct frame_info *frame, int = regnum, int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch =3D get_frame_arch (frame); - gdb_byte in[MAX_REGISTER_SIZE]; + gdb_byte in[ALPHA_MAX_REGISTER_SIZE]; /* Convert to TYPE. */ if (!get_frame_register_bytes (frame, regnum, 0, @@ -266,7 +266,7 @@ static void alpha_value_to_register (struct frame_info *frame, int regnum, struct type *valtype, const gdb_byte *in) { - gdb_byte out[MAX_REGISTER_SIZE]; + gdb_byte out[ALPHA_MAX_REGISTER_SIZE]; switch (TYPE_LENGTH (valtype)) {