From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SIP1KgXadV+9DAAAWB0awg (envelope-from ) for ; Thu, 01 Oct 2020 09:30:45 -0400 Received: by simark.ca (Postfix, from userid 112) id AB39C1EDF4; Thu, 1 Oct 2020 09:30:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FSL_HELO_FAKE,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2E36A1E965 for ; Thu, 1 Oct 2020 09:30:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81E36398B17D; Thu, 1 Oct 2020 13:30:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81E36398B17D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601559044; bh=QwiV5i6GwXkGEZow/0lOjbcezJgVW9KSeSJseVlsaTw=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=IfDAYeaFKKqs0xG70Q0fH2vu8cUNll7VOXMVTAcYNjaItCyYIV3RxzDC9dgvET123 YUk/OwwFciMLhXCnykao9eenGbNUDSaDcIn517NhUI0WN8SHn1tfcd33ybNnh/Fqa2 JOi1XBT56o6Az2mAVuGFHhA0mO8oTCLwmz1p4D+k= 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 To: Simon Marchi 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-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: , From: Shahab Vahedi via Gdb-patches Reply-To: Shahab Vahedi Cc: Anton Kolesov , Shahab Vahedi , gdb-patches@sourceware.org, Francois Bedard Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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