[gdb/symtab] Support -readnow during reread
authorTom de Vries <tdevries@suse.de>
Tue, 7 Dec 2021 06:51:25 +0000 (07:51 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 7 Dec 2021 06:51:25 +0000 (07:51 +0100)
commit9dec38d3b11c779e8f386050ed5046aaa4e759db
tree3be78ae3d32d3c789abb449740182b55293d0295
parentaf5300fe24bf2f4e032d639a5396a16c1762b77b
[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
gdb/infcmd.c
gdb/remote.c
gdb/symfile.c
gdb/symtab.h
gdb/testsuite/gdb.ada/exec_changed.exp
gdb/testsuite/gdb.base/cached-source-file.exp
gdb/testsuite/gdb.base/reread.exp