From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32357 invoked by alias); 24 Oct 2014 15:56:36 -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 32259 invoked by uid 89); 24 Oct 2014 15:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients 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; Fri, 24 Oct 2014 15:56:34 +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 (8.14.4/8.14.4) with ESMTP id s9OFuXA8028401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 Oct 2014 11:56:33 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9OFuV73004080; Fri, 24 Oct 2014 11:56:32 -0400 Message-ID: <544A76AE.8040107@redhat.com> Date: Fri, 24 Oct 2014 15:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: "Carlos O'Donell" , Jan Kratochvil CC: libc-alpha@sourceware.org, gdb-patches@sourceware.org Subject: Re: [libc patch] __tls_get_addr with link_map * instead of modid References: <20141018201540.GA26252@host2.jankratochvil.net> <5449B78E.1060407@redhat.com> <20141024093834.GA24090@host2.jankratochvil.net> <544A60A5.4020701@redhat.com> In-Reply-To: <544A60A5.4020701@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00653.txt.bz2 On 10/24/2014 03:22 PM, Carlos O'Donell wrote: > I don't understand the tradeoffs, but if calling dlopen() in the inferior would > have made life easy, then I would have done that first, regardless of the impact > on the inferior. Only if users complained or found use cases where things broke > would I have fallen back on the "technical purist" solution involving doing > everything yourself. Those are decisions that you, as a gdb developer need to > make, or reevaluate and make different. Off the top of my head, I'm sure there are more: - The user might want to evaluate an expression while the program itself has just called dlopen and is now stopped inside it. This pesky dlopen recursion thing. ;-) It's best if GDB only calls async-signal safe functions behind the scenes, if possible. Of course if the injected expression involves calls to async-signal unsafe code that breaks the inferior, the user gets what she asked for. - The program might have not been linked with -ldl. - I suspect there may be issues with messing with symbol resolution and self library walks in the inferior too. Not sure if RTLD_LOCAL is enough. dlmopen might be a better fit, but hmm, that isn't very well supported in GDB/glibc. - A lower level mechanism has much better changes of working on more targets and runtimes of languages other than C with minimal changes. Thanks, Pedro Alves