From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22571 invoked by alias); 19 Feb 2013 14:52:05 -0000 Received: (qmail 22541 invoked by uid 22791); 19 Feb 2013 14:52:04 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Feb 2013 14:52:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0DCA82E397; Tue, 19 Feb 2013 09:52:00 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1-WSdZWT1L4C; Tue, 19 Feb 2013 09:51:59 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D134E2E2DE; Tue, 19 Feb 2013 09:51:59 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 34E47C3465; Tue, 19 Feb 2013 06:51:58 -0800 (PST) Date: Tue, 19 Feb 2013 14:52:00 -0000 From: Joel Brobecker To: Kai Tietz Cc: gdb Subject: Re: [patch gdb]: Fix display for LLP64 target in window-nat.c Message-ID: <20130219145158.GA29938@adacore.com> References: <20130219141635.GK22175@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130219141635.GK22175@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00076.txt.bz2 > You should use %s & host_address_to_string instead of %p & > the various casts. So the following should work: > > DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%s\n", > len, host_address_to_string (memaddr))); > > OK with that change. Actually, I was confused. Sorry. Try either core_addr_to_string_nz (or core_addr_to_string if you want leading zeros)... > > > Index: windows-nat.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/windows-nat.c,v > > retrieving revision 1.238 > > diff -p -u -r1.238 windows-nat.c > > --- windows-nat.c 1 Jan 2013 06:41:29 -0000 1.238 > > +++ windows-nat.c 19 Feb 2013 14:05:20 -0000 > > @@ -2312,8 +2312,8 @@ windows_xfer_memory (CORE_ADDR memaddr, > > SIZE_T done = 0; > > if (write) > > { > > - DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08lx\n", > > - len, (DWORD) (uintptr_t) memaddr)); > > + DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%p\n", > > + len, (LPVOID) (uintptr_t) memaddr)); > > if (!WriteProcessMemory (current_process_handle, > > (LPVOID) (uintptr_t) memaddr, our, > > len, &done)) > > @@ -2323,8 +2323,8 @@ windows_xfer_memory (CORE_ADDR memaddr, > > } > > else > > { > > - DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08lx\n", > > - len, (DWORD) (uintptr_t) memaddr)); > > + DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%p\n", > > + len, (LPVOID) (uintptr_t) memaddr)); > > if (!ReadProcessMemory (current_process_handle, > > (LPCVOID) (uintptr_t) memaddr, our, > > len, &done)) > > -- > Joel -- Joel