From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99369 invoked by alias); 6 May 2015 10:22:15 -0000 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 Received: (qmail 99322 invoked by uid 89); 6 May 2015 10:22:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 May 2015 10:22:14 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t46AMCtV031220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 6 May 2015 06:22:12 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t46AMA6S000985; Wed, 6 May 2015 06:22:11 -0400 Message-ID: <5549EB52.8090401@redhat.com> Date: Wed, 06 May 2015 10:22:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jan Kratochvil CC: gdb-patches@sourceware.org, Phil Muldoon Subject: Re: [PATCH v3 9/9] compile: compile printf: gdbserver support References: <20150411194322.29128.52477.stgit@host1.jankratochvil.net> <20150411194437.29128.58569.stgit@host1.jankratochvil.net> <20150426093318.GA6765@host1.jankratochvil.net> <5540FEA3.7050406@redhat.com> <20150503140612.GD18394@host1.jankratochvil.net> In-Reply-To: <20150503140612.GD18394@host1.jankratochvil.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg00088.txt.bz2 On 05/03/2015 03:06 PM, Jan Kratochvil wrote: > On Wed, 29 Apr 2015 17:54:11 +0200, Pedro Alves wrote: >> On 04/26/2015 10:33 AM, Jan Kratochvil wrote: >>> The only idea I have is to redirect by a breakpoint glibc's implicit calls to >>> malloc() into GDB's allocator by inferior mmap. But that seems a bit ugly. >> >> Using mmap along with snprintf would be safer, but given that snprintf is >> not async-signal-safe in general either, it's fine with me to leave this >> as you have it. > > OK, snprintf into mmap()ped buffer looks easier. While snprintf is not > async-signal-safe in general IMO it is async-signal-safe for most format > strings given in almost always uses alloca() instead of malloc(). Right. > Or do you realize other problems it may have? Nope. Thanks, Pedro Alves