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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 3D8163AA8026 for ; Fri, 11 Jun 2021 16:35:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D8163AA8026 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-JyF8b3Q1PHGEZLYiNmdfHw-1; Fri, 11 Jun 2021 12:35:47 -0400 X-MC-Unique: JyF8b3Q1PHGEZLYiNmdfHw-1 Received: by mail-qk1-f197.google.com with SMTP id n3-20020a378b030000b02903a624ca95adso21710374qkd.17 for ; Fri, 11 Jun 2021 09:35:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:from:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=OG38/Ny1nNYacw1v2flYp8pSG8wXtNiRJF5dqPsRVu4=; b=IS4RF4LONxB0fKYiM8KgNQiJwvQ7WYWz/uCEsaM+uYKCsAL+iKwTOfM4SfhQLN5da+ t3TS9HGuazc2TE3LYlKrxIE6EbSCbsSLa39Q/855YpYeNas1liobG7f92e15zAtc8QTL kzXNVnhT+Umgy9LbB/prKBBHSO4nk0bALbfET/zIspmP5uLc34USBiBp4Ktq8acxuc0B ok+0ZZy058anmrm4F5fzQb5NU2xlXWgnrRWwnRz4K8RznaLOkhoUsiEFk5O+aN1njjz3 6EUH5cfLyCiQ9sW3aP3E/KhzlT4yPqFhHucnP384uCk/3F0ruGO4KGM4DArWOiOec4+e p/AQ== X-Gm-Message-State: AOAM531ftpkxUedRrJdTmDuF0cHW5GgrFIOYcG/khfupvoTE/OB0B7MJ P1YjpFdJUjBRDd5Y6Z0czxed0T2TuqaOlPz2ez4U7oMLwyXRC2Iws2jCoDl2alUAODLz9mnDJvG kwCQ5+9Wp/sjMh4qBOF7OzRoEjmviMhngk5SrQVT9cJ/tozdVNbomJ1BWFE7pcAQxLxy11cI= X-Received: by 2002:a0c:e942:: with SMTP id n2mr5651668qvo.5.1623429346232; Fri, 11 Jun 2021 09:35:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFvr8KmS7xKng/8XcqaogVhDZo0x1/34cGJRfnoinqJ86VJMhfRVsfc7jtC5wS0tAzqT6++A== X-Received: by 2002:a0c:e942:: with SMTP id n2mr5651650qvo.5.1623429346019; Fri, 11 Jun 2021 09:35:46 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id 2sm4516704qtb.28.2021.06.11.09.35.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Jun 2021 09:35:45 -0700 (PDT) To: kevinb@redhat.com, "gdb-patches@sourceware.org" Subject: Re: [PATCH 3/4] print-symbol-loading.exp: Allow libc symbols to be already loaded From: Carlos O'Donell Organization: Red Hat Message-ID: Date: Fri, 11 Jun 2021 12:35:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 1 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FAKE_REPLY_A1, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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: Fri, 11 Jun 2021 16:35:50 -0000 > One consequence of changing libpthread_name_p() in solib.c to (also) > match libc is that the symbols for libc will now be loaded by > solib_add() in solib.c. I think this is mostly harmless because > we'll likely want these symbols to be loaded anyway, but it did cause > two failures in gdb.base/print-symbol-loading.exp. Correct, we will want these symbols loaded, so I think this goes in the correct direction. Tested on x86_64 Fedora Rawhide with new glibc. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > Specifically... > > 1) > > sharedlibrary .* > (gdb) PASS: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib > > now looks like this: > > sharedlibrary .* > Symbols already loaded for /lib64/libc.so.6 > (gdb) PASS: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib > > 2) > > sharedlibrary .* > Loading symbols for shared libraries: .* > (gdb) PASS: gdb.base/print-symbol-loading.exp: shlib brief: load shared-lib > > now looks like this: > > sharedlibrary .* > Loading symbols for shared libraries: .* > Symbols already loaded for /lib64/libc.so.6 > (gdb) PASS: gdb.base/print-symbol-loading.exp: shlib brief: load shared-lib > > Fixing case #2 ended up being easier than #1. #1 had been using > gdb_test_no_output to correctly match this no-output case. I > ended up replacing it with gdb_test_multiple, matching the exact > expected output for each of the two now acceptable cases. I think the use gdb_test_multiple is a good solution here. > > For case #2, I simply added an optional non-capturing group > for the potential new output. > > gdb/testsuite/ChangeLog: > > * gdb.base/print-symbol-loading.exp (proc test_load_shlib): > Allow "Symbols already loaded for..." messages. > --- > gdb/testsuite/gdb.base/print-symbol-loading.exp | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp > index b8eb1c844bd..6e176de351e 100644 > --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp > +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp > @@ -96,6 +96,7 @@ test_load_core full > > proc test_load_shlib { print_symbol_loading } { > global binfile > + global gdb_prompt OK. > with_test_prefix "shlib ${print_symbol_loading}" { > clean_restart ${binfile} > gdb_test_no_output "set auto-solib-add off" > @@ -106,12 +107,20 @@ proc test_load_shlib { print_symbol_loading } { > set test_name "load shared-lib" > switch ${print_symbol_loading} { > "off" { > - gdb_test_no_output "sharedlibrary .*" \ > - ${test_name} > + set cmd "sharedlibrary .*" > + set cmd_regex [string_to_regexp $cmd] > + gdb_test_multiple $cmd $test_name { > + -re "^$cmd_regex\r\n$gdb_prompt $" { > + pass $test_name > + } OK. > + -re "^$cmd_regex\r\nSymbols already loaded for.*?\\/libc\\..*?\r\n$gdb_prompt $" { > + pass $test_name > + } OK. > + } > } > "brief" { > gdb_test "sharedlibrary .*" \ > - "Loading symbols for shared libraries: \\.\\*" \ > + "Loading symbols for shared libraries: \\.\\*.*?(?:Symbols already loaded for .*?libc)?" \ OK. > ${test_name} > } > "full" { > -- > 2.31.1 -- Cheers, Carlos.