From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id BB1AE3858D28 for ; Tue, 20 Dec 2022 10:33:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB1AE3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671532380; 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: in-reply-to:in-reply-to:references:references; bh=82zeu5I28VBPxzhMyVi6G4lx48WHfHzwsx2wLrAVgEs=; b=Nq8CsDWphxWOWJM1jQ7PxNx/lw/foZUnOUc3b8EIOFrVccKYV4xldaeEw81pbbX4mPiW9u tv+T0sW/Q7QDOqQCke3kelrJIfcVwX6eFRKf4V5OWTPFSJpOWGDm10x97TVdT5AHJJDHgk hPbHass6XbLcgAH5ioCrLigFajS9kAk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-81-TnCYe9eSOAedU9m0RaC8ag-1; Tue, 20 Dec 2022 05:32:57 -0500 X-MC-Unique: TnCYe9eSOAedU9m0RaC8ag-1 Received: by mail-wm1-f69.google.com with SMTP id 21-20020a05600c021500b003d227b209e1so2461213wmi.1 for ; Tue, 20 Dec 2022 02:32:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=82zeu5I28VBPxzhMyVi6G4lx48WHfHzwsx2wLrAVgEs=; b=hdyy0Y7eQ35hscNdvcvP1627lSduvB72SmSTxQUv9kobBo/5RjxVt+j1bPRC4p9x8N jUa3rwr6iqdsuzop3/JHkhnN1msSzxg6tSX46N2Yg1ckghv87cfmEpW1PPLujHJi4kGN 9IiYzzKnkzE3T/Wp+u1EofoT9/HmggQL0QN4CXK2s91c9MLFa4BX8B7G8sMjTGmRmeM2 93o+jEBdseU6QQtI+nl+nuQoxHta7V9yjPFQN0+uwb+HEXXr2Nz7di/IcNhr0bwD69bz zND3U7dYvnZqDzpKsJSlMvpVNcfrhO3MlBZf5mu48VKXE4pG1PJpVF3jjItMHJyqogq8 Zgsg== X-Gm-Message-State: AFqh2kruWlxqkjoYr6TZXHTWd4FHdgTmYhIsnLyJ+0QMYvTlXFuJ2AUu IZ1R+LRTtMgCUIyGSwHzpCZ9HBv1kvs9MPRHcuj/MkXehsOoLMHZXt9WIlNYC1RPRGuOFucdAxK oO6esIs+Zs+sRw8juzusQJg== X-Received: by 2002:a05:600c:601c:b0:3d4:a1ba:a971 with SMTP id az28-20020a05600c601c00b003d4a1baa971mr1469280wmb.24.1671532375926; Tue, 20 Dec 2022 02:32:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsAZWbXUgZs1W9Upqp27g6PdhHhsVvMRm+s0TqvuuYukq7ZdFDNtjVSmXLBq4M0JbCQDbHLVQ== X-Received: by 2002:a05:600c:601c:b0:3d4:a1ba:a971 with SMTP id az28-20020a05600c601c00b003d4a1baa971mr1469265wmb.24.1671532375686; Tue, 20 Dec 2022 02:32:55 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id bg2-20020a05600c3c8200b003b47e75b401sm26784444wmb.37.2022.12.20.02.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 02:32:55 -0800 (PST) From: Andrew Burgess To: tdevries Cc: Luis Machado , Tom Tromey , Andrew Burgess via Gdb-patches Subject: Re: [PATCH 2/2] gdb/testsuite: new test for recent dwarf reader issue In-Reply-To: <21622d2af7f7c6231d916de6511dff97@suse.de> References: <87lengh250.fsf@tromey.com> <875yek2xdo.fsf@redhat.com> <286c40e2-3bde-91f2-32a2-485b6243bc93@arm.com> <877cys29o6.fsf@redhat.com> <5a78504a-8652-55c6-75ff-db6e0ab06690@arm.com> <87fsdbzejk.fsf@redhat.com> <21622d2af7f7c6231d916de6511dff97@suse.de> Date: Tue, 20 Dec 2022 10:32:53 +0000 Message-ID: <874jtqz7oq.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: tdevries writes: > On 2022-12-19 13:52, Andrew Burgess via Gdb-patches wrote: >> Luis Machado writes: >> >>> On 12/15/22 11:22, Andrew Burgess wrote: >>>> Luis Machado writes: >>>> >>>>> Hi Andrew, >>>>> >>>>> On 12/9/22 19:24, Andrew Burgess via Gdb-patches wrote: >>>>>> Tom Tromey writes: >>>>>> >>>>>>>>>>>> "Andrew" == Andrew Burgess via Gdb-patches >>>>>>>>>>>> writes: >>>>>>> >>>>>>> Thank you for doing this. >>>>>>> >>>>>>> Andrew> - However, GDB checks each partial symbol using multiple >>>>>>> languages, >>>>>>> Andrew> not just the current language (C in this case), so, >>>>>>> when GDB >>>>>>> Andrew> checks using the C++ language, the symbol name is >>>>>>> first demangled, >>>>>>> Andrew> the code that does this can be found >>>>>>> Andrew> lookup_name_info::language_lookup_name. As the >>>>>>> demangled form of >>>>>>> Andrew> 'signed int' is just 'int', GDB then looks for any >>>>>>> symbols with >>>>>>> Andrew> the name 'int', most partial symtabs will contain such >>>>>>> a symbol, >>>>>>> Andrew> so GDB ends up expanding pretty much every symtab. >>>>>>> >>>>>>> It's a pedantic point but what happens here is name >>>>>>> canonicalization, >>>>>>> not demangling. Demangling is just used to refer to the >>>>>>> translation >>>>>>> from a name like "_Zmumble" to "something::else" -- that is, the >>>>>>> input >>>>>>> is a linkage name and the output is a C++ name. Canonicalization >>>>>>> takes >>>>>>> a C++ name as input and returns the standard form, basically >>>>>>> dealing >>>>>>> with the fact that C++ (and as we discovered, C) has multiple >>>>>>> possible >>>>>>> spellings for some symbols. >>>>>> >>>>>> Please, be pedantic. My goal here was to better understand this >>>>>> code, >>>>>> there's no point me understanding it wrong. >>>>>> >>>>>> I'll reword that paragraph. >>>>>> >>>>>> Thanks for taking a look. >>>>>> >>>>>> Andrew >>>>>> >>>>> >>>>> I'm not saying you should investigate this, as it is a new test, but >>>>> I'm getting a lot of these messages for this test: >>>>> >>>>> ERROR: internal buffer is full. >>>> >>>> Happy to take a look at the problem. >>>> >>>> I guess the issue is coming from the gdb_test_multiple that I use in >>>> the >>>> new test script. >>>> >>>> I'm tried to write patterns that match and discard all the lines as >>>> they >>>> arrive from GDB. I guess you are seeing a pattern that I am not for >>>> some reason. >>>> >>>> Could you run just this test and attach the gdb.log file and I'll >>>> take a >>>> look. I probably just need to tweak one of the patterns a little. >>>> >>>> Thanks, >>>> Andrew >>>> >>> >>> I briefly looked into this. The problem seems to arise from the fact >>> that sometimes we don't have multiple lines for the "info sources" >>> output. >>> >>> Some sections are output in a single line. For example, one of them >>> has 133K characters. But each entry seems to be separated by a comma >>> character: >>> >>> ./elf/./elf/rtld.c, ./elf/../include/rtld-malloc.h, >>> ./elf/../sysdeps/generic/ldsodefs.h, >>> ./elf/../sysdeps/aarch64/dl-machine.h, ... >> >> Ahh, that would explain it. We don't appear to use 'info sources' that >> frequently in the testsuite. I wonder if you are also seeing failures >> on those other tests? >> >> gdb.asm/asm-source.exp >> gdb.dwarf2/dup-psym.exp >> gdb.dwarf2/dw2-filename.exp >> >>> It might be best (for the testsuite) if gdb outputs this data across >>> more lines. >> >> The other option might be to extend 'info sources' to allow filtering >> based on the objfile name, then we can use this in the testsuite to >> limit the output... >> >> ... or I wonder if we could trick GDB by setting the width to something >> small, the I guess the lines would be broken after the ',' characters. >> >> I'll have a play and see what I can come up with. >> > > I also ran into this issue on ubuntu 22.04.1 x86_64. > > AFAIK, the way we usually test for this type of information is "maint > print objfile", which is less verbose, and doesn't have long lines. I'm looking at this issue today, I'll give 'maint print objfile' a go. Thanks for the suggestion. Thanks, Andrew