From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18823 invoked by alias); 26 Nov 2011 20:14:31 -0000 Received: (qmail 18794 invoked by uid 22791); 26 Nov 2011 20:14:28 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_DR 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; Sat, 26 Nov 2011 20:14:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 817622BB370; Sat, 26 Nov 2011 15:14:14 -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 cbCKT7eifznX; Sat, 26 Nov 2011 15:14:14 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3245D2BB2B1; Sat, 26 Nov 2011 15:14:14 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 0AF7C145615; Sat, 26 Nov 2011 15:14:05 -0500 (EST) Date: Sat, 26 Nov 2011 20:14:00 -0000 From: Joel Brobecker To: David Miller , stan@codesourcery.com Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix build on sparc (remote.c/tracepoints) Message-ID: <20111126201404.GA24943@adacore.com> References: <20111126.143855.1966723588620210024.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111126.143855.1966723588620210024.davem@davemloft.net> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2011-11/txt/msg00713.txt.bz2 > sprintf_vma() expands to a printf format string appropriate for > a bfd_vma type, so the only proper cast is to that exact type. Actually, I think the problem in this case comes from the fact that we're calling sprintf_vma with a ULONGEST. What we probably want is to use phex (or phex_nz). Attached is a patch that implements that, but only tested as far as compiling goes. I don't have time to test it. I decided to use phex_nz instead of phex, because I don't think we need the leading zeros and it seems we're trying to avoid increasing the size of the packets unnecessarily (probably for slow links). Similarly, for loc->address value, I used phex_nz instead of paddr because that's what we already do elsewhere, and avoids the use of the leading "0x" prefix. gdb/ChangeLog: * remote.c (remote_get_tracepoint_status): Delete addrbuf local variable. Avoid use of sprintf_vma. PS: It looks like we're using sprintf_vma everywhere else for printing breakpoint location addresses, and I thought that we should change them as well. Except that CORE_ADDR is a typedef of bfd_vma, so I guess that's OK. So maybe we shouldn't commit the first half of my patch, as it avoids the use of target_gdbarch, which always makes me uncomfortable. But on the other hand, we avoid the use of that local bounded buffer. Stan's choice. -- Joel