From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2046.outbound.protection.outlook.com [40.107.22.46]) by sourceware.org (Postfix) with ESMTPS id A58E8385843D for ; Tue, 20 Dec 2022 14:05:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A58E8385843D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6yhChk3IDMvNoP7yg9fNJMFqoaeUrIkiNTWA3AA2uEc=; b=sVzzDsdUeIDKt30TFOiNnlW7mnaWSwR8WppCGIa1T1MZoHxdW4P4KzzXBcIlC/HxNLkhqqBTHNIQOwMcaxHpE89jhTh00CCkxo50pgyQb2Qtr5eDNAoS3Z+MIi3RXJi4vsLsNuLp1PDGSQi+2QvjcedsKFoFN4Bbt6U1mVXPFMY= Received: from AM5PR1001CA0036.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::49) by PAVPR08MB9084.eurprd08.prod.outlook.com (2603:10a6:102:32d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6; Tue, 20 Dec 2022 14:05:12 +0000 Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:2:cafe::e6) by AM5PR1001CA0036.outlook.office365.com (2603:10a6:206:2::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Tue, 20 Dec 2022 14:05:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16 via Frontend Transport; Tue, 20 Dec 2022 14:05:12 +0000 Received: ("Tessian outbound 3ad958cd7492:v132"); Tue, 20 Dec 2022 14:05:12 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 97c9ade896645c75 X-CR-MTA-TID: 64aa7808 Received: from 411a42c81dc1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EAFB3339-7743-47D3-92AF-728E1D70487C.1; Tue, 20 Dec 2022 14:05:05 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 411a42c81dc1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 20 Dec 2022 14:05:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DoqDa7v1/JQOKaVPdDaS9NE5mvIh/1x6BweuQcfH9gyIfKIn7YIQRZKLAPev30tk/pj7fYtpqwyBl1agH7ZjrAMVE5NW60aUq5o7IqlEoN/9xUIbp4qnhXpnmPz/LGeXUR5GYgzneIItSjnYXmcLjZOisIwY5gRpTKuP7VHEmRksgOT23Sad32A+teJsF22IZpdtUBFQJVyFGI/HPuAnXr1kYpDfE4+wyxs10ZsL6Mcv+zTdRCg5Cmdze9j9VePxg0yBNvOFkIzK1/f+Ub6Zegy+ZfJSHp8T33A686L3BbNVp5CplbOggkZxzC6NSe14SW/A3H+sTbXl8Rab5oueKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6yhChk3IDMvNoP7yg9fNJMFqoaeUrIkiNTWA3AA2uEc=; b=ePrQWSMzAd6sNfWL7uk/X8Als3ms5beodvqhDaV5cZXsShTY3XSFvBdrxjFi9czC3BQzsDi7tnu8MAWy78xlKScsy1Dc0y/XuCeVXkV8613lysnf7eXNUFJfqpwl3M5TuuFneJc34xKdSnx9pkHJru333vxQPhLqJ1JOYE70lFRDgRYJV7QLu2Dfekxo2mVwz37IlGB1095KEvzg5teOqykXMSCX3ftCIoPMVsAQ/7lMbtVHtD7wYVUIpNnJsjv4Gh951xWbV3GFwxYdzuAp314dQvP/FzMxfjD098ps+cF+X6BzSVhxWVZwJLw8BRs14tNg/gBUVJu0a2TcfSl6+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6yhChk3IDMvNoP7yg9fNJMFqoaeUrIkiNTWA3AA2uEc=; b=sVzzDsdUeIDKt30TFOiNnlW7mnaWSwR8WppCGIa1T1MZoHxdW4P4KzzXBcIlC/HxNLkhqqBTHNIQOwMcaxHpE89jhTh00CCkxo50pgyQb2Qtr5eDNAoS3Z+MIi3RXJi4vsLsNuLp1PDGSQi+2QvjcedsKFoFN4Bbt6U1mVXPFMY= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB8327.eurprd08.prod.outlook.com (2603:10a6:20b:56e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6; Tue, 20 Dec 2022 14:04:58 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::eed7:25a3:e4ea:187a]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::eed7:25a3:e4ea:187a%7]) with mapi id 15.20.5944.006; Tue, 20 Dec 2022 14:04:58 +0000 Message-ID: <5320d66a-2ad7-127c-6c88-763e4804dec0@arm.com> Date: Tue, 20 Dec 2022 14:04:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 2/2] gdb/testsuite: new test for recent dwarf reader issue Content-Language: en-US To: Andrew Burgess , tdevries Cc: Tom Tromey , Andrew Burgess via Gdb-patches 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> <874jtqz7oq.fsf@redhat.com> <87zgbixlcg.fsf@redhat.com> From: Luis Machado In-Reply-To: <87zgbixlcg.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA0PR11CA0149.namprd11.prod.outlook.com (2603:10b6:806:131::34) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB8327:EE_|AM7EUR03FT022:EE_|PAVPR08MB9084:EE_ X-MS-Office365-Filtering-Correlation-Id: fff8ddf0-aae4-4e9e-3e29-08dae293365c x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: AmfR63hF6ioZed5SsWSKg8bDRT3D/MfJRuwAtiRnggR93icrRmgx6KTpYFL4QetVpZi3EmNbmfRnoEArl7595Tcf5JLw02ninJQ4T/TgDk7N/ou3mnjH+s9u1J03T8SesM8iB+4AfzGVYoOMBo+lXCTc27A/4BVoYiUmbB2o9eEutXsuiXkvoW34a5/8X4ABFRgQut2+vxijmRHNNYCqshy3JF+bXGXzO1/0ELCxU3cCYKrKUH3OISqWnrnpCTB3pAQOeF2D68RVjU2LeE1TCCcRk2vta4iDuRsJH29pG49/1ryW4TVC2D/Y5v8OGJbHbNspkKBozUzMALBKeS9O3+WPTH2t7yLyWnYDvT+4QsQayUU5lp+liAE6Wg5zFcoXt5R93aXKkyQ3mAF8k5+Cgv3iihEXBS8INtN3Bwc8Yt4OEYsjJZ26qIw4ZsGOFI8SJVSde7ezAuomScQjtqoa7f/i/wiiMacYIg9turkLpSLikV20q7m/dRsBMcoej6gx/l8plqAViGWMN87tBiNXIIWJ4m/E1ryctDTkUcAv8xdU9LP5oj0H+x1cZVwBq7Gs6AMf3citwpu1azWKiD77fK5gZuD89jSCdf9+EzknXhHoxbQ340gT7U2uLKhiHIqdhDwU9F0qIabRK9keTa9i2qX80p30y93CWm0puj2ZSm5qEDaoxdAw8VUbjvbxA8OdUV5ZWAzBvdboKAcyINs5RN6hXmsr+iNdC4x0pRWJ2aD1tT9b3zHK6/IVJVgABRVJ X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(346002)(366004)(376002)(136003)(451199015)(2906002)(8936002)(31686004)(5660300002)(41300700001)(54906003)(316002)(4001150100001)(66476007)(66556008)(66946007)(8676002)(84970400001)(4326008)(110136005)(31696002)(36756003)(53546011)(186003)(86362001)(6666004)(6506007)(6486002)(26005)(478600001)(6512007)(83380400001)(66899015)(44832011)(38100700002)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8327 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c68147f6-1133-4ab6-c090-08dae2932d7b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 12+qeD1w5SIpGXMRhpqDiJf56fib3ACBuXsBijPKVY6vBAn8rTLnKDUfCli/F3RDKDYjyVErF7t5J1s6Rf+9y9NMi9bQlkbgq5NaTrckAH+hW28oz7v5Xgrfbknum5byI70R77ehZnURh7Nmip14gAU/YqnL6DehEQAoSMoasL1EYZ5gpADmtRNI67kkYxklb047Trr3HoZDj6shc4dzDbp2OmbiA2OwfVQc2EqGngrquzA0D9w5VOpdCY10oH62b4AZq0IBleS/R/8DvyjRIIWwb7DxMHLz8Y1nyqIWmnFUrXNbpUT583ixjR+bIJQEaMEfM/H/zjWuNrxYoKG/6/Bvx7fBrA4bJ4fQ7iqjp0QodHsobM1hQOZGz9VDGkAMWmlIpwiy9zhke1OTE78pASPzzZp77CexqBwE+L3mUEDmukUuQYYOzDOzHKMIXtoBhVaqiMsz89mE/cNZcRTe9mB+s1mbHTPUgldEfz63QBXfwl+mj1SXHDe4lnEMgnc4a6XXdTwSR5f3GwvYOlb3zv1PfNVsB64mNgrHQwODCaDP+GfC3tErb66uybK3uYY9rZlQQkavCyjQcOipMZVn9cAKpN1+nTN0cWiaRVqGvvrKvzWUu3luI+apegwiRGUi+6lPPW5/RqOfPJtAoUziWQsf18i+miUpbG7QIp3S6A0FgMdMnPgmdsVBGFJGfXyVfwn1Jso1bPRwSgVLwyy/vsNRfKQhFqRsu2usyXMizfFNulHQc2Pb2bepULCV0R46aaXze+K8wO5wNP/7VdhiyA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(36840700001)(46966006)(40470700004)(47076005)(66899015)(336012)(84970400001)(2616005)(83380400001)(31686004)(86362001)(6512007)(31696002)(110136005)(316002)(54906003)(40480700001)(36756003)(82310400005)(356005)(26005)(40460700003)(82740400003)(53546011)(4001150100001)(6486002)(478600001)(6506007)(8936002)(186003)(81166007)(4326008)(41300700001)(5660300002)(6666004)(8676002)(70586007)(2906002)(36860700001)(70206006)(44832011)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 14:05:12.5493 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fff8ddf0-aae4-4e9e-3e29-08dae293365c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9084 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY 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: On 12/20/22 13:20, Andrew Burgess wrote: > Andrew Burgess writes: > >> 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. > > I was able to reproduce the buffer overflow errors. The patch below > addresses the issue for me. > > Thoughts? > > Thanks, > Andrew > > --- > > commit e1f51c1b3b37d96e679fa2698eb83a6a3a05eb53 > Author: Andrew Burgess > Date: Tue Dec 20 12:51:50 2022 +0000 > > gdb/testsuite: fix buffer overflow in gdb.base/signed-builtin-types.exp > > In commit: > > commit 9f50fe0835850645bd8ea9bb1efe1fe6c48dfb12 > Date: Wed Dec 7 15:55:25 2022 +0000 > > gdb/testsuite: new test for recent dwarf reader issue > > A new test (gdb.base/signed-builtin-types.exp) was added that made use > of 'info sources' to figure out if the debug information for a > particular object file had been fully expanded or not. Unfortunately > some lines of the 'info sources' output can be very long, this was > observed on some systems where the debug information for the > dynamic-linker was installed, in this case, the list of source files > associated with the dynamic linker was so long it would cause expect's > internal buffer to overflow. > > This commit switches from using 'info sources' to 'maint print > objfile', the output from the latter command is more compact, but > also, can be restricted to a named object file. > > With this change in place I am no longer seeing buffer overflow errors > from expect when running gdb.base/signed-builtin-types.exp. > > diff --git a/gdb/testsuite/gdb.base/signed-builtin-types.exp b/gdb/testsuite/gdb.base/signed-builtin-types.exp > index e9784330fee..fdb9251758e 100644 > --- a/gdb/testsuite/gdb.base/signed-builtin-types.exp > +++ b/gdb/testsuite/gdb.base/signed-builtin-types.exp > @@ -21,7 +21,8 @@ standard_testfile .c -lib.c > > # Compile the shared library. > set srcdso [file join $srcdir $subdir $srcfile2] > -set objdso [standard_output_file lib${gdb_test_file_name}.so] > +set libname "lib${gdb_test_file_name}.so" > +set objdso [standard_output_file $libname] > if {[gdb_compile_shlib $srcdso $objdso {debug}] != ""} { > untested "failed to compile dso" > return -1 > @@ -47,45 +48,39 @@ if {[readnow]} { > # information has NOT been fully expanded (which is what we want for this > # test). > proc shared_library_debug_not_fully_expanded {} { > - set library_expanded "" > - gdb_test_multiple "info sources" "" { > - -re "^info sources\r\n" { > + set not_expanded true > + gdb_test_multiple "maint print objfiles $::libname" "" { > + -re "^maint print objfiles \[^\r\n\]+\r\n" { > exp_continue > } > - -re "^(\[^\r\n\]+):\r\n\\(Full debug information has not yet been read for this file\\.\\)\r\n\r\n" { > - set libname $expect_out(1,string) > - if {$libname == $::objdso} { > - set library_expanded "no" > - } > + > + -re "^\\s*\r\n" { > + exp_continue > + } > + > + -re "^Object file \[^\r\n\]+\r\n" { > exp_continue > } > - -re "^(\[^\r\n\]+):\r\n\\(Objfile has no debug information\\.\\)\r\n\r\n" { > - set libname $expect_out(1,string) > - if {$libname == $::objdso} { > - # For some reason the shared library has no debug > - # information, this is not expected. > - set library_expanded "missing debug" > - } > + > + -re "^Cooked index in use\r\n" { > exp_continue > } > - -re "^(\[^\r\n\]+):\r\n\r\n" { > - set libname $expect_out(1,string) > - if {$libname == $::objdso} { > - set library_expanded "yes" > - } > + > + -re "^Symtabs:\r\n" { > + set not_expanded false > exp_continue > } > + > -re "^$::gdb_prompt $" { > - gdb_assert {[string equal $library_expanded "yes"] \ > - || [string equal $library_expanded "no"]} \ > - $gdb_test_name > + pass $gdb_test_name > } > - -re "^(\[^\r\n:\]*)\r\n" { > + > + -re "^\[^\r\n\]+\r\n" { > exp_continue > } > } > > - return [expr $library_expanded == "no"] > + return $not_expanded > } > > foreach_with_prefix type_name {"short" "int" "long" "char"} { > LGTM, and it fixes things for me as well. Thanks a lot for looking into this.