From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway23.websitewelcome.com (gateway23.websitewelcome.com [192.185.50.119]) by sourceware.org (Postfix) with ESMTPS id 68C6E3871029 for ; Mon, 16 Mar 2020 13:25:44 +0000 (GMT) Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 9564B104CE for ; Mon, 16 Mar 2020 08:25:43 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DpkTjBFLQAGTXDpkUjbnv7; Mon, 16 Mar 2020 08:25:43 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kpjfm75ByjE91DxaYcP154X7wHCPLw8q8qTZHvyOlK4=; b=HjcYQs9NG1RVn7XhR290w6fi7n cesLJ5fzUnwgK0V21p7Q08un48OMxbeU7jAlsinckAC8YGlVkwMZJbjmb2nFe1x9B/+TP7CkbrOCW eEwghhdHSo4GMqCer/audDXqH; Received: from 184-96-250-69.hlrn.qwest.net ([184.96.250.69]:41284 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jDpkS-001ePL-Ss; Mon, 16 Mar 2020 07:25:40 -0600 From: Tom Tromey To: Kamil Rytarowski Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Correct decoding AUXV on NetBSD References: <20200314182258.4277-1-n54@gmx.com> X-Attribution: Tom Date: Mon, 16 Mar 2020 07:25:40 -0600 In-Reply-To: <20200314182258.4277-1-n54@gmx.com> (Kamil Rytarowski's message of "Sat, 14 Mar 2020 19:22:58 +0100") Message-ID: <8736a88m97.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 184.96.250.69 X-Source-L: No X-Exim-ID: 1jDpkS-001ePL-Ss X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 184-96-250-69.hlrn.qwest.net (murgatroyd) [184.96.250.69]:41284 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=1.3 required=5.0 tests=DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * 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: Mon, 16 Mar 2020 13:25:57 -0000 >>>>> "Kamil" == Kamil Rytarowski writes: Kamil> The type field is always 32bit. The value field reflects the size of Kamil> the register/pointer. Kamil> gdb/ChangeLog: Kamil> * auxv.c (default_auxv_parse): Add new variable sizeof_auxv_type Kamil> and use it in extract_unsigned_integer(). Kamil> +#ifdef __NetBSD__ Kamil> + const int sizeof_auxv_type = sizeof(int32_t); Kamil> +#else Kamil> + const int sizeof_auxv_type = sizeof_auxv_field; Kamil> +#endif IIUC, sizeof_auxv_type describes a property of the target. That means this approach is incorrect, because it will only work for native debugging, and will do the wrong thing in other cases. If default_auxv_parse is incorrect for NetBSD, another way is to override it in the appropriate gdbarch. See target_auxv_parse. OpenBSD appears to do this, see obsd_auxv_parse. Tom