aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2021-10-29 19:55:57 -0400
committerAaron Merey <amerey@redhat.com>2021-10-29 20:58:21 -0400
commit7811fa5995fcb68d30edc0f53d8823c011a12854 (patch)
treeba6410c7de6620c1e624bc2d0c80e10cfab746bb /gdb/testsuite
parent4a3a56c5f38f4772659a3efcb6ffd53d431a8fff (diff)
downloadgdb-7811fa5995fcb68d30edc0f53d8823c011a12854.zip
gdb-7811fa5995fcb68d30edc0f53d8823c011a12854.tar.gz
gdb-7811fa5995fcb68d30edc0f53d8823c011a12854.tar.bz2
gdb: add set/show commands for managing debuginfod
Add 'set debuginfod' command. Accepts 'on', 'off' or 'ask' as an argument. 'on' enables debuginfod for the current session. 'off' disables debuginfod for the current session. 'ask' will prompt the user to either enable or disable debuginfod when the next query is about to be performed: This GDB supports auto-downloading debuginfo from the following URLs: <URL1> <URL2> ... Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod on' to .gdbinit. For interactive sessions, 'ask' is the default. For non-interactive sessions, 'off' is the default. Add 'show debuginfod status' command. Displays whether debuginfod is set to 'on', 'off' or 'ask'. Add 'set/show debuginfod urls' commands. Accepts a string of space-separated debuginfod server URLs to be queried. The default value is copied from the DEBUGINFOD_URLS environment variable. Finally add 'set/show debuginfod verbose' commands to control whether debuginfod-related output is displayed. Verbose output is enabled by default. (gdb) run Starting program: /bin/sleep 5 Download failed: No route to host. Continuing without debug info for /lib64/libc.so.6. If GDB is not built with debuginfod then these commands will just display Support for debuginfod is not compiled into GDB.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp25
1 files changed, 22 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
index f8fcbba..92f3cd8 100644
--- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
+++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
@@ -222,7 +222,8 @@ proc local_url { } {
setenv DEBUGINFOD_URLS http://127.0.0.1:$port
# gdb should now find the symbol and source files
- clean_restart $binfile
+ clean_restart
+ gdb_test "file $binfile" "" "file [file tail $binfile]" "Enable debuginfod?.*" "y"
gdb_test_no_output "set substitute-path $outputdir /dev/null" \
"set substitute-path"
gdb_test "br main" "Breakpoint 1 at.*file.*"
@@ -231,8 +232,26 @@ proc local_url { } {
# gdb should now find the debugaltlink file
clean_restart
gdb_test "file ${binfile}_alt.o" \
- ".*Reading symbols from ${binfile}_alt.o\.\.\.*" \
- "file [file tail ${binfile}_alt.o]"
+ ".*Downloading.*separate debug info.*" \
+ "file [file tail ${binfile}_alt.o]" \
+ ".*Enable debuginfod?.*" "y"
+
+ # Configure debuginfod with commands
+ unsetenv DEBUGINFOD_URLS
+ clean_restart
+ gdb_test "file $binfile" ".*No debugging symbols.*" \
+ "file [file tail $binfile] cmd"
+ gdb_test_no_output "set debuginfod off"
+ gdb_test_no_output "set debuginfod urls http://127.0.0.1:$port"
+
+ # gdb shouldn't find the debuginfo since debuginfod has been disabled
+ gdb_test "file $binfile" ".*No debugging symbols.*" \
+ "file [file tail $binfile] cmd off"
+
+ # Enable debuginfod and fetch the debuginfo
+ gdb_test_no_output "set debuginfod on"
+ gdb_test "file $binfile" ".*Reading symbols from.*debuginfo.*" \
+ "file [file tail $binfile] cmd on"
}
set envlist \