From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84950 invoked by alias); 3 May 2015 14:06:19 -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 84929 invoked by uid 89); 3 May 2015 14:06:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 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; Sun, 03 May 2015 14:06:17 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5CFA4C1F05 for ; Sun, 3 May 2015 14:06:16 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t43E6CDd003411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 3 May 2015 10:06:15 -0400 Date: Sun, 03 May 2015 14:06:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Phil Muldoon Subject: Re: [PATCH v3 9/9] compile: compile printf: gdbserver support Message-ID: <20150503140612.GD18394@host1.jankratochvil.net> References: <20150411194322.29128.52477.stgit@host1.jankratochvil.net> <20150411194437.29128.58569.stgit@host1.jankratochvil.net> <20150426093318.GA6765@host1.jankratochvil.net> <5540FEA3.7050406@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5540FEA3.7050406@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00025.txt.bz2 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(). Or do you realize other problems it may have? Still I am sure fine to check it in as is if it is approved this way. > I think the manual should say that the command internally may call > functions that are not async-signal-safe though. Done. Thanks, Jan