aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-12-07 07:51:25 +0100
committerTom de Vries <tdevries@suse.de>2021-12-07 07:51:25 +0100
commit9dec38d3b11c779e8f386050ed5046aaa4e759db (patch)
tree3be78ae3d32d3c789abb449740182b55293d0295 /gdb/testsuite
parentaf5300fe24bf2f4e032d639a5396a16c1762b77b (diff)
downloadgdb-9dec38d3b11c779e8f386050ed5046aaa4e759db.zip
gdb-9dec38d3b11c779e8f386050ed5046aaa4e759db.tar.gz
gdb-9dec38d3b11c779e8f386050ed5046aaa4e759db.tar.bz2
[gdb/symtab] Support -readnow during reread
When running test-case gdb.base/cached-source-file.exp with target board readnow, we run into: ... FAIL: gdb.base/cached-source-file.exp: rerun program (the program exited) ... The problem is that when rereading, the readnow is ignored. Fix this by copying the readnow handling code from symbol_file_add_with_addrs to reread_symbols. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26800
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.ada/exec_changed.exp8
-rw-r--r--gdb/testsuite/gdb.base/cached-source-file.exp18
-rw-r--r--gdb/testsuite/gdb.base/reread.exp8
3 files changed, 11 insertions, 23 deletions
diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
index 8cbc29f..d08e1ce 100644
--- a/gdb/testsuite/gdb.ada/exec_changed.exp
+++ b/gdb/testsuite/gdb.ada/exec_changed.exp
@@ -51,8 +51,6 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_test "shell mv ${binfile} ${common_binfile}" ".*" ""
gdb_load ${common_binfile}
-set readnow_p [readnow ${common_binfile}]
-
# Start the program, we should land in the program main procedure
if { [gdb_start_cmd] < 0 } {
untested start
@@ -78,9 +76,6 @@ gdb_test "shell touch ${common_binfile}" ".*" ""
if { [gdb_start_cmd] < 0 } {
fail "start second"
} else {
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" \
"second \\(\\) at .*second.adb.*" \
"start second"
@@ -108,9 +103,6 @@ if { [gdb_start_cmd] < 0 } {
gdb_test_no_output "set \$check_gdb_running = 0" "check gdb running"
fail "start just first"
} else {
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" \
"first \\(\\) at .*first.adb.*" \
"start just first"
diff --git a/gdb/testsuite/gdb.base/cached-source-file.exp b/gdb/testsuite/gdb.base/cached-source-file.exp
index 13965d9..3b0166a 100644
--- a/gdb/testsuite/gdb.base/cached-source-file.exp
+++ b/gdb/testsuite/gdb.base/cached-source-file.exp
@@ -84,13 +84,17 @@ if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
# Rerun the program. This should not only force GDB to reload the
# source cache, but also to break at BP_LINE again, which now has
# different contents.
-gdb_test_multiple "run" "rerun program" {
- -re {The program being debugged has been started already\.\r\nStart it from the beginning\? \(y or n\) $} {
- set binregex [string_to_regexp $binfile]
- gdb_test "y" "\\`$binregex\\' has changed; re-reading symbols\.\r\nStarting program: ${binregex}.*" \
- "rerun program"
- }
-}
+set q \
+ [multi_line \
+ "The program being debugged has been started already\\." \
+ "Start it from the beginning\\? \\(y or n\\) "]
+set binregex [string_to_regexp $binfile]
+set re \
+ [multi_line \
+ "\\`$binregex\\' has changed; re-reading symbols\\.(" \
+ "Expanding full symbols from $binfile\\.\\.\\.)?" \
+ "Starting program: ${binregex}.*"]
+gdb_test "run" $re "rerun program" $q y
# Again, perform the listing and check that the line indeed has
# changed for GDB.
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
index 7ab30f2..3d4b484 100644
--- a/gdb/testsuite/gdb.base/reread.exp
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -60,8 +60,6 @@ foreach_with_prefix opts { "" "pie" } {
gdb_rename_execfile ${binfile1} ${binfile}
gdb_load ${binfile}
- set readnow_p [readnow ${binfile}]
-
# Set a breakpoint at foo
gdb_test "break foo" \
@@ -92,9 +90,6 @@ foreach_with_prefix opts { "" "pie" } {
unsupported $test
} else {
gdb_run_cmd
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" "Breakpoint.* foo .* at .*:9.*" $test
}
@@ -131,9 +126,6 @@ foreach_with_prefix opts { "" "pie" } {
gdb_rename_execfile ${binfile} ${binfile1}
gdb_rename_execfile ${binfile2} ${binfile}
gdb_run_cmd
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" "Breakpoint.* foo .* at .*:9.*" \
"second pass: run to foo() second time"
}