From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23332 invoked by alias); 21 Feb 2011 14:30:20 -0000 Received: (qmail 23256 invoked by uid 22791); 21 Feb 2011 14:30:18 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Feb 2011 14:30:09 +0000 Received: by qwd7 with SMTP id 7so2021012qwd.0 for ; Mon, 21 Feb 2011 06:30:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.73.193 with SMTP id r1mr1160343qaj.167.1298298607217; Mon, 21 Feb 2011 06:30:07 -0800 (PST) Received: by 10.229.214.131 with HTTP; Mon, 21 Feb 2011 06:30:07 -0800 (PST) In-Reply-To: <-6930711422310680743@unknownmsgid> References: <-8460070221060995487@unknownmsgid> <-6930711422310680743@unknownmsgid> Date: Mon, 21 Feb 2011 14:30:00 -0000 Message-ID: Subject: Re: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header From: Kai Tietz To: Pierre Muller Cc: GCC Patches , Binutils , gdb , Jakub Jelinek , Joel Brobecker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00256.txt.bz2 2011/2/21 Pierre Muller : >> Yes, I saw this too and it is a thorn here. But the issue about a >> transformation function (like dwarf_vma) is that we have memory leaks >> - as this function is to be used on some printf's more then once - as >> static buffer would be overriden. Well printfs can be splitted into >> smaller parts, but this then would make localization even harder. > > =A0In GDB code, this is solved in utils.c source by the use of the > get_cell function, which rotates over 16 char arrays of size 50 each > currently, in dwarf.c 4 arrays of 16 char (as long as longest address is > 64-bit) > for this dwarf_vma function would probably be enough, no? > > > Pierre Muller > GDB pascal language maintainer Yes, this sounds ok. I think maximum here are right now 3 dwarf_vma prints within one printf. So it should be ok. I'll add here such a rotating function. I don't assume we need here to handle multi-threading, so rotation code can be pretty simple. Kai