From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17946 invoked by alias); 26 Nov 2011 20:51:33 -0000 Received: (qmail 17938 invoked by uid 22791); 26 Nov 2011 20:51:32 -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:51:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 879662BB1AB; Sat, 26 Nov 2011 15:51:17 -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 ZgiGwgefZxO6; Sat, 26 Nov 2011 15:51:17 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4F25B2BB1A3; Sat, 26 Nov 2011 15:51:17 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E301A145615; Sat, 26 Nov 2011 15:51:07 -0500 (EST) Date: Sat, 26 Nov 2011 20:51: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: <20111126205107.GB24943@adacore.com> References: <20111126.143855.1966723588620210024.davem@davemloft.net> <20111126201404.GA24943@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20111126201404.GA24943@adacore.com> 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/msg00716.txt.bz2 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 217 > gdb/ChangeLog: > > * remote.c (remote_get_tracepoint_status): Delete addrbuf > local variable. Avoid use of sprintf_vma. Lucky me I didn't delete the patch before David called me on it! -- Joel --LQksG6bCIzRHxTLp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="remote.c.diff" Content-length: 1368 diff --git a/gdb/remote.c b/gdb/remote.c index 8fa5c1a..21561e5 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -10219,7 +10219,6 @@ remote_get_tracepoint_status (struct breakpoint *bp, struct uploaded_tp *utp) { struct remote_state *rs = get_remote_state (); - char addrbuf[40]; char *reply; struct bp_location *loc; struct tracepoint *tp = (struct tracepoint *) bp; @@ -10234,8 +10233,9 @@ remote_get_tracepoint_status (struct breakpoint *bp, any status. */ if (tp->number_on_target == 0) continue; - sprintf_vma (addrbuf, loc->address); - sprintf (rs->buf, "qTP:%x:%s", tp->number_on_target, addrbuf); + sprintf (rs->buf, "qTP:%x:%s", tp->number_on_target, + phex_nz (loc->address, + gdbarch_addr_bit (target_gdbarch) / 8)); putpkt (rs->buf); reply = remote_get_noisy_reply (&target_buf, &target_buf_size); if (reply && *reply) @@ -10249,8 +10249,7 @@ remote_get_tracepoint_status (struct breakpoint *bp, { utp->hit_count = 0; utp->traceframe_usage = 0; - sprintf_vma (addrbuf, (long unsigned int) utp->addr); - sprintf (rs->buf, "qTP:%x:%s", utp->number, addrbuf); + sprintf (rs->buf, "qTP:%x:%s", utp->number, phex_nz (utp->addr, 0)); putpkt (rs->buf); reply = remote_get_noisy_reply (&target_buf, &target_buf_size); if (reply && *reply) --LQksG6bCIzRHxTLp--