forked from Imagelibrary/binutils-gdb
When running test-case gdb.server/stop-reply-no-thread-multi.exp with
host+target board local-remote-host-native, I run into a time-out:
...
(gdb) PASS: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \
to_disable=: disconnect
builtin_spawn /usr/bin/ssh -t -l vries 127.0.0.1 gdbserver --once \
localhost:2346 stop-reply-no-thread-multi^M
Process stop-reply-no-thread-multi created; pid = 32600^M
Listening on port 2346^M
set remote threads-packet off^M
FAIL: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \
to_disable=: set remote threads-packet off (timeout)
...
This is due to this line in ${board}_spawn:
...
set board_info($board,fileid) $spawn_id
...
We have the following series of events:
- gdb is spawned, setting fileid
- a few gdb commands (set height etc) are send using fileid, arrive at gdb and
are successful
- gdbserver is spawned, overwriting fileid
- the next gdb command is sent using fileid, so it's send
to gdbserver instead of gdb, and we run into the timeout.
There is some notion of current gdb, tracked in both gdb_spawn_id and fileid
of the host board (see switch_gdb_spawn_id). And because the host and target
board are the same, spawning something on the target overwrites the fileid on
host, and consequently the current gdb.
Fix this by only setting fileid when spawning gdb.
Tested on x86_64-linux.
Now gdb.server/*.exp passes for host+target board local-remote-host-native,
except for file-transfer.exp.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29734
This is a collection of boards for GDB. The file gdb/testsuite/boards/README contains an overview of the boards. The idea is to group similar boards together, and have one line to describe a board. # Modify gdb default flags. readnow.exp Run gdb with -readnow. # Post-process executable. cc-with-gdb-index.exp Use gdb to create .gdb_index section. cc-with-debug-names.exp Use gdb to create .debug_names section. cc-with-dwz.exp Use dwz to compress debug info in executable. cc-with-dwz-m.exp Use dwz to compress debug info in executable, optionally moving debug info to a separate file. cc-with-gnu-debuglink.exp Use strip to move the debug info from executable to a separate file, and add a .gnu_debuglink to it. cc-with-tweaks.exp Base board used by all boards in this section, but can be used by itself, f.i. do more than one type of post-processing. # Modify debug_flags. debug-types.exp Add -fdebug-types-section. dwarf64.exp Add -gdwarf64. gold.exp Add -fuse-ld=gold. gold-gdb-index.exp Add -fuse-ld=gold -Wl,--gdb-index -ggnu-pubnames stabs.exp Add -gstabs+. # Test -gsplit-dwarf. fission.exp Set debug_flags to -gdwarf-4 -gsplit-dwarf -ggnu-pubnames -fdebug-types-section -Wl,--gdb-index -fuse-ld=gold. fission-dwp.exp As fission.exp, but also post-process executables to generate a .dwp file. # Test various things at the same time. dwarf4-gdb-index.exp Set debug_flags to -gdwarf-4 -fdebug-types-section, and post-process executable using gdb to create .gdb_index section. # [is_remote host] == 0 && [is_remote target] == 0. native-gdbserver.exp Test gdbserver using gdb_protocol remote. native-extended-gdbserver.exp Test gdbserver using gdb_protocol extended-remote. native-stdio-gdbserver.exp Test gdbserver using stdio connection. # [is_remote host] == 0 && [is_remote target] == 1. remote-gdbserver-on-localhost.exp Run gdbserver on remote target. remote-stdio-gdbserver.exp Run gdbserver on remote target, using stdio connection. # [is_remote host] == 1 && [is_remote target] == 0. # Note: need to pass the board with --host_board instead of --target_board. local-remote-host-notty.exp Run gdb on remote host in pseudo-terminal with "set editing off". local-remote-host.exp Run gdb on remote host in pseudo-terminal. # [is_remote host] == 1 && [is_remote target] == 1. # Note: need to pass the board with both --target_board and --host_board. local-remote-host-native.exp Run gdb on remote host, run gdbserver on remote target, with host == target. # Target-specific. simavr.exp Use simavr as target. # Base boards, mostly to be included by other boards, so no individual # description. stdio-gdbserver-base.exp gdbserver-base.exp local-board.exp