This fixes the gdb.gdb tests to be parallel-safe, by ensuring that the
new "xgdb" file ends up in the standard output directory during the
tests.
2013-11-04 Tom Tromey <tromey@redhat.com>
* gdb.gdb/selftest.exp: Use standard_output_file.
* lib/selftest-support.exp (do_self_tests): Use
standard_output_file.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
Replace -nw option with $INTERNAL_GDBFLAGS in "xgdb" tests to
avoid spurious results due to ~/.gdbinit.
* gdb.gdb/complaint.exp (setup_test): Replace -nw option with
$INTERNAL_GDBFLAGS in run command.
* gdb.gdb/observer.exp (setup_test): Ditto.
* gdb.gdb/selftest.exp (test_with_self): Ditto.
* gdb.gdb/xfullpath.exp (setup_test): Ditto.
* NEWS: Describe new options --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
* main.c (struct cmdarg): New enum items CMDARG_INIT_FILE and
CMDARG_INIT_COMMAND.
(captured_main): New enum items OPT_IX and OPT_IEX. Add
"init-command", "init-eval-command", "ix" and "iex" to the variable
long_options. Handle OPT_IX and OPT_IEX. Process them from CMDARG_VEC.
New comment for CMDARG_FILE and CMDARG_COMMAND processing.
(print_gdb_help): Describe --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
gdb/doc/
* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
(Startup): Describe -iex and -ix. Simplify the example
for "set auto-load-scripts off".
gdb/testsuite/
* gdb.gdb/selftest.exp (do_steps_and_nexts): New entry
for cmdarg_vec = NULL. Remove entries for cmdsize = 1, cmdarg = and
ncmd = 0. New entry for VEC_cleanup cmdarg_s.
Consolidate code for displaying per-command time and space statistics to avoid
duplication. Piggyback on cleanups so that statistics get printed even when
commands terminate as a result of an error.
Changelog
* gdb/defs.h (make_command_stats_cleanup): Declare.
(set_display_time): Declare.
(set_display_space): Declare.
* gdb/event-top.c (command_handler): Use make_command_stats_cleanup.
* gdb/main.c (display_time, display_space): Move definitions to utils.c.
(captured_main): Use make_command_stats_cleanup to get start-up
statistics.
Use set_display_time and set_display_space for processing OPT_STATISTICS
case.
* gdb/maint.c (maintenance_time_display): Use set_display_time.
(maintenance_space_display): Use set_display_space.
* gdb/top.c (execute_command): Remove obsolete 'maint time' code.
(command_loop): Use make_command_stats_cleanup.
* gdb/utils.c (struct cmd_stats): Structure for storing initial time
and space usage.
(display_time, display_space): Move definitions here from utils.c.
(set_display_time): New function.
(set_display_space): New function.
(make_command_stats_cleanup): New function.
(report_command_stats): New auxiliary function for
make_command_stats_cleanup.
* gdb/testsuite/gdb.gdb/selftest.exp: Adjust expected message for
capturing start-up runtime.
* gdb.base/annota3.exp: Likewise.
* gdb.base/sigstep.exp (advancei): Fail if we hit the breakpoint
again (instead of timing out).
* gdb.gdb/selftest.exp (do_steps_and_nexts): Add an XFAIL for
GCC bug 26475.
* gdb.java/jmisc.exp: Adjust to work with method signatures including
return types. Add kfails for GDB bugs 2214 and 2215. Move exit
test from jmisc1.exp.
* gdb.java/jmisc1.exp: Delete.
* gdb.java/jprint.exp: Adjust to work with method signatures including
return types.
* gdb.objc/basicclass.exp: Update for gobjc 4.1 debug info.
* gdb.threads/linux-dp.exp: Don't be confused by program output.
* lib/java.exp (compile_java_from_source): Pass the correct type
to target_compile.
* lib/gdb.exp (gdb_file_cmd): Revert the return value to
previous simple convention. Use a global variable to store
information about what was found.
(gdb_run_cmd): Adapt to reverted return value.
* gdb.base/remote.exp: Adapt to reverted return value.
* gdb.gdb/complaints.exp: Likewise.
* gdb.gdb/observer.exp: Likewise.
* gdb.gdb/selftest.exp: Likewise.
* gdb.gdb/xfullpath.exp: Likewise.
With code from Manoj Iyer <manjo@austin.ibm.com>:
* lib/gdb.exp (gdb_file_cmd): Return more information in the
return value. Add an arm for "no debugging symbols found".
Change a stray "error" to "perror".
(gdb_run_cmd): Adapt to new return value.
* gdb.base/remote.exp: Adapt to new return value.
* gdb.gdb/complaints.exp: Likewise.
* gdb.gdb/observer.exp: Likewise.
* gdb.gdb/selftest.exp: Likewise.
* gdb.gdb/xfullpath.exp: Likewise.