This patch is another attempt to fix PR cli/19551. Unlike my previous
attempt, it doesn't print progress. Instead, it just changes some
messages and adds newlines to make the output a bit nicer.
It also removes the "done." text that was previously emitted. The
idea here is that it is obvious when gdb is done reading debug info,
as it starts then doing something else; and that while this message
did not provide much benefit to users, it did make it harder to make
the output clean.
After this change the output from "./gdb -iex 'set complaint 1' -nx ./gdb"
reads:
Reading symbols from ./gdb...
.debug_ranges entry has start address of zero [in module /home/tromey/gdb/build/gdb/gdb]
DW_AT_low_pc 0x0 is zero for DIE at 0x17116c1 [in module /home/tromey/gdb/build/gdb/gdb]
.debug_line address at offset 0xa22f5 is 0 [in module /home/tromey/gdb/build/gdb/gdb]
During symbol reading, unsupported tag: 'DW_TAG_unspecified_type'.
During symbol reading, const value length mismatch for 'std::ratio<1,
1000000000>::num', got 8, expected 0.
gdb/ChangeLog
2018-10-04 Tom Tromey <tom@tromey.com>
PR cli/19551:
* symfile.c (symbol_file_add_with_addrs): Update output.
* psymtab.c (require_partial_symbols): Update output.
gdb/testsuite/ChangeLog
2018-10-04 Tom Tromey <tom@tromey.com>
PR cli/19551:
* lib/mi-support.exp (mi_gdb_file_cmd): Update.
* lib/gdb.exp (gdb_file_cmd): Update.
* gdb.stabs/weird.exp (print_weird_var): Update.
* gdb.server/solib-list.exp: Update.
* gdb.multi/remove-inferiors.exp (test_remove_inferiors): Update.
* gdb.mi/mi-cli.exp: Update.
* gdb.linespec/linespec.exp: Update.
* gdb.dwarf2/dw2-stack-boundary.exp: Update.
* gdb.dwarf2/dw2-objfile-overlap.exp: Update.
* gdb.cp/cp-relocate.exp: Update.
* gdb.base/sym-file.exp: Update.
* gdb.base/relocate.exp: Update.
* gdb.base/readnever.exp: Update.
* gdb.base/print-symbol-loading.exp (test_load_core): Update.
* gdb.base/kill-detach-inferiors-cmd.exp: Update.
* gdb.base/dbx.exp (gdb_file_cmd): Update.
* gdb.base/code_elim.exp: Update.
* gdb.base/break-unload-file.exp (test_break): Update.
* gdb.base/break-interp.exp (test_attach_gdb): Update.
* gdb.base/break-idempotent.exp (force_breakpoint_re_set):
Update.
* gdb.base/attach.exp (do_attach_tests): Update.
* gdb.base/sepdebug.exp: Update.
* gdb.python/py-section-script.exp: Update.
+2018-10-04 Tom Tromey <tom@tromey.com>
+
+ PR cli/19551:
+ * symfile.c (symbol_file_add_with_addrs): Update output.
+ * psymtab.c (require_partial_symbols): Update output.
+
2018-10-04 Tom Tromey <tom@tromey.com>
PR cli/22234:
if (objfile->sf->sym_read_psymbols)
{
if (verbose)
- {
- printf_filtered (_("Reading symbols from %s..."),
- objfile_name (objfile));
- gdb_flush (gdb_stdout);
- }
+ printf_filtered (_("Reading symbols from %s...\n"),
+ objfile_name (objfile));
(*objfile->sf->sym_read_psymbols) (objfile);
/* Partial symbols list are not expected to changed after this
objfile->global_psymbols.shrink_to_fit ();
objfile->static_psymbols.shrink_to_fit ();
- if (verbose)
- {
- if (!objfile_has_symbols (objfile))
- {
- wrap_here ("");
- printf_filtered (_("(no debugging symbols found)..."));
- wrap_here ("");
- }
-
- printf_filtered (_("done.\n"));
- }
+ if (verbose && !objfile_has_symbols (objfile))
+ printf_filtered (_("(No debugging symbols found in %s)\n"),
+ objfile_name (objfile));
}
}
if (deprecated_pre_add_symbol_hook)
deprecated_pre_add_symbol_hook (name);
else
- {
- printf_filtered (_("Reading symbols from %s..."), name);
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
+ printf_filtered (_("Reading symbols from %s...\n"), name);
}
syms_from_objfile (objfile, addrs, add_flags);
if ((flags & OBJF_READNOW))
{
if (should_print)
- {
- printf_filtered (_("expanding to full symbols..."));
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
+ printf_filtered (_("Expanding full symbols from %s...\n"), name);
if (objfile->sf)
objfile->sf->qf->expand_all_symtabs (objfile);
}
if (should_print && !objfile_has_symbols (objfile))
- {
- wrap_here ("");
- printf_filtered (_("(no debugging symbols found)..."));
- wrap_here ("");
- }
+ printf_filtered (_("(No debugging symbols found in %s)\n"), name);
if (should_print)
{
if (deprecated_post_add_symbol_hook)
deprecated_post_add_symbol_hook ();
- else
- printf_filtered (_("done.\n"));
}
/* We print some messages regardless of whether 'from_tty ||
+2018-10-04 Tom Tromey <tom@tromey.com>
+
+ PR cli/19551:
+ * lib/mi-support.exp (mi_gdb_file_cmd): Update.
+ * lib/gdb.exp (gdb_file_cmd): Update.
+ * gdb.stabs/weird.exp (print_weird_var): Update.
+ * gdb.server/solib-list.exp: Update.
+ * gdb.multi/remove-inferiors.exp (test_remove_inferiors): Update.
+ * gdb.mi/mi-cli.exp: Update.
+ * gdb.linespec/linespec.exp: Update.
+ * gdb.dwarf2/dw2-stack-boundary.exp: Update.
+ * gdb.dwarf2/dw2-objfile-overlap.exp: Update.
+ * gdb.cp/cp-relocate.exp: Update.
+ * gdb.base/sym-file.exp: Update.
+ * gdb.base/relocate.exp: Update.
+ * gdb.base/readnever.exp: Update.
+ * gdb.base/print-symbol-loading.exp (test_load_core): Update.
+ * gdb.base/kill-detach-inferiors-cmd.exp: Update.
+ * gdb.base/dbx.exp (gdb_file_cmd): Update.
+ * gdb.base/code_elim.exp: Update.
+ * gdb.base/break-unload-file.exp (test_break): Update.
+ * gdb.base/break-interp.exp (test_attach_gdb): Update.
+ * gdb.base/break-idempotent.exp (force_breakpoint_re_set):
+ Update.
+ * gdb.base/attach.exp (do_attach_tests): Update.
+ * gdb.base/sepdebug.exp: Update.
+ * gdb.python/py-section-script.exp: Update.
+
2018-10-04 Tom Tromey <tom@tromey.com>
PR cli/22234:
set test "set file, before attach1"
gdb_test_multiple "file $binfile" "$test" {
-re "Load new symbol table from.*y or n. $" {
- gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*" \
"$test (re-read)"
}
- -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $" {
pass "$test"
}
}
# executable's symbol table. This in turn always results in
# asking the user for actually loading the symbol table of the
# executable.
- gdb_test "y" "Reading symbols from $sysroot$escapedbinfile\.\.\.*done." \
+ gdb_test "y" "Reading symbols from $sysroot$escapedbinfile\.\.\.*" \
"$test (reset file)"
set found_exec_file 1
set test "load file manually, after attach2"
gdb_test_multiple "file $binfile" "$test" {
-re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $" {
- gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*" \
"$test (re-read)"
}
- -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $" {
pass "$test"
}
}
send_gdb "y\n"
exp_continue
}
- -re "Reading symbols from.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*$gdb_prompt $" {
pass $test
}
}
# Print the "PIE (Position Independent Executable) displacement" message.
gdb_test_no_output "set verbose on"
- gdb_test "file $file" "Reading symbols from .*done\\." "file"
+ gdb_test "file $file" "Reading symbols from .*" "file"
set test "attach"
gdb_test_multiple "attach $pid" $test {
send_gdb "y\n"
exp_continue
}
- -re "Reading symbols from.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*$gdb_prompt $" {
pass $test
}
}
gdb_start
gdb_test "symbol-file ${binfile1}" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
+ "Reading symbols from .*${testfile1}\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"symbol-file ${testfile1}"
with_test_prefix "single psymtabs" {
with_test_prefix "order1" {
gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile1}\\.\\.\\." \
"add-symbol-file ${testfile1} 0x100000" \
"add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
"y"
gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile2}\\.\\.\\." \
"add-symbol-file ${testfile2} 0x200000" \
"add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
"y"
with_test_prefix "order2" {
gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile2}\\.\\.\\." \
"add-symbol-file ${testfile2} 0x200000" \
"add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
"y"
gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile1}\\.\\.\\." \
"add-symbol-file ${testfile1} 0x100000" \
"add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
"y"
send_gdb "symbol-file $arg\n"
gdb_expect {
- -re "Reading symbols from.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into the $GDB"
send_gdb "exec-file $arg\n"
gdb_expect {
# Add another forked inferior process.
gdb_test "add-inferior" "Added inferior 2" "add inferior 2"
gdb_test "inferior 2" "Switching to inferior 2.*"
-gdb_test "file $binfile" "Reading symbols from .*done.*" "load binary"
+gdb_test "file $binfile" "Reading symbols from .*" "load binary"
gdb_test "start" "Temporary breakpoint.*Starting program.*"
# Add an attached inferior process.
gdb_reinitialize_dir $srcdir/$subdir
gdb_test_no_output "set print symbol-loading $print_symbol_loading"
if { ${print_symbol_loading} != "off" } {
- gdb_test "file $binfile" "Reading symbols from.*done\\." "file"
+ gdb_test "file $binfile" "Reading symbols from.*" "file"
} else {
gdb_test_no_output "file $binfile" "file"
}
gdb_exit
gdb_start
gdb_test "symbol-file ${binfile}0.o -readnever" \
- "Reading symbols from ${binfile}0\.o\.\.\.\\\(no debugging symbols found\\\)\.\.\.done\." \
+ "Reading symbols from ${binfile}0\.o\.\.\.\r\n\\\(No debugging symbols found in .*\\\)" \
"use symbol-file -readnever"
gdb_test_no_output "maint info symtabs" \
# Since we're here, might as well test the 'symbol-file' command and
# if its arguments can also be passed at any position.
gdb_test "symbol-file -readnow $binfile" \
- "Reading symbols from ${binfile}\.\.\.expanding to full symbols\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\.\r\nExpanding full symbols from ${binfile}\.\.\." \
"symbol-file with -readnow first"
clean_restart
gdb_test "symbol-file $binfile -readnow" \
- "Reading symbols from ${binfile}\.\.\.expanding to full symbols\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\.\r\nExpanding full symbols from ${binfile}\.\.\." \
"symbol-file with -readnow second"
gdb_test "symbol-file -readnow" \
"no symbol file name was specified" \
"symbol-file with -- disables option processing"
clean_restart
gdb_test "symbol-file -readnow -- $binfile" \
- "Reading symbols from ${binfile}\.\.\.expanding to full symbols\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\.\r\nExpanding full symbols from ${binfile}\.\.\." \
"symbol-file with -- and -readnow"
gdb_test "symbol-file -- $binfile -readnow" \
"Unrecognized argument \"-readnow\"" \
# Load the object file.
gdb_test "add-symbol-file ${binfile} 0" \
- "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"add-symbol-file ${testfile}.o 0" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x0\[\r\n\]+\\(y or n\\) " \
"y"
# Load the object file.
gdb_test "add-symbol-file ${binfile} \$offset" \
- "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"add-symbol-file ${testfile}.o \$offset" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x10000\[\r\n\]+\\(y or n\\) " \
"y"
set offset 0x10000
clean_restart
gdb_test "symbol-file -o $offset $binfile" \
- "Reading symbols from ${binfile}\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\." \
"symbol-file with offset"
# Make sure the address of a static variable is moved by offset.
set offset 0x10000
clean_restart
gdb_test "add-symbol-file -o $offset $binfile" \
- "Reading symbols from ${binfile}\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\." \
"add-symbol-file with offset" \
"add symbol table from file \".*${testfile}\\.o\" with all sections offset by $offset\[\r\n\]+\\(y or n\\) " \
"y"
set text [ format "0x%x" [expr ${function_foo_addr} + 0x20000] ]
clean_restart
gdb_test "add-symbol-file $binfile -o $offset $text" \
- "Reading symbols from ${binfile}\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\." \
"add-symbol-file with offset, text address given" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = ${text}\[\r\n\]+with other sections offset by ${offset}\[\r\n\]+\\(y or n\\) " \
"y"
set data [ format "0x%x" [expr ${global_foo_addr} + 0x20000] ]
clean_restart
gdb_test "add-symbol-file $binfile -o $offset -s .data $data" \
- "Reading symbols from ${binfile}\.\.\.done\." \
+ "Reading symbols from ${binfile}\.\.\." \
"add-symbol-file with offset, data address given" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.data_addr = ${data}\[\r\n\]+with other sections offset by ${offset}\[\r\n\]+\\(y or n\\) " \
"y"
set escapedobjdirsubdir [string_to_regexp [standard_output_file {}]]
- gdb_test "file [standard_output_file sepdebug2]" "warning: the debug information found in \"${escapedobjdirsubdir}/sepdebug2\\.debug\" does not match \"${escapedobjdirsubdir}/sepdebug2\" \\(CRC mismatch\\)\\..*\\(no debugging symbols found\\).*" "CRC mismatch is reported"
+ gdb_test "file [standard_output_file sepdebug2]" "warning: the debug information found in \"${escapedobjdirsubdir}/sepdebug2\\.debug\" does not match \"${escapedobjdirsubdir}/sepdebug2\" \\(CRC mismatch\\)\\..*\\(No debugging symbols found in .*\\).*" "CRC mismatch is reported"
}
# 3) Add the library's symbols using 'add-symbol-file'.
set result [gdb_test "add-symbol-file ${lib_syms} addr" \
- "Reading symbols from .*${lib_syms}\\.\\.\\.done\\." \
+ "Reading symbols from .*${lib_syms}\\.\\.\\." \
"add-symbol-file ${lib_basename}.so addr" \
"add symbol table from file \".*${lib_basename}\\.so\"\
at.*\\(y or n\\) " \
# Load the library's symbols.
gdb_test "add-symbol-file ${lib_syms} addr" \
- "Reading symbols from .*${lib_syms}\\.\\.\\.done\\." \
+ "Reading symbols from .*${lib_syms}\\.\\.\\." \
"add-symbol-file ${lib_basename}.so addr" \
"add symbol table from file \".*${lib_syms}\"\
at.*\\(y or n\\) " \
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x10000 -s ${func2_sec} 0x20000" \
- "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"add-symbol-file ${testfile}.o" \
"add symbol table from file \".*${testfile}\\.o\" at.*\\(y or n\\) " \
"y"
clean_restart $executable_outer
gdb_test "add-symbol-file $binfile_inner outer_inner" \
- {Reading symbols from .*\.\.\.done\.} "add-symbol-file" \
+ {Reading symbols from .*\.\.\.} "add-symbol-file" \
"\r\n\t\\.text_addr = 0x\[0-9a-f\]+\r\n\\(y or n\\) \$" "y"
# Expand symtab for ${binfile_outer}.
}
}
gdb_test_no_output "set complaints 100"
-gdb_test "file $binfile" {Reading symbols from .*\.\.\.location description stack underflow\r\nlocation description stack overflow\r\ndone\.} "check partial symtab errors"
+gdb_test "file $binfile" {Reading symbols from .*\.\.\.\r\nlocation description stack underflow\r\nlocation description stack overflow} "check partial symtab errors"
gdb_test "p underflow" {Asked for position 0 of stack, stack only has 0 elements on it\.}
gdb_test "p overflow" " = 2"
# Note that in particular this should not cause errors when re-setting
# breakpoints.
gdb_test "file $binfile" \
- "Reading symbols from .*done." \
+ "Reading symbols from .*" \
"set the new inferior file for linespec tests"
gdb_test "break main" \
# {(=.*)+\^done} \
# "-interpreter-exec console \"file \$binfile\""
mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
- {~"Reading symbols from .*mi-cli...".*\^done} \
+ {~"Reading symbols from .*mi-cli...\\n".*} \
"-interpreter-exec console \"file \$binfile\""
mi_run_to_main
# Load binfile and start the inferior.
set binfile_re [string_to_regexp ${binfile}]
gdb_test "file ${binfile}" \
- "Reading symbols from ${binfile_re}...done." \
+ "Reading symbols from ${binfile_re}..." \
"load binary"
if {![runto_main]} {
-re "\r\nwarning: Invalid entry in \\.debug_gdb_scripts section.*\r\n$gdb_prompt $" {
fail $test
}
- -re "done\\.\r\n$gdb_prompt $" {
+ -re "\r\n$gdb_prompt $" {
pass $test
}
}
# but before "target remote" below so that qSymbol data get already
# initialized from BINFILE (and not from ld.so first needing a change to
# BINFILE later).
- gdb_test "file ${binfile}" {Reading symbols from .*\.\.\.done\..*} "file binfile" \
+ gdb_test "file ${binfile}" {Reading symbols from .*\.\.\..*} "file binfile" \
{(Are you sure you want to change the file|Load new symbol table from ".*")\? \(y or n\) } "y"
set test "target $gdbserver_protocol"
send_gdb "y\n"
exp_continue
}
- -re "^Reading symbols from .*$binfile_re\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" {
+ -re "^Reading symbols from .*$binfile_re\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" {
pass "weirdx.o read without error"
}
-re ".*$gdb_prompt $" {
send_gdb "file $arg\n"
gdb_expect 120 {
- -re "Reading symbols from.*LZMA support was disabled.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*LZMA support was disabled.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into $GDB; .gnu_debugdata found but no LZMA available"
set gdb_file_cmd_debug_info "lzma"
return 0
}
- -re "Reading symbols from.*no debugging symbols found.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*no debugging symbols found.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into $GDB with no debugging symbols"
set gdb_file_cmd_debug_info "nodebug"
return 0
}
- -re "Reading symbols from.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into $GDB"
set gdb_file_cmd_debug_info "debug"
return 0
-re "Load new symbol table from \".*\".*y or n. $" {
send_gdb "y\n"
gdb_expect 120 {
- -re "Reading symbols from.*done.*$gdb_prompt $" {
+ -re "Reading symbols from.*$gdb_prompt $" {
verbose "\t\tLoaded $arg with new symbol table into $GDB"
set gdb_file_cmd_debug_info "debug"
return 0
# output. Queries are an error for mi.
send_gdb "105-file-exec-and-symbols $arg\n"
gdb_expect 120 {
- -re "Reading symbols from.*done.*$mi_gdb_prompt$" {
+ -re "Reading symbols from.*$mi_gdb_prompt$" {
verbose "\t\tLoaded $arg into the $GDB"
return 0
}
-re "Load new symbol table from \".*\".*y or n. $" {
send_gdb "y\n"
gdb_expect 120 {
- -re "Reading symbols from.*done.*$mi_gdb_prompt$" {
+ -re "Reading symbols from.*$mi_gdb_prompt$" {
verbose "\t\tLoaded $arg with new symbol table into $GDB"
# All OK
}