]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: fail if gdb_start_cmd fails
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 18 Nov 2022 16:06:47 +0000 (11:06 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 28 Nov 2022 14:40:26 +0000 (09:40 -0500)
commit4a6bdfb9baa27e29151c7e97ae2abbe902f53638
treeebd9a4dda63720552475abc0f25dba296ec07e6b
parent912b12ad84adf32af5827511af5afecedb108c63
gdb/testsuite: fail if gdb_start_cmd fails

I broke gdb.ada/start.exp, and did not notice it, because it outputs an
UNTESTED if gdb_start_cmd fails.  I don't really see when start would
fail and it's not a problem that should be looked at.  Change all spots
that call untested after a gdb_start_cmd failure, use fail instead.

Doing so caused some failures with the native-gdbserver board.  Some
tests that use "start" were relying on the fact that start would fail
with that board to just return with "untested".  Change them to add an
early return if use_gdb_stub returns true.

Some gdb.pascal tests also failed with native-gdbserver, because they
did use gdb_start_cmd to start the inferior, for no good reason.
Convert them to use runto_main instead, which does the right thing if
the target is a stub.

A further refactoring could be to make gdb_start_cmd match the expected
breakpoint hit and the prompt, which it doesn't do currently (it leaves
that to the callers, but not all of them do).

Change-Id: I097370851213e798ff29fb6cf8ba25ef7d2be007
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/gdb.ada/exec_changed.exp
gdb/testsuite/gdb.ada/start.exp
gdb/testsuite/gdb.base/start-cpp.exp
gdb/testsuite/gdb.base/start.exp
gdb/testsuite/gdb.base/watchpoint-hw.exp
gdb/testsuite/gdb.dwarf2/main-subprogram.exp
gdb/testsuite/gdb.pascal/floats.exp
gdb/testsuite/gdb.pascal/gdb11492.exp
gdb/testsuite/gdb.pascal/hello.exp
gdb/testsuite/gdb.pascal/integers.exp