aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/attach.exp
diff options
context:
space:
mode:
authorLancelot SIX <lancelot.six@amd.com>2022-04-14 10:41:48 +0100
committerLancelot SIX <lancelot.six@amd.com>2022-04-20 20:50:12 +0100
commitb750766ac9652def5307925b8fc5c215fbcef8df (patch)
tree5921a5a91ec3e2ac41b7388001f139c6ad47103b /gdb/testsuite/gdb.base/attach.exp
parent4206d69e96ac401cf2975f37bf4e4d3a3c838313 (diff)
downloadgdb-b750766ac9652def5307925b8fc5c215fbcef8df.zip
gdb-b750766ac9652def5307925b8fc5c215fbcef8df.tar.gz
gdb-b750766ac9652def5307925b8fc5c215fbcef8df.tar.bz2
gdb/testsuite: Introduce and use gdb_spawn_attach_cmdline
Following a7e6a19e87f3d719ea23c65b580a6d9bca4ccab3 "gdb: testsuite: add new gdb_attach to check "attach" command", this commit proposes to introduce the gdb_spawn_attach_cmdline helper and use it in gdb.base/attach.exp. This helper starts GDB and adds the "--pid=$PID" argument. Also note that both the original and new implementation use gdb_spawn_with_cmdline_opts, which in the end uses default_gdb_spawn. This makes sure that we use $INTERNAL_GDBFLAGS, which by default already contain "-iex \"set height 0\" -iex \"set width 0\"". To avoid repetition of those arguments, gdb_spawn_attach_cmdline does not repeat those arguments. To maintain a behavior similat to what gdb.base/attach.exp used to do, gdb_spawn_attach_cmdline keeps the -quiet flag. Tested on x86_64-gnu-linux Change-Id: I1fdcdb71c86d9c5d34bb28fc86fac68bcec37358
Diffstat (limited to 'gdb/testsuite/gdb.base/attach.exp')
-rw-r--r--gdb/testsuite/gdb.base/attach.exp11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index d01060a..7b661e9 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -467,14 +467,9 @@ proc_with_prefix do_command_attach_tests {} {
gdb_exit
- set res [gdb_spawn_with_cmdline_opts \
- "-quiet -iex \"set height 0\" -iex \"set width 0\" --pid=$testpid"]
- set test "starting with --pid"
- gdb_test_multiple "" $test {
- -re "Reading symbols from.*$gdb_prompt $" {
- pass "$test"
- }
- }
+ # gdb_spawn_attach_cmdline records test results. No need to explicitly
+ # call pass/fail here.
+ gdb_spawn_attach_cmdline $testpid
# Get rid of the process
kill_wait_spawned_process $test_spawn_id