From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id E0511385F009 for ; Mon, 27 May 2024 14:18:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0511385F009 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E0511385F009 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716819503; cv=none; b=wenxoJidnU8G/T/hyi+N7n6kqWd08vVA+lRE6g4EsQW3LF55W+XhFZt/NjpF0OIc9K74AUDV8hchmEYWTM7otrkkMWh40i7sX3JmDVVo4vuOYUK88nqgupbJqTUMwaN6Wsk6POT2DstxMKJ/m8TEsFGppSMLIED74Mjorum9yKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716819503; c=relaxed/simple; bh=hhdgEFcicxzuFeS8sHrRxPiaOpTPIpzdML8oQH1kHPk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=QJ3xXzMkjR2s6G71kczo+fUAjpX2eecZcfwVE/c2YZ9oc//EhrBLC7Wott4s7xMIRoYQQ3rRLyiwQbRhyW8tAeVsQMVFEzrFYuG7JEOsXve3wlab7+SPUVZaghxZA8eLWkFhGauP/so3i0Nrx+j0fe+EVKfoyN8/aYCdfe7FBWI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DE6C321A40 for ; Mon, 27 May 2024 14:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716819491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cFt2ha8MeQ1v3AJPZLsIxzsdsGmsx1kto70g6XUlKqU=; b=tKpJr6H/HocBdZd+DY323rCjCZPMwxt/e8tbW0Q0YhbRVitWY2/33A/SqkrJhCjAkqiM0w pFos/J5fnCjgJG8Hh4CgF4NXF0Pq260mC8ZH23GvE/yvNc5+rkfa1kq2H1fxFaRm5k+1+r 793YOzm3DTikyiVdz8BW4RHV5hBmDWc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716819491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cFt2ha8MeQ1v3AJPZLsIxzsdsGmsx1kto70g6XUlKqU=; b=w8vAgPWfKOyfAwk8yBYNvlhTjI4MuKjQH/OzCl9r2DgaIStTVCj3NEQIpfBQNksbRRP7af 1XZLcbH8DA26CBCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716819490; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cFt2ha8MeQ1v3AJPZLsIxzsdsGmsx1kto70g6XUlKqU=; b=IxkwwQ10cGhKWLeR9HJblVCpU9C8/67ixMbcw5A1QGdEZL83Cc5w2Oc0AfDhHfxeP5L034 RRY4f6qqG3XVqFqz8QvD+lxbc6KwiC58LjfxQ3G4gJj9BPNpgJlkRf8TqCnhO/1lyq4pHZ b/BLI4q+F/XwPyojdSgYclUaEhDBsKE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716819490; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cFt2ha8MeQ1v3AJPZLsIxzsdsGmsx1kto70g6XUlKqU=; b=a9JPE/yORf3edG/CgpsXGJu72ho0fhkGOe7ya2vjuG7Fn/BHY8rad2vcW9Q5wLcBn8GdaW I9Eswkx4UAZ2FPAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C773E13A87 for ; Mon, 27 May 2024 14:18:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6KRXLyKWVGbITwAAD6G6ig (envelope-from ) for ; Mon, 27 May 2024 14:18:10 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 2/3] [gdb/symtab] Add debuginfod verbose level 2 Date: Mon, 27 May 2024 16:18:07 +0200 Message-Id: <20240527141808.31563-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240527141808.31563-1-tdevries@suse.de> References: <20240527141808.31563-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,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: 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)); } } ... 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