From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id S9g9Gd/RCWDZEAAAWB0awg (envelope-from ) for ; Thu, 21 Jan 2021 14:11:27 -0500 Received: by simark.ca (Postfix, from userid 112) id 567871EF80; Thu, 21 Jan 2021 14:11:27 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F0B051E939 for ; Thu, 21 Jan 2021 14:11:26 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C14B7395A008; Thu, 21 Jan 2021 19:11:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C14B7395A008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611256285; bh=gqX/7lfdKdAWMF+GH4XlF2UGuILK67IzXTWTe5C4ZmU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GRO6EgZtgvpw4o9w6eZRxxcrNEKdwFX+t5v7+ZIJD9PZ6sknzAsLr7veTUgNfq0v1 hlwn+1AP+328qJsDU0TlOnOjmbUemEZy9DAw5lgXG8iORGFg69pTVf+XCX+7zKXt/p FPxJW3I6j5+mEVr2GYyHcioHXIplibBq3EaIVs0o= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6E2803875440 for ; Thu, 21 Jan 2021 19:11:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E2803875440 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10LJBH9c004104 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Jan 2021 14:11:22 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10LJBH9c004104 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B21991E939; Thu, 21 Jan 2021 14:11:17 -0500 (EST) Subject: Re: [PATCH] gdb: convert auto-load to new-style debug macros To: Tom Tromey , Simon Marchi via Gdb-patches References: <20210121034032.113861-1-simon.marchi@polymtl.ca> <878s8mw1p9.fsf@tromey.com> Message-ID: <32329128-6e61-3f4f-dcef-5166df5f63d1@polymtl.ca> Date: Thu, 21 Jan 2021 14:11:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <878s8mw1p9.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 21 Jan 2021 19:11:17 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-21 2:05 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> Function file_is_auto_load_safe was taking a format string and varargs > Simon> just to output a debug print. This is probably because that function is > Simon> used in linux-thread-db.c and main.c, but debug_auto_load is static in > Simon> auto-load.c. I simplified that, making debug_auto_load visible outside > Simon> of auto-load.c, and making the callers of file_is_auto_load_safe output > Simon> the debug print themselves. > > Simon> The rest is pretty much standard. > > Simon> gdb/ChangeLog: > > Simon> * auto-load.h (debug_auto_load): Move here. > Simon> (auto_load_debug_printf): New. > Simon> * auto-load.c: Use auto_load_debug_printf. > Simon> (debug_auto_load): Move to header. > Simon> * linux-thread-db.c (try_thread_db_load): Use > Simon> auto_load_debug_printf. > Simon> * main.c (captured_main_1): Likewise. > > Thanks. This seems like a nice cleanup. > I have one comment. > > Simon> - _("auto-load: Loading .gdbinit " > Simon> - "file \"%s\".\n"), > Simon> - local_gdbinit.c_str ())) > Simon> + if (!inhibit_gdbinit && auto_load_local_gdbinit) > Simon> { > Simon> - auto_load_local_gdbinit_loaded = 1; > Simon> + auto_load_debug_printf ("Loading .gdbinit file \"%s\".", > Simon> + local_gdbinit.c_str ()); > > Some of these changes lose the _() wrapper. > I don't know if we care for debug logging .. or maybe we actively want > to remove them in this case? Anyway I thought I'd point it out. I removed them on purpose (will add a mention in the commit log), because I have not seen them used for logging elsewhere. I don't really think it's necessary. I'll push with the mention added, and if I stumble on other places that uses _ for logging, I'll remove it. Thanks, Simon