From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76157 invoked by alias); 9 Jan 2020 22:41:11 -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 76148 invoked by uid 89); 9 Jan 2020 22:41:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jan 2020 22:41:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578609668; 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=W6VXnjLs2c+SaASS57UMD9qjNiFymAyE95ZrY4q8zmE=; b=irtykphWvbznfxOXGGpDV4M4tHV4IATF+2q19ql5lQFkdQc+yM8gHvSkMPPP9IzdYx+/Qa FK89m0rJbA5dyAfugTyQCBekxRnT49t+wM7Qu0knc22SH22K6A02HPYe0/DN3B5rBVIGEX HM4551afs1pYY5TFS3lC91iln6kW+kQ= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-Udc2-Le8NrKK0Su4Q_VTCA-1; Thu, 09 Jan 2020 17:41:07 -0500 Received: by mail-vk1-f197.google.com with SMTP id w23so11132vkd.16 for ; Thu, 09 Jan 2020 14:41:07 -0800 (PST) MIME-Version: 1.0 References: <87h814r6p4.fsf@tromey.com> In-Reply-To: <87h814r6p4.fsf@tromey.com> From: Aaron Merey Date: Thu, 09 Jan 2020 22:41:00 -0000 Message-ID: Subject: Re: [PATCH 1/1] Add debuginfod support to GDB To: Tom Tromey Cc: gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2020-01/txt/msg00226.txt.bz2 On Thu, Jan 9, 2020 at 10:27 AM Tom Tromey wrote: > Aaron> * config/debuginfod.m4: New file. Add macro AC_DEBUGINFOD. > Aaron> Adds new configure option --with-debuginfod. > Aaron> * configure: Regenerate. > Aaron> * configure.ac: Call AC_DEBUGINFOD. > > Does the top-level configure really need AC_DEBUGINFOD? > > If so, then this part of the patch has to go to gcc-patches first. > But, I suspect it's not needed, in which case dropping it is more > convenient, because we can have debuginfod.m4 locally and not involve > gcc at all. The reason for the top-level AC_DEBUGINFOD is to prevent the top-level configure check from succeeding in cases where --with-debuginfod is given but the debuginfod library or header cannot be found. I should also mention that these same top level changes were also included in a patch that adds debuginfod support to binutils and that patch has been merged. https://sourceware.org/ml/binutils/2020-01/msg00090.html (I wasn't sure which list to post top-level changes to so I included them in both patches so that each will work independently.) > Aaron> +if test "${with_debuginfod}" =3D no; then > Aaron> + AC_MSG_WARN([debuginfod support disabled; some features may be = unavailable.]) > Aaron> +else > Aaron> + AC_CHECK_LIB([debuginfod], [debuginfod_begin], [have_debuginfod= _lib=3Dyes]) > > Does and/or should libdebuginfod use pkg-config for this kind of thing? I can change this to use pkg-config. > > Aaron> @@ -612,7 +615,7 @@ CLIBS =3D $(SIM) $(READLINE) $(OPCODES) $(BFD)= $(LIBCTF) $(ZLIB) \ > Aaron> @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \ > Aaron> $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ > Aaron> $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR= ) \ > Aaron> - $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) > Aaron> + $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) $(LIBDEBUGIN= FOD) > > Should it be before PTHREAD_LIBS? > If not, this is fine. This should be ok. > Aaron> + /* Allow debuginfod to abort the download if SIGINT is = raised. */ > Aaron> + debuginfod_set_progressfn( > > gdb style puts a space before the paren, and usually the paren is kept > next to the arguments if a newline is needed. > > Aaron> + client, > Aaron> + [] (debuginfod_client *c, long a, long b) > Aaron> + { return 1 ? check_quit_flag () : 0; } > > This looks weird, because there's no need for the "1 ?" part. Maybe it > should be just: > > return check_quit_flag (); > > A lot of this code is duplicated in 3 places. I think it would be > better to have a helper function to consolidate the shared code. Agreed, is gdb/gdbsupport/ a good place for this helper? > Aaron> +# Copyright 2010-2019 Free Software Foundation, Inc. > > Probably just 2020. Sure.