From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118545 invoked by alias); 5 Nov 2019 15:50:38 -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 118532 invoked by uid 89); 5 Nov 2019 15:50:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Nov 2019 15:50:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572969035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xFQsVm3WjsRjluvYiBXrWMQwm3gl/zMtzzAt2kmeiNU=; b=QUY4Lj3W3ecGLBIZjMnUvYCxGjUl9PEsfV0AWVhLrT5t0LkSp1yOOK9TlFqVKPp/5/IkRr iU8KcuJbb7JWWg3onbqL6OEYRmIo+PTi7HpQ1t0UCfmO3aAllYqvdBXe03kwFxokwgXaRc wtE0f3DFcEi4r8rbIQVugE1TNkPrkDY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-IxI9HDY9N_OSxRWVV3wMeQ-1; Tue, 05 Nov 2019 10:50:34 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42C42800C73; Tue, 5 Nov 2019 15:50:33 +0000 (UTC) Received: from redhat.com (ovpn-116-53.phx2.redhat.com [10.3.116.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CE95100164D; Tue, 5 Nov 2019 15:50:33 +0000 (UTC) Received: from fche by redhat.com with local (Exim 4.92) (envelope-from ) id 1iS16F-0006Br-4V; Tue, 05 Nov 2019 10:50:31 -0500 Date: Tue, 05 Nov 2019 15:50:00 -0000 From: "Frank Ch. Eigler" To: Simon Marchi Cc: Aaron Merey , Tom Tromey , Christian Biesinger via gdb-patches , Christian Biesinger Subject: Re: [RFC PATCH] Support debuginfo and source file fetching via debuginfo server Message-ID: <20191105155031.GA23660@redhat.com> References: <87sgn71ji6.fsf@tromey.com> <87lfsye5l5.fsf@redhat.com> <87bltrelab.fsf@redhat.com> <20191104162616.GA13319@redhat.com> <6f3fb81a-09ef-ab07-eef4-0460181bcaa0@simark.ca> <20191105102519.GA18724@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2019-11/txt/msg00122.txt.bz2 Hi, Simon - > [...] > I think that providing a void pointer for context is pretty standard thing > for C libraries that accept callbacks. I would use __thread and the prom= ise > to call the function back in the same thread to "retro-fit" some thread-s= afety > in an existing API that doesn't provide a context pointer,=20 Remember that this is a batch file downloading tool. We expect it to be interrupted if a user gets impatient, in which case such a signal would affect all downloads. In the absence of a plausible user story for the need for fine control over multiple different debuginfo transfers in progress, I believe something simple is enough for now. > Ok, well I think it would be a good reason to adopt an API of the > style: [...] Again, this is easy to add in the beginning, but hard > to retro-fit later on. Retro-fitting it later on is not that bad, when/if actual use cases appear. The default 'client context' can be the current global one. A hypothetical future api can pass void* context parameters; we can have two callback function types. It being simple now does not preclude necessary complexity later. I appreciate the ideas, really, but I am about as wary of overengineering as underengineering. - FChE