From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2091 invoked by alias); 19 Feb 2013 17:24:14 -0000 Received: (qmail 2080 invoked by uid 22791); 19 Feb 2013 17:24:13 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f174.google.com (HELO mail-ie0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Feb 2013 17:24:07 +0000 Received: by mail-ie0-f174.google.com with SMTP id k10so8633574iea.19 for ; Tue, 19 Feb 2013 09:24:06 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.196.165 with SMTP id in5mr9582575igc.99.1361294646413; Tue, 19 Feb 2013 09:24:06 -0800 (PST) Received: by 10.64.231.200 with HTTP; Tue, 19 Feb 2013 09:24:06 -0800 (PST) In-Reply-To: <83obfgp8p5.fsf@gnu.org> References: <83obfgp8p5.fsf@gnu.org> Date: Tue, 19 Feb 2013 17:24:00 -0000 Message-ID: Subject: Re: [patch gdb]: Fix display for LLP64 target in window-nat.c From: Kai Tietz To: Eli Zaretskii Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00082.txt.bz2 2013/2/19 Eli Zaretskii : >> Date: Tue, 19 Feb 2013 15:09:06 +0100 >> From: Kai Tietz >> >> this patch fixes a pointer-truncation in display on Windows LLP64 target. >> >> ChangeLog 2013-02-19 Kai Tietz >> >> * windows-nat.c (windows_xfer_memory): Fix debug-output >> for LLP64. >> >> Ok for apply? > > Isn't DWORD_PTR the right replacement for DWORD in these cases? No, CORE_ADDR is the type we want to print. DWORD_PTR is holding the width of the host-pointer, not necessarily compatible to CORE_ADDR. We want to fix pointer truncation here, not just express it different. > Actually, I don't understand what is the cast to uintptr_t doing > there, it seems redundant. Well, the issue is that CORE_ADDR might be a smaller integer-scalar as a pointer. So before casting it to a pointer you need to make integer wide-enough. Cheers, Kai