From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128542 invoked by alias); 8 Jun 2017 20:27:04 -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 127495 invoked by uid 89); 8 Jun 2017 20:27:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Jun 2017 20:27:02 +0000 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 535E451E614F2; Thu, 8 Jun 2017 21:27:00 +0100 (IST) Received: from [10.20.78.160] (10.20.78.160) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Thu, 8 Jun 2017 21:27:03 +0100 Date: Thu, 08 Jun 2017 20:27:00 -0000 From: "Maciej W. Rozycki" To: Alan Hayward CC: Yao Qi , "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (4/4) In-Reply-To: <434A7317-C19A-4B53-8CB1-C7B4ACEC7D17@arm.com> Message-ID: References: <3C00280E-37C9-4C0A-9DA6-F3B9DB1A6E8F@arm.com> <86y3v7uf9j.fsf@gmail.com> <0150DDF9-6204-4F4F-99E9-D757C1DBD512@arm.com> <434A7317-C19A-4B53-8CB1-C7B4ACEC7D17@arm.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2017-06/txt/msg00218.txt.bz2 On Wed, 7 Jun 2017, Alan Hayward wrote: > I don't have a MIPS machine to test on. I could schedule a test run over the coming weekend, however your change applies to EABI support, which I believe is long dead (as in: nobody uses it). Consequently I don't have a way to test with an EABI target either. > diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c > index 82f91ba2cd950c5f48f8f408f645ea49e952ef29..52d2ca134f8d14f54c6f4e450c84597c4d6a0e0e 100644 > --- a/gdb/mips-tdep.c > +++ b/gdb/mips-tdep.c > @@ -4528,7 +4528,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (argnum = 0; argnum < nargs; argnum++) > { > const gdb_byte *val; > - gdb_byte valbuf[MAX_REGISTER_SIZE]; > + gdb_byte valbuf[8]; > struct value *arg = args[argnum]; > struct type *arg_type = check_typedef (value_type (arg)); > int len = TYPE_LENGTH (arg_type); If you need to get rid of MAX_REGISTER_SIZE here (what was reason again?), then why not simply use `regsize' instead as the array size? AFAICS `valbuf' is only written once, with the size of data requested specified exactly as `regsize'. The only explanation I have been able to come up with as to why MAX_REGISTER_SIZE has been chosen for `valbuf' allocation is it was made before we could assume variable-length automatic array support. > @@ -4544,6 +4544,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > if (len > regsize > && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) > { > + gdb_assert (regsize <= 8); > store_unsigned_integer (valbuf, regsize, byte_order, > value_address (arg)); > typecode = TYPE_CODE_PTR; You obviously don't need the assertion then. Maciej