diff options
author | Tom de Vries <tdevries@suse.de> | 2021-12-07 07:51:25 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-12-07 07:51:25 +0100 |
commit | 9dec38d3b11c779e8f386050ed5046aaa4e759db (patch) | |
tree | 3be78ae3d32d3c789abb449740182b55293d0295 /gdb/symfile.c | |
parent | af5300fe24bf2f4e032d639a5396a16c1762b77b (diff) | |
download | gdb-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/symfile.c')
-rw-r--r-- | gdb/symfile.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 9e5c2d4..89469a3 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1797,7 +1797,7 @@ load_command (const char *arg, int from_tty) /* The user might be reloading because the binary has changed. Take this opportunity to check. */ reopen_exec_file (); - reread_symbols (); + reread_symbols (from_tty); std::string temp; if (arg == NULL) @@ -2411,7 +2411,7 @@ remove_symbol_file_command (const char *args, int from_tty) /* Re-read symbols if a symbol-file has changed. */ void -reread_symbols (void) +reread_symbols (int from_tty) { long new_modtime; struct stat new_statbuf; @@ -2588,6 +2588,19 @@ reread_symbols (void) read_symbols (objfile, 0); + if ((objfile->flags & OBJF_READNOW)) + { + const int mainline = objfile->flags & OBJF_MAINLINE; + const int should_print = (print_symbol_loading_p (from_tty, mainline, 1) + && readnow_symbol_files); + if (should_print) + printf_filtered (_("Expanding full symbols from %ps...\n"), + styled_string (file_name_style.style (), + objfile_name (objfile))); + + objfile->expand_all_symtabs (); + } + if (!objfile_has_symbols (objfile)) { wrap_here (""); |