From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99994 invoked by alias); 23 May 2018 15:08:33 -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 99967 invoked by uid 89); 23 May 2018 15:08:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 May 2018 15:08:31 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10D5F814FDCE; Wed, 23 May 2018 15:08:30 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A69183B6A; Wed, 23 May 2018 15:08:29 +0000 (UTC) Subject: Re: [RFA 0/9] Radically simplify the complaint system To: Tom Tromey References: <20180522050704.10845-1-tom@tromey.com> <190d88e2-35a5-9dc2-8b28-4a8c37e0617a@redhat.com> <87d0xmfodf.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Wed, 23 May 2018 17:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <87d0xmfodf.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00628.txt.bz2 On 05/23/2018 03:17 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Can you give an example case of when do we still need or want > Pedro> the ISOLATED_MESSAGE vs SHORT_FIRST_MESSAGE distinction? > > Sure. You can see it using: > > $ ./gdb -nx > (gdb) set complaints 1 > (gdb) file ./gdb > > I get: > > Reading symbols from ./gdb...DW_AT_low_pc 0x0 is zero for DIE at 0x1717ad8 [in module /home/tromey/gdb/build/gdb/gdb]....debug_line address at offset 0xa6284 is 0 [in module /home/tromey/gdb/build/gdb/gdb]...done. > > ... stuff here ... > > During symbol reading, unsupported tag: 'DW_TAG_unspecified_type'. > During symbol reading, const value length mismatch for 'std::ratio<1, 1000000000>::num', got 8, expected 0. > > > What's happening here is that the SHORT_FIRST_MESSAGE stuff is printed > during the "Reading symbols...", and then once psymtabs are read, we hit > a call to clear_complaints. Any subsequent complaints -- say, during > psymtab expansion -- are issued as ISOLATED_MESSAGE. Ah, OK. I don't get those SHORT_FIRST_MESSAGE ones here, lucky me. I do get them if I interrupt debug info reading with ctrl-c, eh: Reading symbols from ./gdb...^Cdone. Quit Setting up the environment for debugging gdb. unsupported tag: 'DW_TAG_unspecified_type'...debug info gives source 58 included from file at zero line 0...debug info gives command-line macro definition with non-zero line 19: _STDC_PREDEF_H 1...Breakpoint 1 at 0x63811a: file /home/pedro/gdb/binutils-gdb/src/gdb/common/errors.c, line 54. const value length mismatch for 'std::ratio<1, 1000000000>::num', got 8, expected 0...Member function "~_Sp_counted_base" (offset 0x422925) is virtual but the vtable offset is not specified...cannot get low and high bounds for subprogram DIE at 0x42b8d6...Child DIE 0x443665 and its abstract origin 0x443601 have different parents...Multiple children of DIE 0x445e71 refer to DIE 0x445e60 as their abstract origin...Breakpoint 2 at 0x475d2c: file /home/pedro/gdb/binutils-gdb/src/gdb/cli/cli-cmds.c, line 197. (top-gdb) I've thought before that those several complaints printed in the same line were very confusing to read. I wouldn't miss not-having-newlines at all. > > I have some more patches to try to clean some of this up as well, but I > thought it would be better to submit this series as a simple complaint > cleanup rather than trying to change the output at the same time. That's reasonable. The patch is fine with me to merge as is. > > What I have so far still preserves this distinction, so this would be a > good time to talk about what should be done. All I really did is add > some newlines and remove the "done." text, so that the "Reading symbols" > output is cleaner, like: > > Reading symbols from ./gdb... > DW_AT_low_pc 0x0 is zero for DIE at 0x1717ad8 [in module /home/tromey/gdb/build/gdb/gdb] > debug_line address at offset 0xa6284 is 0 [in module /home/tromey/gdb/build/gdb/gdb] > > This is a bit weird sometimes still, because some of the complaints are > rather uninformative, e.g.: > > complaint (&symfile_complaints, > _("location description stack overflow")); > > I do think it would be good to be able to remove the *_MESSAGE > constants, I'm just not sure exactly what to print. Probably I'm just > overthinking it since I doubt anyone except gdb developers enable > complaints. Yeah, why would a user want them? I wonder whether printing the module name first, maybe also a context prefix, before the complaint message would make it a little bit nicer. Something like: Reading symbols from ./gdb... DWARF reader: /home/tromey/gdb/build/gdb/gdb: DW_AT_low_pc 0x0 is zero for DIE at 0x1717ad8 DWARF reader: /home/tromey/gdb/build/gdb/gdb: debug_line address at offset 0xa6284 is 0 Thanks, Pedro Alves