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 108CD3858C78 for ; Mon, 27 May 2024 21:48:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 108CD3858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 108CD3858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716846521; cv=none; b=vIHRelkPqT6G7A4fMFVAVbfKDxEG/YjwAbVVTyiYeD5uRJWyE40vH61OsSPt9+iEzl+Fd/Nr3IMDJRX4TXFhGes0/7TPgVIw6UAvGr6zd3f21uB9lu2aCgH3t3Q/+p9mPEPTz3kWYqW58u7xmKilkL0HugMoymGQX+2dndAwRFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716846521; c=relaxed/simple; bh=i86nmGrOpQ7WqpjVphXyFwZ/kTW1IvgLlsQ5BF1myxw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=w9Mfa0o2FK063mJo/oMvi35uOP0jtgH0UB5B51fKwR/OtgBnRnqiFCbP8zhYe1ZhL+xI43qWPwexW6FutOn1vVJuyGY6D26SqxWx8EkszsAceBaas2ILInqkpOGMCPEjJQz6/PLGMONzfE71Wy0ZJ/JuKSq0399pnGdC3LrnPcc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716846518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OWMmBQUglHzs9LNTYxF7rWSP8Mwi3D0I5HAkAoiXQdw=; b=AVqnsLvhSY0UU/icpHFoTDKwC7AHOPG5ufJh9i49NAPZEPf1pMfIrZw9MTuk7NK+oboW4G RB6SH/2W5INZvYsCkSqlbp16olzm1fH9d4dYlbIpXmCvZTsopUZz66Sob9wUU8RxM62C4e C2E4HebeR8IYkByeey/sxMlInVr/KZc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-mJ_HzsN6OemH38BOTkzMtw-1; Mon, 27 May 2024 17:48:37 -0400 X-MC-Unique: mJ_HzsN6OemH38BOTkzMtw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4202c2d397aso482245e9.0 for ; Mon, 27 May 2024 14:48:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716846516; x=1717451316; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OWMmBQUglHzs9LNTYxF7rWSP8Mwi3D0I5HAkAoiXQdw=; b=O9qP8P+AfL9czCSWGqt9amT8n/eVXnBKodx6NDYZF/tzduSFzja77xw9e4j5bfd5vt b3Bu3vDirHFLRcBpVoVQEIxoDyZiikxWVqPpltaY8keSm/XYZ1DWBOF49ewXVVBOw38X fPDR/owcVbq1gEmV6cR0q/SQFcKyDNEH3XFehc+1druXYQvpYgNLdrkkKm/AvUaotHA8 C9zWGq2TVTrwC8rZwmPRTUsc6Q2p28B31vCpe7bd1bae5b25E2LNg4yoTmvPStlgq8g7 GDrm3L6ku5DduX6EoiSCSW63UQr1jxiBF7/4JTmeMyYXlX1xTtKTEOe0//fnehmPEYV4 6C9Q== X-Forwarded-Encrypted: i=1; AJvYcCUG46YcbuXip8nOOZ5UnEaC+Q+GKGAH7rkD/q1l8qnQYNJdFDkkIecEP5RDUtlZtkmZDMz+U14uNkCXCDQKdkUV/FbYJC+kK+gzpQ== X-Gm-Message-State: AOJu0YwMcT2Ec6uFR0Ta6FyIQvI++FMxTIsSFvNJoYrUbodHgKJHZmH1 gA06f1UTOVcUalQZL/iu/7dIIaZqM35AZcswBURTo8NIqz4a0lZu9vvighD6hQCT5rq0WpRULFG BeROsl1oqr5XOyS/Uh8Jjs67SpXtnHpUFWcqiHJAXNWN/WbPzPdKCaNvqYyehi+zCO3U= X-Received: by 2002:a7b:c4c1:0:b0:41f:cc6f:d677 with SMTP id 5b1f17b1804b1-421089d7a05mr81333585e9.13.1716846515650; Mon, 27 May 2024 14:48:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErs+Dgc+UtXBYtB9nMjnNRP3zHSh7AVBEVpm/RoaBpfRLPIYdN9z2E2S/Dd5OxXzoLAPWNXg== X-Received: by 2002:a7b:c4c1:0:b0:41f:cc6f:d677 with SMTP id 5b1f17b1804b1-421089d7a05mr81333515e9.13.1716846515006; Mon, 27 May 2024 14:48:35 -0700 (PDT) Received: from localhost (host86-153-169-45.range86-153.btcentralplus.com. [86.153.169.45]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4210896f442sm119820015e9.11.2024.05.27.14.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:48:34 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH 2/3] [gdb/symtab] Add debuginfod verbose level 2 In-Reply-To: <20240527141808.31563-2-tdevries@suse.de> References: <20240527141808.31563-1-tdevries@suse.de> <20240527141808.31563-2-tdevries@suse.de> Date: Mon, 27 May 2024 22:48:33 +0100 Message-ID: <87le3v9b9q.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=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Tom de Vries writes: > In print_outcome in debuginfod-support.c, download failures are not mentioned > if the errno is ENOENT, aka as "No such file or directory": > ... > static void > print_outcome (int fd, const char *desc, const char *fname) > { > if (fd < 0 && fd != -ENOENT) > { > ui_file *outstream = get_unbuffered (gdb_stdout); > gdb_printf (outstream, > _("Download failed: %s. Continuing without %s %ps.\n"), > safe_strerror (-fd), > desc, > styled_string (file_name_style.style (), fname)); > } > } I believe ENOENT is what we get back when the debuginfod server doesn't have anything to give us, in which case, in normal usage we prefer not to spam the user that the server couldn't help us. But I can see how this might be useful. There is some possible cross over here between a flag to make user commands more or less verbose, and the possibility of adding a 'set debug debuginfod on/off' option. When does "extra verbose user output" become "debug output only useful for GDB maintainers"? I'm not really sure what the answer is. Anyway, I figure we can always tweak these messages later if needed. So I'd be happy with these going in. Approved-By: Andrew Burgess Thanks, Andrew > ... > > Define a new debuginfod verbose level 2 at which also this type of download > failure is mentioned, and use it in the gdb.debuginfod test-cases, such that > we get the explicit: > ... > Downloading separate debug info for /lib64/ld-linux-x86-64.so.2...^M > Download failed: No such file or directory. Continuing without separate \ > debug info for /lib64/ld-linux-x86-64.so.2.^M > ... > > Tested on x86_64-linux. > --- > gdb/debuginfod-support.c | 2 +- > gdb/doc/gdb.texinfo | 4 +-- > .../build-id-no-debug-warning.exp | 6 +++- > gdb/testsuite/gdb.debuginfod/crc_mismatch.exp | 7 ++++- > .../gdb.debuginfod/fetch_src_and_symbols.exp | 31 ++++++++++++------- > 5 files changed, 33 insertions(+), 17 deletions(-) > > diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c > index 841b6f2078c..e65afb7523f 100644 > --- a/gdb/debuginfod-support.c > +++ b/gdb/debuginfod-support.c > @@ -288,7 +288,7 @@ debuginfod_is_enabled () > static void > print_outcome (int fd, const char *desc, const char *fname) > { > - if (fd < 0 && fd != -ENOENT) > + if (fd < 0 && (fd != -ENOENT || debuginfod_verbose >= 2)) > { > ui_file *outstream = get_unbuffered (gdb_stdout); > gdb_printf (outstream, > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 61f91ef4ad6..fa1812124c1 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -50330,8 +50330,8 @@ Display the list of URLs that @code{debuginfod} will attempt to query. > @item set debuginfod verbose > @itemx set debuginfod verbose @var{n} > Enable or disable @code{debuginfod}-related output. Use a non-zero value > -to enable and @code{0} to disable. @code{debuginfod} output is shown by > -default. > +to enable and @code{0} to disable. Higher values may produce more > +output. Set to @code{1} by default. > > @kindex show debuginfod verbose > @item show debuginfod verbose > diff --git a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp > index 25d800a378b..d63957ac05c 100644 > --- a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp > +++ b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp > @@ -142,9 +142,13 @@ proc_with_prefix local_debuginfod { } { > # GDB should now find the symbol and source files. > clean_restart > > - # Enable debuginfod and fetch the debuginfo. > + # Enable debuginfod. > gdb_test_no_output "set debuginfod enabled on" > > + # Be verbose about observed debuginfod behaviour. > + gdb_test_no_output "set debuginfod verbose 2" > + > + # Fetch the debuginfo. > # "separate debug info file has no debug info" warning should not be > # reported now because the correct debuginfo should be fetched from > # debuginfod. > diff --git a/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp b/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp > index 27069b580dc..6dcabf60357 100644 > --- a/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp > +++ b/gdb/testsuite/gdb.debuginfod/crc_mismatch.exp > @@ -114,8 +114,13 @@ proc_with_prefix local_debuginfod { } { > # GDB should now find the symbol and source files. > clean_restart > > - # Enable debuginfod and fetch the debuginfo. > + # Enable debuginfod. > gdb_test_no_output "set debuginfod enabled on" > + > + # Be verbose about observed debuginfod behaviour. > + gdb_test_no_output -nopass "set debuginfod verbose 2" > + > + # Fetch the debuginfo. > gdb_test "file $binfile" ".*Reading symbols from.*debuginfo.*" \ > "file [file tail $binfile] cmd on" > > diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > index 0fb752ff6bd..4d2f70261fe 100644 > --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > @@ -42,6 +42,13 @@ if { [gdb_compile "$sourcetmp" "${binfile}2" executable {debug build-id}] != "" > return -1 > } > > +proc clean_restart_local {{executable ""}} { > + clean_restart $executable > + > + # Be verbose about observed debuginfod behaviour. > + gdb_test_no_output -nopass "set debuginfod verbose 2" > +} > + > # Write some assembly that just has a .gnu_debugaltlink section. > # Copied from testsuite/gdb.dwarf2/dwzbuildid.exp. > proc write_just_debugaltlink {filename dwzname buildid} { > @@ -107,7 +114,7 @@ proc_with_prefix no_url { } { > setenv DEBUGINFOD_URLS "" > > # Test that GDB cannot find source without debuginfod. > - clean_restart $binfile > + clean_restart_local $binfile > gdb_test_no_output "set substitute-path $outputdir /dev/null" \ > "set substitute-path" > gdb_test "list" ".*No such file or directory.*" > @@ -126,7 +133,7 @@ proc_with_prefix no_url { } { > file rename -force $debuginfo $debugdir > > # Test that GDB cannot find symbols without debuginfod. > - clean_restart $binfile > + clean_restart_local $binfile > gdb_test "file" ".*No symbol file.*" > > set buildid "01234567890abcdef0123456" > @@ -150,14 +157,14 @@ proc_with_prefix no_url { } { > file rename -force ${binfile}_dwz.o $debugdir > > # Test that GDB cannot find dwz without debuginfod. > - clean_restart > + clean_restart_local > gdb_test "file ${binfile}_alt.o" \ > ".*could not find '.gnu_debugaltlink'.*" \ > "file [file tail ${binfile}_alt.o]" > > # Generate a core file and test that GDB cannot find the > # executable. > - clean_restart ${binfile}2 > + clean_restart_local ${binfile}2 > if ![runto_main] { > return -1 > } > @@ -169,7 +176,7 @@ proc_with_prefix no_url { } { > "file [file tail $::corefile] gen" > file rename -force ${binfile}2 $debugdir > > - clean_restart > + clean_restart_local > gdb_test "core $::corefile" ".*in ?? ().*" "file [file tail $::corefile]" > } > > @@ -180,7 +187,7 @@ proc_with_prefix no_url { } { > > proc test_urls {urls pattern_re test} { > setenv DEBUGINFOD_URLS $urls > - clean_restart > + clean_restart_local > > if {$pattern_re != ""} { > set urls_re " +${pattern_re}\r\n" > @@ -222,7 +229,7 @@ proc_with_prefix local_url { } { > setenv DEBUGINFOD_URLS $url > > # GDB should now find the symbol and source files. > - clean_restart > + clean_restart_local > gdb_test_no_output "set debuginfod enabled on" \ > "enabled debuginfod for initial test" > gdb_load $binfile > @@ -248,12 +255,12 @@ proc_with_prefix local_url { } { > # GDB should now find the executable file. > set enable_debuginfod_question \ > "Enable debuginfod for this session. \\(y or \\\[n\\\]\\) " > - clean_restart > + clean_restart_local > gdb_test "core $::corefile" ".*return 0.*" "file [file tail $::corefile]" \ > $enable_debuginfod_question "y" > > # GDB should now find the debugaltlink file. > - clean_restart > + clean_restart_local > gdb_test "file ${binfile}_alt.o" \ > ".*Downloading.*separate debug info.*" \ > "file [file tail ${binfile}_alt.o]" \ > @@ -261,7 +268,7 @@ proc_with_prefix local_url { } { > > # Configure debuginfod with commands. > unsetenv DEBUGINFOD_URLS > - clean_restart > + clean_restart_local > gdb_test "file $binfile" ".*No debugging symbols.*" \ > "file [file tail $binfile] cmd" > gdb_test_no_output "set debuginfod enabled off" > @@ -282,7 +289,7 @@ proc_with_prefix local_url { } { > > # Empty URLS disables Debuginfod. > setenv DEBUGINFOD_URLS "" > - clean_restart > + clean_restart_local > # Disable confirmation to avoid having to deal with a query. See > # test_urls. > set file_cmd "with confirm off -- file $binfile" > @@ -297,7 +304,7 @@ proc_with_prefix local_url { } { > > # Whitespace-only URLS disables Debuginfod. > setenv DEBUGINFOD_URLS " " > - clean_restart > + clean_restart_local > gdb_test_multiple $file_cmd "notice whitespace URL" { > -re -wrap "This GDB supports auto-downloading.*" { > fail $gdb_test_name > -- > 2.35.3