Commit Graph

53 Commits

Author SHA1 Message Date
Tom Tromey 3453e7e409 Clean up "Reading symbols" output
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 13:40:10 -06:00
Andreas Arnez 079670b94a Testsuite: fully migrate to use_gdb_stub convenience func
In the GDB test suite, there are still multiple invocations of
"target_info exists use_gdb_stub".  However, the recommended way of
checking for use_gdb_stub is to call the convenience function of the same
name.

Replace these occurrences and just call "use_gdb_stub" instead.

gdb/testsuite/ChangeLog:

	* gdb.ada/exec_changed.exp: Replace "target_info exists
	use_gdb_stub" by "use_gdb_stub".
	* gdb.ada/start.exp: Likewise.
	* gdb.base/async-shell.exp: Likewise.
	* gdb.base/attach-pie-misread.exp: Likewise.
	* gdb.base/attach-wait-input.exp: Likewise.
	* gdb.base/break-entry.exp: Likewise.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/dprintf-detach.exp: Likewise.
	* gdb.base/nostdlib.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* gdb.base/statistics.exp: Likewise.
	* gdb.base/testenv.exp: Likewise.
	* gdb.mi/mi-exec-run.exp: Likewise.
	* gdb.mi/mi-start.exp: Likewise.
	* gdb.multi/dummy-frame-restore.exp: Likewise.
	* gdb.multi/multi-arch-exec.exp: Likewise.
	* gdb.multi/multi-arch.exp: Likewise.
	* gdb.multi/tids.exp: Likewise.
	* gdb.multi/watchpoint-multi.exp: Likewise.
	* gdb.python/py-events.exp: Likewise.
	* gdb.threads/attach-into-signal.exp: Likewise.
	* gdb.threads/attach-stopped.exp: Likewise.
	* gdb.threads/threadapply.exp: Likewise.
	* lib/selftest-support.exp: Likewise.
2018-03-23 10:38:23 +01:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Yao Qi dc196b230b [testsuite] Pass -pie in ldflags
-pie is a linker flag, it should be passed via "ldflags", instead
of "additional_flags".  Otherwise, clang complains,

clang: warning: argument unused during compilation: '-pie'

gdb/testsuite:

2017-11-22  Yao Qi  <yao.qi@linaro.org>

	* gdb.base/attach-pie-noexec.exp: Pass "-pie" in ldflags.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/jit-attach-pie.exp: Likewise.
2017-11-22 14:35:01 +00:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Pedro Alves 2c8c5d375e testsuite: tcl exec& -> 'kill -9 $pid' is racy (attach-many-short-lived-thread.exp races and others)
The buildbots show that attach-many-short-lived-thread.exp is racy.
But after staring at debug logs and playing with SystemTap scripts for
a (long) while, I figured out that neither GDB, nor the kernel nor the
test's program itself are at fault.

The problem is simply that the testsuite machinery is currently
subject to PID-reuse races.  The attach-many-short-lived-threads.c
test program just happens to be much more susceptible to trigger this
race because threads and processes share the same number space on
Linux, and the test spawns many many short lived threads in
succession, thus enlarging the race window a lot.

Part of the problem is that several tests spawn processes with "exec&"
(in order to test the "attach" command) , and then at the end of the
test, to make sure things are cleaned up, issue a 'remote_spawn "kill
-p $testpid"'.  Since with tcl's "exec&", tcl itself is responsible
for reaping the process's exit status, when we go kill the process,
testpid may have already exited _and_ its status may have (and often
has) been reaped already.  Thus it can happen that another process
meanwhile reuses $testpid, and that "kill" command kills the wrong
process...  Frequently, that happens to be
attach-many-short-lived-thread, but this explains other test's races
as well.

In the attach-many-short-lived-threads test, it sometimes manifests
like this:

 (gdb) file /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads
 Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads...done.
 (gdb)           Loaded /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads into /home/pedro/gdb/mygit/build/gdb/testsuite/../../gdb/gdb
 attach 5940
 Attaching to program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads, process 5940
 warning: process 5940 is a zombie - the process has already terminated
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ptrace: Operation not permitted.
 (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: attach
 info threads
 No threads.
 (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: no new threads
 set breakpoint always-inserted on
 (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set breakpoint always-inserted on

Other times the process dies while the test is ongoing (the process is
ptrace-stopped):

 (gdb) print again = 1
 Cannot access memory at address 0x6020cc
 (gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 2: reset timer in the inferior

(Recall that on Linux, SIGKILL is not interceptable)

And other times it dies just while we're detaching:

 $4 = 319
 (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 2: print seconds_left
 detach
 Can't detach Thread 0x7fb13b7de700 (LWP 1842): No such process
 (gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 2: detach

GDB mishandles the latter (it should ignore ESRCH while detaching just
like when continuing), but that's another story.

The fix here is to change spawn_wait_for_attach to use Expect's
'spawn' command instead of Tcl's 'exec&' to spawn programs, because
with spawn we control when to wait for/reap the process.  That allows
killing the process by PID without being subject to pid-reuse races,
because even if the process is already dead, the kernel won't reuse
the process's PID until the zombie is reaped.

The other part of the problem lies in DejaGnu itself, unfortunately.
I have occasionally seen tests (attach-many-short-lived-threads
included, but not only that one) die with a random inexplicable
SIGTERM too, and that too is caused by the same reason, except that in
that case, the rogue SIGTERM is sent from this bit in DejaGnu's remote.exp:

    exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"
    ...
    catch "wait -i $shell_id"

Even if the program exits promptly, that whole cascade of kills
carries on in the background, thus potentially killing the poor
process that manages to reuse $pid...

I sent a fix for that to the DejaGnu list:
 http://lists.gnu.org/archive/html/dejagnu/2015-07/msg00000.html

With both patches in place, I haven't seen
attach-many-short-lived-threads.exp fail again.

Tested on x86_64 Fedora 20, native, gdbserver and extended-gdbserver.

gdb/testsuite/ChangeLog:
2015-07-31  Pedro Alves  <palves@redhat.com>

	* gdb.base/attach-pie-misread.exp: Rename $res to $test_spawn_id.
	Use spawn_id_get_pid.  Wait for spawn id after eof.  Use
	kill_wait_spawned_process instead of explicit "kill -9".
	* gdb.base/attach-pie-noexec.exp: Adjust to spawn_wait_for_attach
	returning a spawn id instead of a pid.  Use spawn_id_get_pid and
	kill_wait_spawned_process.
	* gdb.base/attach-twice.exp: Likewise.
	* gdb.base/attach.exp: Likewise.
	(do_command_attach_tests): Use gdb_spawn_with_cmdline_opts and
	gdb_test_multiple.
	* gdb.base/solib-overlap.exp: Adjust to spawn_wait_for_attach
	returning a spawn id instead of a pid.  Use spawn_id_get_pid and
	kill_wait_spawned_process.
	* gdb.base/valgrind-infcall.exp: Likewise.
	* gdb.multi/multi-attach.exp: Likewise.
	* gdb.python/py-prompt.exp: Likewise.
	* gdb.python/py-sync-interp.exp: Likewise.
	* gdb.server/ext-attach.exp: Likewise.
	* gdb.threads/attach-into-signal.exp (corefunc): Use
	spawn_wait_for_attach, spawn_id_get_pid and
	kill_wait_spawned_process.
	* gdb.threads/attach-many-short-lived-threads.exp: Adjust to
	spawn_wait_for_attach returning a spawn id instead of a pid.  Use
	spawn_id_get_pid and kill_wait_spawned_process.
	* gdb.threads/attach-stopped.exp (corefunc): Use
	spawn_wait_for_attach, spawn_id_get_pid and
	kill_wait_spawned_process.
	* gdb.base/break-interp.exp: Rename $res to $test_spawn_id.
	Use spawn_id_get_pid.  Wait for spawn id after eof.  Use
	kill_wait_spawned_process instead of explicit "kill -9".
	* lib/gdb.exp (can_spawn_for_attach): Adjust comment.
	(kill_wait_spawned_process, spawn_id_get_pid): New procedures.
	(spawn_wait_for_attach): Use spawn instead of exec to spawn
	processes.  Don't map cygwin/windows pids here.  Now returns a
	spawn id list.
2015-07-31 20:06:24 +01:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Doug Evans 0295a32e39 * gdb.base/break-interp.exp: Fix indentation. 2013-09-16 23:42:58 +00:00
Tom Tromey a64d25307d test suite update - gdb.base/[ab]
Convert files gdb.base/[ab]*.exp to use standard_output_file et al.

	* a2-run.exp, all-bin.exp, annota1.exp, annota3.exp, anon.exp,
	args.exp, arithmet.exp, arrayidx.exp, assign.exp, async-shell.exp,
	async.exp, attach-pie-misread.exp, attach-pie-noexec.exp,
	attach-twice.exp, attach.exp, auxv.exp, bang.exp, bfp-test.exp,
	bigcore.exp, bitfields.exp, bitfields2.exp, break-entry.exp,
	break-interp.exp, break-on-linker-gcd-function.exp,
	breakpoint-shadow.exp: Use standard_testfile,
	standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:47:53 +00:00
Pedro Alves 4ec7020176 Remove superfluous semicolons from testsuite throughout.
A few months ago semicolons after "return" were removed throughout the
testsuite.  However, as I pointed out in review, they're unnecessary
not just after "return", but pretty much after any tcl command.  ';'
is the command separator, and you only need it if there's another
command on the same line afterwards.

This patch was written by running:

 $ find . -name "*.exp" | xargs grep -l ";\s*$" | xargs sed -i 's/\([^#][^\s*;]*\)\s*;\s*$/\1/'

and then undoing changes to comments, and lib/future.exp.

Tested on x86_64 Fedora 17.

gdb/testsuite/
2013-06-07  Pedro Alves  <palves@redhat.com>

	* boards/native-extended-gdbserver.exp: Remove semicolon.
	* config/arm-ice.exp: Likewise.
	* config/bfin.exp: Likewise.
	* config/cygmon.exp: Likewise.
	* config/h8300.exp: Likewise.
	* config/monitor.exp: Likewise.
	* config/sid.exp: Likewise.
	* config/sim.exp: Likewise.
	* config/slite.exp: Likewise.
	* config/vx.exp: Likewise.
	* gdb.arch/i386-bp_permanent.exp: Likewise.
	* gdb.asm/asm-source.exp: Likewise.
	* gdb.base/args.exp: Likewise.
	* gdb.base/attach-pie-misread.exp: Likewise.
	* gdb.base/auxv.exp: Likewise.
	* gdb.base/bigcore.exp: Likewise.
	* gdb.base/bitfields2.exp: Likewise.
	* gdb.base/bitfields.exp: Likewise.
	* gdb.base/break.exp: Likewise.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/callfuncs.exp: Likewise.
	* gdb.base/call-sc.exp: Likewise.
	* gdb.base/commands.exp: Likewise.
	* gdb.base/corefile.exp: Likewise.
	* gdb.base/dbx.exp: Likewise.
	* gdb.base/ending-run.exp: Likewise.
	* gdb.base/exprs.exp: Likewise.
	* gdb.base/funcargs.exp: Likewise.
	* gdb.base/hbreak2.exp: Likewise.
	* gdb.base/huge.exp: Likewise.
	* gdb.base/list.exp: Likewise.
	* gdb.base/memattr.exp: Likewise.
	* gdb.base/overlays.exp: Likewise.
	* gdb.base/printcmds.exp: Likewise.
	* gdb.base/recurse.exp: Likewise.
	* gdb.base/remotetimeout.exp: Likewise.
	* gdb.base/reread.exp: Likewise.
	* gdb.base/savedregs.exp: Likewise.
	* gdb.base/scope.exp: Likewise.
	* gdb.base/sepdebug.exp: Likewise.
	* gdb.base/setshow.exp: Likewise.
	* gdb.base/setvar.exp: Likewise.
	* gdb.base/sigaltstack.exp: Likewise.
	* gdb.base/siginfo-addr.exp: Likewise.
	* gdb.base/siginfo.exp: Likewise.
	* gdb.base/siginfo-obj.exp: Likewise.
	* gdb.base/sigrepeat.exp: Likewise.
	* gdb.base/sigstep.exp: Likewise.
	* gdb.base/structs.exp: Likewise.
	* gdb.base/testenv.exp: Likewise.
	* gdb.base/twice.exp: Likewise.
	* gdb.base/valgrind-db-attach.exp: Likewise.
	* gdb.base/valgrind-infcall.exp: Likewise.
	* gdb.base/varargs.exp: Likewise.
	* gdb.base/watchpoint.exp: Likewise.
	* gdb.cp/gdb1355.exp: Likewise.
	* gdb.cp/misc.exp: Likewise.
	* gdb.disasm/hppa.exp: Likewise.
	* gdb.disasm/t01_mov.exp: Likewise.
	* gdb.disasm/t02_mova.exp: Likewise.
	* gdb.disasm/t03_add.exp: Likewise.
	* gdb.disasm/t04_sub.exp: Likewise.
	* gdb.disasm/t05_cmp.exp: Likewise.
	* gdb.disasm/t06_ari2.exp: Likewise.
	* gdb.disasm/t07_ari3.exp: Likewise.
	* gdb.disasm/t08_or.exp: Likewise.
	* gdb.disasm/t09_xor.exp: Likewise.
	* gdb.disasm/t10_and.exp: Likewise.
	* gdb.disasm/t11_logs.exp: Likewise.
	* gdb.disasm/t12_bit.exp: Likewise.
	* gdb.disasm/t13_otr.exp: Likewise.
	* gdb.gdb/selftest.exp: Likewise.
	* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
	* gdb.mi/mi-reverse.exp: Likewise.
	* gdb.pascal/floats.exp: Likewise.
	* gdb.python/py-inferior.exp: Likewise.
	* gdb.threads/attach-into-signal.exp: Likewise.
	* gdb.threads/pthreads.exp: Likewise.
	* gdb.threads/thread_events.exp: Likewise.
	* gdb.threads/watchthreads.exp: Likewise.
	* gdb.trace/actions-changed.exp: Likewise.
	* gdb.trace/actions.exp: Likewise.
	* gdb.trace/ax.exp: Likewise.
	* gdb.trace/backtrace.exp: Likewise.
	* gdb.trace/change-loc.exp: Likewise.
	* gdb.trace/deltrace.exp: Likewise.
	* gdb.trace/disconnected-tracing.exp: Likewise.
	* gdb.trace/ftrace.exp: Likewise.
	* gdb.trace/infotrace.exp: Likewise.
	* gdb.trace/passc-dyn.exp: Likewise.
	* gdb.trace/passcount.exp: Likewise.
	* gdb.trace/pending.exp: Likewise.
	* gdb.trace/qtro.exp: Likewise.
	* gdb.trace/range-stepping.exp: Likewise.
	* gdb.trace/report.exp: Likewise.
	* gdb.trace/save-trace.exp: Likewise.
	* gdb.trace/status-stop.exp: Likewise.
	* gdb.trace/strace.exp: Likewise.
	* gdb.trace/tfile.exp: Likewise.
	* gdb.trace/tfind.exp: Likewise.
	* gdb.trace/trace-break.exp: Likewise.
	* gdb.trace/tracecmd.exp: Likewise.
	* gdb.trace/trace-mt.exp: Likewise.
	* gdb.trace/tspeed.exp: Likewise.
	* gdb.trace/tsv.exp: Likewise.
	* gdb.trace/while-stepping.exp: Likewise.
	* lib/gdb.exp: Likewise.
	* lib/gdbserver-support.exp: Likewise.
	* lib/java.exp: Likewise.
	* lib/mi-support.exp: Likewise.
	* lib/pascal.exp: Likewise.
	* lib/prompt.exp: Likewise.
	* lib/trace-support.exp: Likewise.
2013-06-07 17:31:09 +00:00
Gary Benson a29a3fb7a3 2013-06-04 Jan Kratochvil <jan.kratochvil@redhat.com>
Gary Benson  <gbenson@redhat.com>

	* lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthread,
	gdb_compile_shlib or gdb_compile_shlib_pthreads where appropriate.
	* lib/prelink-support.exp (build_executable_own_libs): Allow INTERP
	to be set to "no" to indicate that no ld.so copy should be made.
	* gdb.base/break-interp.exp (solib_bp): New constant.
	(reach_1): Use the above instead of "_dl_debug_state".
	(test_attach): Likewise.
	(test_ld): Likewise.
	* gdb.threads/dlopen-libpthread.exp: New file.
	* gdb.threads/dlopen-libpthread.c: Likewise.
	* gdb.threads/dlopen-libpthread-lib.c: Likewise.
	* gdb.base/solib-corrupted.exp: Disable test if GDB is using probes.
2013-06-04 13:23:32 +00:00
Yao Qi 0a251e08fa gdb/testsuite/
* gdb.threads/non-ldr-exc-1.exp (do_test): Fix the indent of
	using with_test_prefix.
	* gdb.threads/non-ldr-exc-2.exp (do_test): Likewise.
	* gdb.threads/non-ldr-exc-3.exp (do_test): Likewise.
	* gdb.threads/non-ldr-exc-4.exp (do_test): Likewise.
	* gdb.threads/watchpoint-fork.exp (test): Likewise.
	* gdb.base/break-interp.exp (test_core): Likewise.
	(test_attach_gdb): Likewise.
	* gdb.base/catch-load.exp (one_catch_load_test): Likewise.
	* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
	Likewise.
	* gdb.base/jit-so.exp (one_jit_test): Likewise.
	* gdb.base/jit.exp (one_jit_test): Likewise.
	* gdb.base/sepdebug.exp (test_different_dir): Likewise.
	* gdb.dwarf2/dw2-dir-file-name.exp (test): Likewise.
	* gdb.dwarf2/dw2-noloc.exp (file_symbols): Likewise.
	* gdb.mi/mi-breakpoint-changed.exp (test_pending_resolved):
	Likewise.
	* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
	Likewise.
	* gdb.mi/mi-watch.exp test_watchpoint_all): Likewise.
	* gdb.mi/pr11022.exp (test_memory_changed_observer): Likewise.
	* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Likewise.
	(tracepoint_change_loc_2): Likewise.
	* gdb.trace/disconnected-tracing.exp (disconnected_tracing):
	Likewise.
	(disconnected_tfind): Likewise.
	* gdb.trace/mi-traceframe-changed.exp (test_tfind_tfile):
	Likewise.
	(test_tfind_remote): Likewise.
	* gdb.trace/mi-tracepoint-changed.exp (test_reconnect):
	Likewise.
	(test_pending_resolved): Likewise.
	* gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv):
	Likewise.
	(test_upload_tsv): Likewise.
	* gdb.trace/pending.exp (pending_tracepoint_resolved):
	Likewise.
	(pending_tracepoint_works): Likewise.
	* gdb.trace/report.exp (use_collected_data): Likewise.
	* gdb.trace/status-stop.exp (test_tstart_tstop_tstart):
	Likewise.
	(test_tstart_tstart, test_buffer_full_tstart): Likewise.
	* gdb.trace/strace.exp (strace_info_marker): Likewise.
	(strace_trace_on_same_addr): Likewise.
	(strace_trace_on_diff_addr): Likewise.
	* gdb.trace/unavailable.exp (gdb_collect_args_test): Likewise.
	(gdb_collect_locals_test): Likewise.
	(gdb_unavailable_registers_test): Likewise.
	(gdb_collect_globals_test): Likewise.
2013-03-15 01:41:29 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
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.
2013-01-01 06:33:28 +00:00
Tom Tromey 4c93b1dbf4 * lib/gdb.exp (skip_altivec_tests, skip_vsx_tests)
(build_executable): Update.
	(get_compiler_info): Remove 'binfile' argument.
	* gdb.ada/arrayidx.exp: Update.
	* gdb.ada/null_array.exp: Update.
	* gdb.arch/altivec-abi.exp: Update.
	* gdb.arch/altivec-regs.exp: Update.
	* gdb.arch/amd64-byte.exp: Update.
	* gdb.arch/amd64-dword.exp: Update.
	* gdb.arch/amd64-word.exp: Update.
	* gdb.arch/i386-avx.exp: Update.
	* gdb.arch/i386-byte.exp: Update.
	* gdb.arch/i386-sse.exp: Update.
	* gdb.arch/i386-word.exp: Update.
	* gdb.arch/ppc-dfp.exp: Update.
	* gdb.arch/ppc-fp.exp: Update.
	* gdb.arch/vsx-regs.exp: Update.
	* gdb.base/all-bin.exp: Update.
	* gdb.base/annota1.exp: Update.
	* gdb.base/async.exp: Update.
	* gdb.base/attach.exp: Update.
	* gdb.base/break-interp.exp: Update.
	* gdb.base/call-ar-st.exp: Update.
	* gdb.base/call-rt-st.exp: Update.
	* gdb.base/call-sc.exp: Update.
	* gdb.base/callfuncs.exp: Update.
	* gdb.base/catch-load.exp: Update.
	* gdb.base/completion.exp: Update.
	* gdb.base/complex.exp: Update.
	* gdb.base/condbreak.exp: Update.
	* gdb.base/consecutive.exp: Update.
	* gdb.base/constvars.exp: Update.
	* gdb.base/corefile.exp: Update.
	* gdb.base/eval-skip.exp: Update.
	* gdb.base/expand-psymtabs.exp: Update.
	* gdb.base/exprs.exp: Update.
	* gdb.base/fileio.exp: Update.
	* gdb.base/fixsection.exp: Update.
	* gdb.base/funcargs.exp: Update.
	* gdb.base/gdb11530.exp: Update.
	* gdb.base/gdb1555.exp: Update.
	* gdb.base/gnu-ifunc.exp: Update.
	* gdb.base/gnu_vector.exp: Update.
	* gdb.base/info-macros.exp: Update.
	* gdb.base/jit-simple.exp: Update.
	* gdb.base/jit-so.exp: Update.
	* gdb.base/jit.exp: Update.
	* gdb.base/langs.exp: Update.
	* gdb.base/list.exp: Update.
	* gdb.base/logical.exp: Update.
	* gdb.base/long_long.exp: Update.
	* gdb.base/longjmp.exp: Update.
	* gdb.base/macscp.exp: Update.
	* gdb.base/mips_pro.exp: Update.
	* gdb.base/miscexprs.exp: Update.
	* gdb.base/morestack.exp: Update.
	* gdb.base/nodebug.exp: Update.
	* gdb.base/opaque.exp: Update.
	* gdb.base/pc-fp.exp: Update.
	* gdb.base/pending.exp: Update.
	* gdb.base/permissions.exp: Update.
	* gdb.base/pointers.exp: Update.
	* gdb.base/prelink.exp: Update.
	* gdb.base/printcmds.exp: Update.
	* gdb.base/psymtab.exp: Update.
	* gdb.base/ptype.exp: Update.
	* gdb.base/relational.exp: Update.
	* gdb.base/scope.exp: Update.
	* gdb.base/setvar.exp: Update.
	* gdb.base/shlib-call.exp: Update.
	* gdb.base/shreloc.exp: Update.
	* gdb.base/signals.exp: Update.
	* gdb.base/sizeof.exp: Update.
	* gdb.base/so-impl-ld.exp: Update.
	* gdb.base/so-indr-cl.exp: Update.
	* gdb.base/solib-disc.exp: Update.
	* gdb.base/solib-display.exp: Update.
	* gdb.base/solib-nodir.exp: Update.
	* gdb.base/solib-overlap.exp: Update.
	* gdb.base/solib-symbol.exp: Update.
	* gdb.base/solib-weak.exp: Update.
	* gdb.base/solib.exp: Update.
	* gdb.base/store.exp: Update.
	* gdb.base/structs.exp: Update.
	* gdb.base/structs2.exp: Update.
	* gdb.base/type-opaque.exp: Update.
	* gdb.base/unload.exp: Update.
	* gdb.base/varargs.exp: Update.
	* gdb.base/volatile.exp: Update.
	* gdb.base/watch_thread_num.exp: Update.
	* gdb.base/watchpoint-solib.exp: Update.
	* gdb.base/watchpoint.exp: Update.
	* gdb.base/watchpoints.exp: Update.
	* gdb.base/whatis.exp: Update.
	* gdb.cell/arch.exp: Update.
	* gdb.cell/break.exp: Update.
	* gdb.cell/bt.exp: Update.
	* gdb.cell/core.exp: Update.
	* gdb.cell/data.exp: Update.
	* gdb.cell/ea-cache.exp: Update.
	* gdb.cell/f-regs.exp: Update.
	* gdb.cell/fork.exp: Update.
	* gdb.cell/gcore.exp: Update.
	* gdb.cell/mem-access.exp: Update.
	* gdb.cell/ptype.exp: Update.
	* gdb.cell/registers.exp: Update.
	* gdb.cell/sizeof.exp: Update.
	* gdb.cell/solib-symbol.exp: Update.
	* gdb.cell/solib.exp: Update.
	* gdb.cp/ambiguous.exp: Update.
	* gdb.cp/breakpoint.exp: Update.
	* gdb.cp/bs15503.exp: Update.
	* gdb.cp/casts.exp: Update.
	* gdb.cp/class2.exp: Update.
	* gdb.cp/cpexprs.exp: Update.
	* gdb.cp/cplusfuncs.exp: Update.
	* gdb.cp/ctti.exp: Update.
	* gdb.cp/dispcxx.exp: Update.
	* gdb.cp/gdb1355.exp: Update.
	* gdb.cp/gdb2384.exp: Update.
	* gdb.cp/gdb2495.exp: Update.
	* gdb.cp/infcall-dlopen.exp: Update.
	* gdb.cp/local.exp: Update.
	* gdb.cp/m-data.exp: Update.
	* gdb.cp/m-static.exp: Update.
	* gdb.cp/mb-ctor.exp: Update.
	* gdb.cp/mb-inline.exp: Update.
	* gdb.cp/mb-templates.exp: Update.
	* gdb.cp/member-ptr.exp: Update.
	* gdb.cp/method.exp: Update.
	* gdb.cp/namespace.exp: Update.
	* gdb.cp/nextoverthrow.exp: Update.
	* gdb.cp/nsdecl.exp: Update.
	* gdb.cp/nsrecurs.exp: Update.
	* gdb.cp/nsstress.exp: Update.
	* gdb.cp/nsusing.exp: Update.
	* gdb.cp/pr-1023.exp: Update.
	* gdb.cp/pr-1210.exp: Update.
	* gdb.cp/pr-574.exp: Update.
	* gdb.cp/pr9631.exp: Update.
	* gdb.cp/printmethod.exp: Update.
	* gdb.cp/psmang.exp: Update.
	* gdb.cp/re-set-overloaded.exp: Update.
	* gdb.cp/rtti.exp: Update.
	* gdb.cp/shadow.exp: Update.
	* gdb.cp/templates.exp: Update.
	* gdb.cp/try_catch.exp: Update.
	* gdb.dwarf2/dw2-ranges.exp: Update.
	* gdb.dwarf2/pr10770.exp: Update.
	* gdb.fortran/library-module.exp: Update.
	* gdb.hp/gdb.aCC/optimize.exp: Update.
	* gdb.hp/gdb.aCC/watch-cmd.exp: Update.
	* gdb.hp/gdb.base-hp/callfwmall.exp: Update.
	* gdb.hp/gdb.base-hp/hwwatchbus.exp: Update.
	* gdb.hp/gdb.base-hp/pxdb.exp: Update.
	* gdb.hp/gdb.base-hp/sized-enum.exp: Update.
	* gdb.hp/gdb.base-hp/so-thresh.exp: Update.
	* gdb.hp/gdb.compat/xdb1.exp: Update.
	* gdb.hp/gdb.compat/xdb2.exp: Update.
	* gdb.hp/gdb.compat/xdb3.exp: Update.
	* gdb.hp/gdb.defects/bs14602.exp: Update.
	* gdb.hp/gdb.defects/solib-d.exp: Update.
	* gdb.hp/gdb.objdbg/objdbg01.exp: Update.
	* gdb.hp/gdb.objdbg/objdbg02.exp: Update.
	* gdb.hp/gdb.objdbg/objdbg03.exp: Update.
	* gdb.hp/gdb.objdbg/objdbg04.exp: Update.
	* gdb.mi/gdb792.exp: Update.
	* gdb.mi/mi-pending.exp: Update.
	* gdb.mi/mi-solib.exp: Update.
	* gdb.mi/mi-var-cp.exp: Update.
	* gdb.opt/clobbered-registers-O2.exp: Update.
	* gdb.opt/inline-bt.exp: Update.
	* gdb.opt/inline-cmds.exp: Update.
	* gdb.opt/inline-locals.exp: Update.
	* gdb.python/py-events.exp: Update.
	* gdb.python/py-finish-breakpoint.exp: Update.
	* gdb.python/py-type.exp: Update.
	* gdb.reverse/solib-precsave.exp: Update.
	* gdb.reverse/solib-reverse.exp: Update.
	* gdb.server/solib-list.exp: Update.
	* gdb.stabs/weird.exp: Update.
	* gdb.threads/attach-into-signal.exp: Update.
	* gdb.threads/attach-stopped.exp: Update.
	* gdb.threads/tls-shared.exp: Update.
	* gdb.trace/change-loc.exp: Update.
	* gdb.trace/strace.exp: Update.
2012-06-21 20:46:25 +00:00
Pedro Alves 11337c2fed 2012-02-24 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_ld): Use with_test_prefix.
	(top level): Use with_test_prefix.
2012-02-24 14:09:08 +00:00
Pedro Alves 0f4d39d53d 2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.arch/altivec-abi.exp (altivec_abi_tests): Don't do
	with_test_prefix here.
	(top level): Do it here instead.  Remove `:' from the
	with_test_prefix string.
	* gdb.base/attach-pie-misread.exp: Remove the leading space the
	the suffix `:' from the with_test_prefix prefix string.
	* gdb.base/break-interp.exp: Ditto.
	* gdb.base/catch-load.exp: Ditto.
	* gdb.base/disp-step-syscall.exp: Ditto.
	* gdb.base/jit-so.exp: Ditto.
	* gdb.base/jit.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/solib-display.exp: Ditto.
	* gdb.base/solib-overlap.exp: Ditto.
	* gdb.base/watch-cond-infcall.exp: Ditto.
	* gdb.base/watchpoint.exp: Ditto.
	* gdb.dwarf2/dw2-noloc.exp: Ditto.
	* gdb.mi/mi-watch.exp: Ditto.
	* gdb.mi/mi2-watch.exp: Ditto.
	* gdb.threads/non-ldr-exc-1.exp: Ditto.
	* gdb.threads/non-ldr-exc-2.exp: Ditto.
	* gdb.threads/non-ldr-exc-3.exp: Ditto.
	* gdb.threads/non-ldr-exc-4.exp: Ditto.
	* gdb.threads/watchpoint-fork.exp: Ditto.
	* gdb.threads/watchthreads-reorder.exp: Ditto.
	* gdb.trace/change-loc.exp: Ditto.
	* gdb.trace/pending.exp: Ditto.
	* gdb.trace/status-stop.exp: Ditto.
	* gdb.trace/strace.exp: Ditto.
	* gdb.trace/trace-break.exp: Ditto.
	* gdb.trace/unavailable.exp: Ditto.
	* lib/gdb.exp (with_test_prefix): Always prefix with space and
	suffix with colon.  Adjust leading comments.
2012-02-21 22:01:10 +00:00
Pedro Alves 6a5870cea1 2012-02-21 Pedro Alves <palves@redhat.com>
Tom Tromey  <tromey@redhat.com>

	* lib/gdb.exp: Add description of test prefixes.
	(with_test_prefix): New procedure.
	* gdb.arch/altivec-abi.exp: Use with_test_prefix.
	* gdb.base/attach-pie-misread.exp: Use with_test_prefix.
	* gdb.base/break-interp.exp: Use with_test_prefix.  Use append
	instead of lappend to append to pf_prefix.
	* gdb.base/catch-load.exp: Use with_test_prefix.
	* gdb.base/disp-step-syscall.exp: Use with_test_prefix.
	* gdb.base/jit-so.exp: Use with_test_prefix.
	* gdb.base/jit.exp: Use with_test_prefix.
	* gdb.base/return-nodebug.exp (do_test): Use append instead of
	lappend to append to pf_prefix.
	* gdb.base/sepdebug.exp: Use with_test_prefix.
	* gdb.base/solib-display.exp: Use with_test_prefix.
	* gdb.base/solib-overlap.exp: Use with_test_prefix.
	* gdb.base/watch-cond-infcall.exp: Use with_test_prefix.
	* gdb.base/watchpoint.exp: Use with_test_prefix.
	* gdb.dwarf2/dw2-noloc.exp: Use with_test_prefix.
	* gdb.mi/mi-watch.exp: Use with_test_prefix.
	* gdb.mi/mi2-watch.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-1.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-2.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-3.exp: Use with_test_prefix.
	* gdb.threads/non-ldr-exc-4.exp: Use with_test_prefix.
	* gdb.threads/watchpoint-fork.exp: Use with_test_prefix.  Use
	append instead of lappend to append to pf_prefix.
	* gdb.threads/watchthreads-reorder.exp: Use with_test_prefix.
	* gdb.trace/change-loc.exp: Use with_test_prefix.
	* gdb.trace/pending.exp: Use with_test_prefix.
	* gdb.trace/status-stop.exp: Use with_test_prefix.
	* gdb.trace/strace.exp: Use with_test_prefix.
	* gdb.trace/trace-break.exp: Use with_test_prefix.
	* gdb.trace/unavailable.exp: Use with_test_prefix.  Use append
	instead of lappend to append to pf_prefix.
2012-02-21 21:55:39 +00:00
Pedro Alves 4a2d9c0801 2012-02-10 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_attach_gdb): Assume $file is
	always non-empty.
	(test_attach): Always pass $exec to test_attach_gdb.
2012-02-10 16:06:50 +00:00
Tom Tromey edcc512082 PR symtab/12406:
* solib.c (update_solib_list): Update the program space's
	added_solibs and deleted_solibs fields.
	* progspace.h (struct program_space) <added_solibs,
	deleted_solibs>: New fields.
	(clear_program_space_solib_cache): Declare.
	* progspace.c (release_program_space): Call
	clear_program_space_solib_cache.
	(clear_program_space_solib_cache): New function.
	* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call
	bpstat_stop_status.  Use handle_solib_event.
	* breakpoint.c: Include gdb_regex.h.
	(print_solib_event): New function.
	(bpstat_print): Use print_solib_event.
	(bpstat_stop_status): Add special case for bp_shlib_event.
	(handle_solib_event): New function.
	(bpstat_what): Use handle_solib_event.
	(struct solib_catchpoint): New.
	(dtor_catch_solib, insert_catch_solib, remove_catch_solib)
	(breakpoint_hit_catch_solib, check_status_catch_solib)
	(print_it_catch_solib, print_one_catch_solib)
	(print_mention_catch_solib, print_recreate_catch_solib): New
	functions.
	(catch_solib_breakpoint_ops): New global.
	(catch_load_or_unload, catch_load_command_1)
	(catch_unload_command_1): New functions.
	(internal_bkpt_check_status): Add special case for
	bp_shlib_event.
	(internal_bkpt_print_it): Use print_solib_event.
	(initialize_breakpoint_ops): Initialize
	catch_solib_breakpoint_ops.
	(_initialize_breakpoint): Register "catch load" and "catch
	unload".
	* breakpoint.h (handle_solib_event): Declare.
	* NEWS: Add entry for "catch load" and "catch unload".
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document "catch load" and "catch
	unload".
	(Files): Mention new catch commands.
	(GDB/MI Async Records): Likewise.
gdb/testsuite
	* lib/mi-support.exp (mi_expect_stop): Add special case for
	solib-event.
	* gdb.base/catch-load-so.c: New file.
	* gdb.base/catch-load.exp: New file.
	* gdb.base/catch-load.c: New file.
	* gdb.base/break-interp.exp (reach_1): Update regexp.
2012-01-24 21:39:18 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Jan Kratochvil 3a3dad982f gdb/testsuite/
* gdb.base/async-shell.exp: Skip the testfile for use_gdb_stub.
	* gdb.base/attach-pie-misread.exp: Likewise.
	* gdb.base/break-interp.exp: Likewise.
	* gdb.base/default.exp (attach, run "r" abbreviation, run): Skip these
	testcases for use_gdb_stub.
	* gdb.dwarf2/dw2-restore.exp: Fix the run for use_gdb_stub.
	(continue): New testcase.
	* gdb.python/py-events.exp: Skip the testfile for use_gdb_stub.
	* gdb.threads/attach-into-signal.exp: Likewise.
	* gdb.threads/attach-stopped.exp: Likewise.
	* gdb.threads/attachstop-mt.exp: Likewise.
2011-10-28 17:32:30 +00:00
Jan Kratochvil 900e11f9ec gdb/
* dwarf2read.c (check_physname): New variable.
	(dwarf2_physname): Prefer DW_AT_linkage_name over dwarf2_compute_name.
	(show_check_physname): New function.
	(_initialize_dwarf2_read): Add `check-physname' for check_physname.

gdb/doc/
	* gdb.texinfo (Debugging Output): Document set debug
	check-physname.

gdb/testsuite/
	* gdb.base/break-interp.exp (reach_1, test_ld): Allow also the prefix
	__GI_.
	* gdb.cp/psymtab-parameter.cc (func): Make it a template function.
	(f): New function.
	* gdb.cp/psymtab-parameter.exp (complete break 'func(): Rename to ...
	(complete p 'func<short>(): ... here.
	* gdb.dwarf2/dw2-linkage-name-trust-main.cc: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.S: New file.
	* gdb.dwarf2/dw2-linkage-name-trust.exp: New file.
	* gdb.cp/temargs.exp (test type of F in k3_m, test value of F in k3_m):
	Make them KFAIL gcc/49546.
2011-07-01 19:12:12 +00:00
Jan Kratochvil 0283589814 gdb/
Fix libraries displacement if they change whether they were prelinked.
	* solib-svr4.c (LM_ADDR_CHECK): Set L_ADDR even if the DYNAMIC pointer
	does not match.  Comment why.

gdb/testsuite/
	* gdb.base/break-interp-lib.c (v, vptr): New variables.
	* gdb.base/break-interp.exp (test_attach): New comment.
2011-04-17 19:17:10 +00:00
Tom Tromey fda326dd1d gdb
* infrun.c (print_exited_reason): Include inferior id and pid in
	message.
gdb/testsuite
	* lib/opencl.exp (skip_opencl_tests): Update for exit message
	change.
	* lib/mi-support.exp (mi_gdb_test): Update for exit message
	change.
	* lib/gdb.exp (gdb_test_multiple): Update comment.  Update for
	exit message change.
	(skip_altivec_tests): Update for exit message change.
	(skip_vsx_tests): Likewise.
	(gdb_continue_to_end): Likewise.  Add 'command' argument.
	* lib/cell.exp (skip_cell_tests): Update for exit message change.
	* gdb.threads/tls.exp: Update for exit message change.
	* gdb.threads/thread-unwindonsignal.exp: Use
	gdb_continue_to_end.
	* gdb.threads/step.exp (step_it): Update for exit message change.
	(continue_all): Likewise.
	* gdb.threads/print-threads.exp (test_all_threads): Update for
	exit message change.
	* gdb.threads/interrupted-hand-call.exp: Use
	gdb_continue_to_end.
	* gdb.threads/execl.exp: Use gdb_continue_to_end.
	* gdb.python/py-prettyprint.exp (run_lang_tests): Use
	gdb_continue_to_end.
	* gdb.hp/gdb.objdbg/objdbg02.exp: Use gdb_continue_to_end.
	* gdb.hp/gdb.objdbg/objdbg01.exp: Use gdb_continue_to_end.
	* gdb.hp/gdb.defects/solib-d.exp: Update for exit message change.
	* gdb.cp/method.exp: Update for exit message change.
	* gdb.cp/mb-templates.exp: Update for exit message change.
	* gdb.cp/mb-inline.exp: Use gdb_continue_to_end.
	* gdb.cp/annota3.exp: Update for exit message change.
	* gdb.cp/annota2.exp: Update for exit message change.
	* gdb.cell/fork.exp: Use gdb_continue_to_end.
	* gdb.base/term.exp: Update for exit message change.
	* gdb.base/step-test.exp (test_i): Update for exit message change.
	* gdb.base/sigstep.exp (advance): Update for exit message change.
	(advancei): Likewise.
	* gdb.base/siginfo.exp: Update for exit message change.
	* gdb.base/shlib-call.exp: Use gdb_continue_to_end.
	* gdb.base/reread.exp: Use gdb_continue_to_end.
	* gdb.base/langs.exp: Use gdb_continue_to_end.
	* gdb.base/interrupt.exp: Update for exit message change.
	* gdb.base/gdb1555.exp: Update for exit message change.
	* gdb.base/exe-lock.exp: Use gdb_continue_to_end.
	* gdb.base/ending-run.exp: Update for exit message change.
	* gdb.base/chng-syms.exp: Update for exit message change.
	* gdb.base/checkpoint.exp: Update for exit message change.
	* gdb.base/catch-syscall.exp (check_for_program_end): Use
	gdb_continue_to_end.
	(test_catch_syscall_with_wrong_args): Likewise.
	* gdb.base/call-signal-resume.exp: Use gdb_continue_to_end.
	* gdb.base/break-interp.exp (test_ld): Update for exit message
	change.
	* gdb.base/bang.exp: Update for exit message change.
	* gdb.base/attach.exp (do_attach_tests): Use gdb_continue_to_end.
	(do_call_attach_tests): Likewise.
	* gdb.base/a2-run.exp: Update for exit message change.
	* gdb.arch/ppc-dfp.exp: Update for exit message change.
	* gdb.ada/tasks.exp: Use gdb_continue_to_end.
	* gdb.ada/catch_ex.exp: Use gdb_continue_to_end.
2011-03-07 16:03:04 +00:00
Thiago Jung Bauermann a449c2d800 * gdb.base/break-interp.exp: Remove ${objdir} from test messages.
* gdb.base/jit.exp: Likewise.
	* gdb.base/pie-execl.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* gdb.base/solib-overlap.exp: Likewise.
2011-02-07 13:35:42 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Jan Kratochvil 93c17e06d2 gdb/testsuite/
* gdb.base/break-interp.exp (test_ld): Replace gdb_expect by
	gdb_test_multiple.
2010-10-12 18:41:06 +00:00
Jan Kratochvil d8b34041e0 gdb/testsuite/
* gdb.base/break-interp.exp: Use ldlags for linking flags.
	* gdb.base/prelink.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* lib/gdb.exp (gdb_compile) <*-*-openbsd*>
	(gdb_compile) <shlib_load>: Use ldlags for linking flags.
	* lib/prelink-support.exp (build_executable_own_libs): Likewise.
2010-10-12 18:12:49 +00:00
Ulrich Weigand e0cc584ecf * break-interp.exp (test_ld): Use two separate gdb_expect statements
for the "info files" test to avoid timeouts on slow machines.
2010-10-12 17:17:36 +00:00
Jan Kratochvil d3d7896de3 gdb/testsuite/
Fix missing _start PIE relocation on ppc64 due to stop on dl_main.
	* break-interp.exp (reach): Move the core body ...
	(reach_1): ... here.  Use stop-on-solib-events for _dl_debug_state.
	(test_ld): Provide always real argument, even to the linker.  Replace
	dl_main by _dl_debug_state.
2010-10-11 08:47:47 +00:00
Jan Kratochvil 5e533c94a6 gdb/testsuite/
Fix results of prelinked PIEs on ppc*.
	* gdb.base/break-interp.exp (reach, test_core, test_attach_gdb):
	Accept also DISPLACEMENT "PRESENT".
	(main): Replace "ZERO" displacements by "PRESENT".
2010-10-11 08:45:12 +00:00
Jan Kratochvil 8e64f2a0d1 gdb/testsuite/
* gdb.base/break-interp.exp (test_ld) <istarget powerpc64-*>: Add
	is_lp64_target to check 64bit target.
2010-09-10 20:29:25 +00:00
Jan Kratochvil 4569eed2ce gdb/testsuite/
* gdb.base/break-interp.exp (reach): Permit leading . for ppc64.
	(test_ld) <powerpc64-*>: New.
2010-09-09 20:00:49 +00:00
Jan Kratochvil 4e5799b6d2 gdb/
Fix re-run of PIE executable, PR shlibs/11776.
	* solib-svr4.c (svr4_relocate_main_executable) <symfile_objfile>: Remove
	the part of pre-set SYMFILE_OBJFILE->SECTION_OFFSETS.

gdb/testsuite/
	Fix re-run of PIE executable, PR shlibs/11776.
	* gdb.base/break-interp.exp (test_ld): Turn off "disable-randomization".
	Remove $displacement_main to match the solib-svr4.c change.  New "kill"
	and re-"run" of the inferior.
2010-07-05 18:04:33 +00:00
Jan Kratochvil 5e3b36f879 gdb/testsuite/
* gdb.base/attach-pie-misread.exp: Load prelink-support.exp.  Replace
	build_executable by build_executable_own_libs.  Replace "prelink -R"
	execution by a call of prelink_yes.  Comment why "prelink -r" needs no
	change.
	* gdb.base/break-interp.exp: Load prelink-support.exp.  Rename calls of
	copy to file_copy.  Move setting opts --dynamic-linker and -rpath,
	mkdir $dir and ldd its parsing and copying to lib/prelink-support.exp.
	Replace build_executable by build_executable_own_libs's function
	build_executable_own_libs.
	(prelinkNO): Create new stub to call prelink_no.
	(prelinkYES): Create new stub to call prelink_yes.
	(test_attach): Rename calls of copy to file_copy.
	(section_get, prelinkNO_run, prelinkNO, prelinkYES, symlink_resolve)
	(copy): Move to ...
	* lib/prelink-support.exp: ... a new file.  Rename prelinkNO to
	prelink_no, prelinkYES to prelink_yes, copy to file_copy.
	* gdb.base/prelink.exp: Disable testcase also for is_remote and
	skip_shlib_tests.  Load prelink-support.exp.  Replace gdb_compile with
	special flags by gdb_compile_shlib.  Replace second gdb_compile by
	build_executable_own_libs.  Replace "prelink -R" execution by a call of
	prelink_yes.  Replace "prelink -u" and second "prelink -R" execution by
	a second call of prelink_yes.  Replace restart commands by
	clean_restart.
	(prelink): Rename to ...
	(seen displacement message): ... this test.  Extend its expectation
	strictness.
2010-07-05 18:01:53 +00:00
Jan Kratochvil 86e4bafc3b gdb/
* auxv.c (memory_xfer_auxv): Update attach comment.
	* solib-svr4.c (svr4_special_symbol_handling): Remove the call to
	svr4_relocate_main_executable.
	(svr4_solib_create_inferior_hook): Make the call to
	svr4_relocate_main_executable unconditional.

gdb/testsuite/
	* gdb.base/attach-pie-misread.exp, gdb.base/attach-pie-misread.c: New.
	* gdb.base/break-interp.exp (reach, test_core, test_ld): Require each
	displacement message exactly once.
2010-07-05 18:00:40 +00:00
Jan Kratochvil 3cd07d204b gdb/
* auxv.c (ld_so_xfer_auxv): Do not error on failed read of data_address.
2010-07-05 17:58:56 +00:00
Jan Kratochvil 0a1e94c73e gdb/
Fix attaching to PIEs prelinked on the disk after the process was
	started.
	* solib-svr4.c (svr4_exec_displacement): New variable arch_size.
	Verify it against bfd_get_arch_size.  Try to match arbitrary
	displacement for the phdrs comparison.

gdb/testsuite/
	* gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new
	code for it.  New variable relink_args.
	(prelinkYES): Call prelinkNO.
	(test_attach): Accept new parameter relink_args.  Re-prelink the binary
	in such case.  Move the core code to ...
	(test_attach_gdb): ... a new function.  Send GDB command "file".
	Extend expected "Attaching to " string.
2010-07-05 17:57:50 +00:00
Jan Kratochvil 37cc8bfee6 gdb/testsuite/
* gdb.base/break-interp.exp (prelinkYES): XFAIL on `Not enough room to
	add .dynamic entry'.
2010-06-29 21:48:10 +00:00
Doug Evans de6a04210c * gdb.base/break-interp.exp (reach): Relax expected output a bit. 2010-06-28 16:54:11 +00:00
Michael Snyder 27d3a1a248 2010-06-01 Michael Snyder <msnyder@vmware.com>
* gdb.base/arithmet.exp: Use gdb_test_no_output.
	* gdb.base/arrayidx.exp: Ditto.
	* gdb.base/attach.exp: Ditto.
	* gdb.base/auxv.exp: Ditto.
	* gdb.base/bigcre.exp: Ditto.
	* gdb.base/break-always.exp: Ditto.
	* gdb.base/break-interp.exp: Ditto.
	* gdb.base/break.exp: Ditto.
	* gdb.base/breakpoint-shadow.exp: Ditto.
	* gdb.base/call-ar-st.exp: Ditto.
	* gdb.base/call-sc.exp: Ditto.
	* gdb.base/call-signal-resume.exp: Ditto.
	* gdb.base/callfuncs.exp: Ditto.
	* gdb.base/catch-syscall.exp: Ditto.
	* gdb.base/charset.exp: Ditto.
	* gdb.base/code-expr.exp: Ditto.
	* gdb.base/commands.exp: Ditto.
	* gdb.base/cond-expr.exp: Ditto.
	* gdb.base/condbreak.exp: Ditto.
	* gdb.base/cursal.exp: Ditto.
	* gdb.base/cvexpr.exp: Ditto.
	* gdb.base/default.exp: Ditto.
	* gdb.base/del.exp: Ditto.
	* gdb.base/detach.exp: Ditto.
	* gdb.base/display.exp: Ditto.
	* gdb.base/ena-dis-br.exp: Ditto.
	* gdb.base/eval-skip.exp: Ditto.
	* gdb.base/foll-fork.exp: Ditto.
	* gdb.base/foll-vfork.exp: Ditto.
	* gdb.base/frame-args.exp: Ditto.
	* gdb.base/funcargs.exp: Ditto.
	* gdb.base/gcore-buffer-overflow.exp: Ditto.
	* gdb.base/gdbvars.exp: Ditto.
	* gdb.base/help.exp: Ditto.
	* gdb.base/ifelse.exp: Ditto.
	* gdb.base/included.exp: Ditto.
	* gdb.base/list.exp: Ditto.
	* gdb.base/macscp.exp: Ditto.
	* gdb.base/maint.exp: Ditto.
	* gdb.base/multi-fork.exp: Ditto.
	* gdb.base/overlays.exp: Ditto.
	* gdb.base/page.exp: Ditto.
	* gdb.base/pending.exp: Ditto.
	* gdb.base/pointers.exp: Ditto.
	* gdb.base/pr11022.exp: Ditto.
	* gdb.base/prelink.exp: Ditto.
	* gdb.base/printcmds.exp: Ditto.
	* gdb.base/psymtab.exp: Ditto.
	* gdb.base/randomize.exp: Ditto.
	* gdb.base/relational.exp: Ditto.
	* gdb.base/relocate.exp: Ditto.
	* gdb.base/remote.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/set-lang-auto.exp: Ditto.
	* gdb.base/setshow.exp: Ditto.
	* gdb.base/setvar.exp: Ditto.
	* gdb.base/signals.exp: Ditto.
	* gdb.base/signull.exp: Ditto.
	* gdb.base/sigstep.exp: Ditto.
	* gdb.base/sizeof.exp: Ditto.
	* gdb.base/solib-disc.exp: Ditto.
	* gdb.base/store.exp: Ditto.
	* gdb.base/structs.exp: Ditto.
	* gdb.base/structs2.exp: Ditto.
	* gdb.base/subst.exp: Ditto.
	* gdb.base/term.exp: Ditto.
	* gdb.base/trace-commands.exp: Ditto.
	* gdb.base/unwindonsignal.exp: Ditto.
	* gdb.base/valgrind-db-attach.exp: Ditto.
	* gdb.base/varargs.exp: Ditto.
	* gdb.base/watch-cond.exp: Ditto.
	* gdb.base/watch_thread_num.exp: Ditto.
	* gdb.base/watchpoint-cond-gone.exp: Ditto.
	* gdb.base/watchpoint.exp: Ditto.
	* gdb.base/whatis-exp.exp: Ditto.
2010-06-01 21:29:21 +00:00
Jan Kratochvil 8e1d0c49c1 gdb/testsuite/
* gdb.base/break-interp.exp: Remove $exec.debug safety removal.
	* gdb.base/sepdebug.exp: Remove .debug subdirectory handling.  New
	variable different_dir. Move debugfile into a full directory pathname
	under DIFFERENT_DIR.
	* lib/gdb.exp (separate_debug_filename): Remove.
	(gdb_gnu_strip_debug): No longer call separate_debug_filename.  Remove
	variable debug_dir and mkdir of it.  Update function comments.
2010-05-02 09:08:59 +00:00
Jan Kratochvil 09248348a7 gdb/testsuite/
* gdb.base/break-interp.exp (test_core, test_attach, test_ld): Add
	" as $displacement" to "seen displacement message".
2010-03-28 19:08:24 +00:00
Doug Evans d7d158ed1d * gdb.base/break-interp.exp (prelinkNO): Handle prelink binaries
named /usr/sbin/prelink<foo>.
2010-03-19 17:57:17 +00:00
Jan Kratochvil ccf2624776 gdb/
* solib-svr4.c (LM_ADDR_CHECK) <info_verbose>: Use printf_unfiltered
	for the PIC displacement, print also the displacement value.
	(svr4_exec_displacement):  Print DISPLACEMENT if INFO_VERBOSE.

gdb/testsuite/
	* gdb.base/break-interp.exp: Create new displacement parameter value
	for the test_ld calls.
	(reach): New parameter displacement, verify its content.  New push of
	pf_prefix "reach-$func:".  Import global expect_out.
	(test_core): New parameter displacement, verify its content.  New push
	of pf_prefix "core:".  New command "set verbose on".  Import global
	expect_out.
	(test_attach): New parameter displacement, verify its content.  New
	push of pf_prefix "attach:".  New command "set verbose on".  Import
	global expect_out.
	(test_ld): New parameter displacement, pass it to the reach, test_core
	and test_attach calls and verify its content in the "ld.so exit" test.
	* gdb.base/prelink.exp: Remove gdb_exit and final return.
	(prelink): Update expected text, use gdb_test.
2010-03-11 22:07:03 +00:00
Jan Kratochvil 40b27cdc59 gdb/testsuite/
* gdb.base/break-interp.exp: Use [file tail $filename] to omit any
	absolute directory pathnames in gdb.sum file.
2010-01-27 20:53:22 +00:00
Jan Kratochvil bbfba9ed15 gdb/testsuite/
* gdb.base/break-interp-lib.c: Include unistd.h, assert.h and stdio.h.
	(libfunc): New parameter action.  Implement also selectable "sleep".
	* gdb.base/break-interp-main.c: Include assert.h.
	(libfunc): New parameter action.
	(main): New parameters argc and argv.  Assert argc.  Pass argv.
	* gdb.base/break-interp.exp (test_core): Pass the "segv" argument.
	(test_attach): New proc.
	(test_ld): Pass new "segv" exec parameter.  Call also test_attach.
	* lib/gdb.exp (core_find): New parameter arg.  Pass it to $binfile.
2010-01-14 21:12:00 +00:00
Jan Kratochvil 61f0d76280 gdb/
* solib-svr4.c (scan_dyntag): Remove variable dyn_addr.  New variable
	target_section.  Find SECT in current_target_sections, gdb_assert it.
	(elf_lookup_lib_symbol): Pass the binary file if given symfile_objfile.
	New variable abfd.
	* symtab.c (lookup_objfile_from_block): Return the binary file instead
	of separate debug info file.

gdb/testsuite/
	* gdb.base/break-interp.exp (test_core): New proc.
	(test_ld): Call it.
2010-01-14 21:09:05 +00:00