From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by sourceware.org (Postfix) with ESMTPS id 16A8D3987930 for ; Thu, 1 Oct 2020 13:30:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16A8D3987930 Received: by mail-ed1-x541.google.com with SMTP id n22so5650011edt.4 for ; Thu, 01 Oct 2020 06:30:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-description:content-disposition:in-reply-to; bh=QwiV5i6GwXkGEZow/0lOjbcezJgVW9KSeSJseVlsaTw=; b=qlvh5YlEw/41e+a70Vy3AxW7h4bJSKa89E/mIlonwbdIUKYah4HAcvO9wcOa8CaUg3 2MOK70TGZ6slrxK98nHM9NFh5tF/qZ5YtuLHPVhN6oFcTbKbb7+N9s9FkRQCLrlnJSPz ZV8efs5PvIlXyd8NK2kJzDFvooDO91tGJkHDFLbMs1vwYlY4up4KZROi962RgwVQbHUI hvutaQi8+7AU1myDeoXlaeWBk40z44N74jdy1106RqrwBi5w7Ey4PBIhJ1jiOYMn+1MX 3wZHPLINHzZHSLFCwhjOdhe9NlQsHfGw2i5Bd711w0ADe3RP8TGqLtDsj8Q6sINFWele DMyg== X-Gm-Message-State: AOAM531fa+Bv0Grl8Jzn+x6a5IU1mhGR77L53QB2iGy4Hqd6kpGsT+eD upIN2AZGpfPLWz4kRfNYA/aqy02mlZs= X-Google-Smtp-Source: ABdhPJxNLkuRXxexiBPS77c5R6oX7OpFYeu7yYxPb88fVQS+HE2x979JNdGXhqOMA20s0S2O1KTgkQ== X-Received: by 2002:a05:6402:1697:: with SMTP id a23mr8272700edv.195.1601559041215; Thu, 01 Oct 2020 06:30:41 -0700 (PDT) Received: from gmail.com ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id m6sm4188910ejb.85.2020.10.01.06.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 06:30:40 -0700 (PDT) Date: Thu, 1 Oct 2020 15:30:42 +0200 From: Shahab Vahedi To: Simon Marchi Cc: gdb-patches@sourceware.org, Shahab Vahedi , Anton Kolesov , Francois Bedard Subject: Re: [PATCH] arc: Add support for Linux coredump files Message-ID: <20201001133042.GE4717@gmail.com> References: <20200827112728.4275-1-shahab.vahedi@gmail.com> <18b98a56-e3cf-e05b-49a7-bd6e1f61aefb@simark.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: acknowledge Content-Disposition: inline In-Reply-To: <18b98a56-e3cf-e05b-49a7-bd6e1f61aefb@simark.ca> X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2020 13:30:43 -0000 Hi Simon, On Wed, Sep 16, 2020 at 04:21:43PM -0400, Simon Marchi wrote: > On 2020-08-27 7:27 a.m., Shahab Vahedi via Gdb-patches wrote: > > +void > > +arc_linux_supply_gregset (const struct regset *regset, > > + struct regcache *regcache, > > + int regnum, const void *gregs, size_t size) > > +{ > > + gdb_static_assert (ARC_LAST_REGNUM > > + <= ARRAY_SIZE (arc_linux_core_reg_offsets)); > > Can you explain why this is <= and not < ? I'm not saying it's wrong, > but it looks unusual. If ARC_LAST_REGNUM was 2 (meaning there are 3 > registers: 0, 1 and 2), then having an offsets array with size 2 would > be bad, would it? Or maybe I'm just confused. You're absolutely right! Not only this question made me fix the assert here, but also to revisit it everywhere. In the end, it resulted in finding a "for loop" that was not looping the whole data set. All have been mentioned/fixed in the next patch v2 [1]. [1] [PATCH v2] arc: Add support for Linux coredump files https://sourceware.org/pipermail/gdb-patches/2020-September/172199.html Cheers, Shahab