to check again here. Since reopen_exec_file doesn't do anything
if the timestamp hasn't changed, I don't see the harm. */
reopen_exec_file ();
- reread_symbols ();
+ reread_symbols (from_tty);
gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (args, &async_exec);
args = stripped.get ();
else
{
reopen_exec_file ();
- reread_symbols ();
+ reread_symbols (from_tty);
}
/* Take any necessary post-attaching actions for this platform. */
remote_fileio_reset ();
reopen_exec_file ();
- reread_symbols ();
+ reread_symbols (from_tty);
remote_target *remote
= (extended_p ? new extended_remote_target () : new remote_target ());
/* 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)
/* 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;
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 ("");
extern bool find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
-extern void reread_symbols (void);
+extern void reread_symbols (int from_tty);
/* Look up a type named NAME in STRUCT_DOMAIN in the current language.
The type returned must not be opaque -- i.e., must have at least one field
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
if { [gdb_start_cmd] < 0 } {
fail "start second"
} else {
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" \
"second \\(\\) at .*second.adb.*" \
"start second"
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"
# 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.
gdb_rename_execfile ${binfile1} ${binfile}
gdb_load ${binfile}
- set readnow_p [readnow ${binfile}]
-
# Set a breakpoint at foo
gdb_test "break foo" \
unsupported $test
} else {
gdb_run_cmd
- if { $readnow_p } {
- setup_kfail "gdb/26800" *-*-*
- }
gdb_test "" "Breakpoint.* foo .* at .*:9.*" $test
}
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"
}