From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2475 invoked by alias); 30 Dec 2014 13:47:16 -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 2412 invoked by uid 89); 30 Dec 2014 13:47:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Dec 2014 13:47:13 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Y5x8g-0002t4-89 from Yao_Qi@mentor.com ; Tue, 30 Dec 2014 05:47:10 -0800 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Tue, 30 Dec 2014 05:47:09 -0800 From: Yao Qi To: Pedro Alves CC: Subject: Re: [PATCH] Clear upper bits during sign extension References: <1419815569-21854-1-git-send-email-yao@codesourcery.com> <54A13184.1070902@redhat.com> <874msdwl39.fsf@codesourcery.com> <54A29886.8030603@redhat.com> Date: Tue, 30 Dec 2014 13:47:00 -0000 In-Reply-To: <54A29886.8030603@redhat.com> (Pedro Alves's message of "Tue, 30 Dec 2014 12:20:22 +0000") Message-ID: <87vbktuu5p.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00682.txt.bz2 Pedro Alves writes: > So I think we should either explicitly always clear bits above TYPE_LENGTH > after value_as_address, with a comment mentioning that we don't want > any magic bits that gdbarch_pointer_to_address would give us, > or, given we know the value is really an offset, simply extract the value > that way. Like in the patch below: The latter is fine to me. > + byte_order =3D gdbarch_byte_order (get_type_arch (type)); How about getting gdbarch via get_frame_arch (frame)? How about removing gdb_sign_extend as it is no longer used? I'll post a full version on top of yours. --=20 Yao (=E9=BD=90=E5=B0=A7)