From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id 3B6523857C4D for ; Wed, 19 Aug 2020 03:44:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3B6523857C4D Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 91A892C221E; Tue, 18 Aug 2020 23:44:23 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id r6BYLf0MiTy3; Tue, 18 Aug 2020 23:44:23 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 549FC2C20BA; Tue, 18 Aug 2020 23:44:23 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 549FC2C20BA X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id URK64wsTMdbN; Tue, 18 Aug 2020 23:44:23 -0400 (EDT) Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) by mail.efficios.com (Postfix) with ESMTPSA id 3DC6D2C2037; Tue, 18 Aug 2020 23:44:23 -0400 (EDT) Subject: Re: [RFC PATCH] gdb: add linux_nat_debug_printf macro To: Simon Marchi , Tom Tromey , Simon Marchi via Gdb-patches References: <20200702193034.22279-1-simon.marchi@efficios.com> <87y2nopsjz.fsf@tromey.com> <3728b768-05d6-c6de-c28e-d059b71360db@simark.ca> From: Simon Marchi Message-ID: Date: Tue, 18 Aug 2020 23:44:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 19 Aug 2020 03:44:25 -0000 On 2020-08-18 11:39 p.m., Simon Marchi wrote: > On 2020-08-18 10:56 p.m., Simon Marchi wrote: >> I remember I tried it and didn't like it much. Printing longer identifiers didn't >> help readability. And usually we have enough context to know what the debug >> statement is about, especially with the [linux-nat] prefix. > > Although when dealing with lambdas (which includes SCOPE_EXIT), it can be quite unhelpful: > > [infrun] operator(): ... > > With __PRETTY_FUNCTION__ it's a bit better: > > [infrun] stop_all_threads()::: ... > > For that reason, we should maybe consider using __PRETTY_FUNCTION__. Ah, now I remember why I didn't like it. It puts the full prototype of the function: [infrun] void handle_inferior_event(execution_control_state*): status->kind = stopped, signal = GDB_SIGNAL_TRAP You can imagine that it can be quite long, so it adds quite a lot of noise. We would need something in between, like __PRETTY_FUNCTION__ but without the parameters. Simon