From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C4EB93844746 for ; Mon, 20 Feb 2023 14:14:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4EB93844746 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676902443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=osWbRX4jAm8YQwxIQ1S+TEMKsI3YCqi5gD4n8eDX5bE=; b=WW6Sz3PtYMM+Oas9Wq8as6lf61ZeJtvpgIPPz175oLVVqVMcQLZvIVDldeCjvtqbWUGtK6 u0pSBt4UvMRIrF6fjEwSPvywPUvKI5lhaLwyR7nbhAKh1+kLHG1XszdRm39KsahI+/sgbK Ie2tML5xH7stoYM5gbEZ86lOGoYu4nA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-41-tLiVBd5BP9iLwjpjDHqSSg-1; Mon, 20 Feb 2023 09:14:02 -0500 X-MC-Unique: tLiVBd5BP9iLwjpjDHqSSg-1 Received: by mail-wr1-f70.google.com with SMTP id bt1-20020a056000080100b002c557db0e0fso346385wrb.11 for ; Mon, 20 Feb 2023 06:14:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=osWbRX4jAm8YQwxIQ1S+TEMKsI3YCqi5gD4n8eDX5bE=; b=vp+UHQq21DQTDQITfQxky0AQSlUA8x9Pb5HwrNQlSCKxQzPtgnT8/3T8NnsJ6O5KRI R447Qmz6EQTH/yLKuIDEhL6v5c3ktwRXHURLReJCFdc6+ZSJdyFh9w+4N41nWHyWu/dM ddr4TlGL33KYtUKbqUh+RtMWefxmoSjGhz1HZG5KdY/q4+Lxa0xc3WsDawGtzZV14lar Sts2yedKpIttayGX8AyOq4H+MWrOcre9xiiRVjOkRUhxPTGT9Cmo0Oh4TEu6Lkvmi0So NuTpvO50aY+02haK0KHPmDy2IeMkAEiKwmEkGVyYQo5Lifrft0ap8W3GNR4z24TW6CgS qdqg== X-Gm-Message-State: AO0yUKWsh/iJA1+bfTnbs9xuDcc0QTTxcoU2b4YOG7G8jOrkzjR3DK3r JwrBKoWS/sAfBV8i2vp89nniERN2CVI77BzXii2eTyGdWhT26e1UI7SJFoBKFubFprMwUqJs9xu LVz4HxiYYK9OSSiAz1jqoBcrnmchd6/IJlPJCRmG6to1fw8uy32iqnSMdwu8/0sBy1fCsylUPX4 z8PkA= X-Received: by 2002:a05:600c:30ca:b0:3d5:365b:773e with SMTP id h10-20020a05600c30ca00b003d5365b773emr7957433wmn.39.1676902440956; Mon, 20 Feb 2023 06:14:00 -0800 (PST) X-Google-Smtp-Source: AK7set+q1NF3nmH+czue0pZ5lrJCM5Q54iuMEkMNUaBO5LCiXJVndEz32qLaqQJZ/Eo3GZbFgjrdsg== X-Received: by 2002:a05:600c:30ca:b0:3d5:365b:773e with SMTP id h10-20020a05600c30ca00b003d5365b773emr7957416wmn.39.1676902440568; Mon, 20 Feb 2023 06:14:00 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id s26-20020a7bc39a000000b003d9aa76dc6asm9075302wmj.0.2023.02.20.06.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 06:14:00 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 4/8] gdb/testsuite: extend the use of mi_clean_restart Date: Mon, 20 Feb 2023 14:13:49 +0000 Message-Id: <5f190f187e52272486ddc8c7f8510017ff75aad1.1676901929.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The mi_clean_restart proc calls the mi_gdb_start proc passing no arguments. In this commit I add an extra (optional) argument to the mi_clean_restart proc, and pass this through to mi_gdb_start. The benefit of this is that we can now use mi_clean_restart when we also want to pass the 'separate-mi-tty' or 'separate-inferior-tty' flags to mi_gdb_start, and avoids having to otherwise duplicate the contents of mi_clean_restart in different tests. I've updated the obvious places where this new functionality can be used, and I'm seeing no test regressions. --- gdb/testsuite/gdb.mi/mi-break.exp | 8 +------- gdb/testsuite/gdb.mi/mi-exec-run.exp | 1 - gdb/testsuite/gdb.mi/mi-multi-commands.exp | 3 +-- gdb/testsuite/gdb.mi/mi-watch.exp | 8 +------- gdb/testsuite/gdb.mi/new-ui-mi-sync.exp | 8 +------- gdb/testsuite/gdb.mi/user-selected-context-sync.exp | 8 +------- gdb/testsuite/lib/mi-support.exp | 4 ++-- 7 files changed, 7 insertions(+), 33 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 122a7dd77a4..5b5d3aad2e4 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -393,21 +393,15 @@ proc_with_prefix test_forced_conditions {} { proc test_break {mi_mode} { global srcdir subdir binfile - mi_gdb_exit - if {$mi_mode == "separate"} { set start_ops "separate-mi-tty" } else { set start_ops "" } - if [mi_gdb_start $start_ops] { + if [mi_clean_restart $binfile $start_ops ] { return } - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load ${binfile} - test_tbreak_creation_and_listing test_ignore_count diff --git a/gdb/testsuite/gdb.mi/mi-exec-run.exp b/gdb/testsuite/gdb.mi/mi-exec-run.exp index e3e6d9d6a21..722634a472b 100644 --- a/gdb/testsuite/gdb.mi/mi-exec-run.exp +++ b/gdb/testsuite/gdb.mi/mi-exec-run.exp @@ -73,7 +73,6 @@ proc test {inftty_mode mi_mode force_fail} { mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${bin} # Useful for debugging: diff --git a/gdb/testsuite/gdb.mi/mi-multi-commands.exp b/gdb/testsuite/gdb.mi/mi-multi-commands.exp index 00ab37cb64d..f07130d6fde 100644 --- a/gdb/testsuite/gdb.mi/mi-multi-commands.exp +++ b/gdb/testsuite/gdb.mi/mi-multi-commands.exp @@ -38,8 +38,7 @@ proc run_test { args } { global mi_gdb_prompt global decimal - gdb_exit - if [mi_gdb_start $args] { + if [mi_clean_restart "" $args] { return } diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index 5303a41e86e..aaac7611015 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -150,14 +150,12 @@ proc test_watchpoint_all {mi_mode type} { return } - mi_gdb_exit - if {$mi_mode == "separate"} { set start_ops "separate-mi-tty" } else { set start_ops "" } - if [mi_gdb_start $start_ops] { + if [mi_clean_restart ${binfile} $start_ops] { return } @@ -170,10 +168,6 @@ proc test_watchpoint_all {mi_mode type} { "567\\^done" \ "hw watchpoints toggle" - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load ${binfile} - mi_runto callee4 test_watchpoint_creation_and_listing #test_rwatch_creation_and_listing diff --git a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp index 07b316c8ce9..a19bbb9f597 100644 --- a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp +++ b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp @@ -40,17 +40,11 @@ proc do_test {sync_command} { global gdb_spawn_id gdb_main_spawn_id mi_spawn_id inferior_spawn_id global gdb_prompt mi_gdb_prompt - mi_gdb_exit - - if {[mi_gdb_start "separate-mi-tty"] != 0} { + if {[mi_clean_restart $binfile "separate-mi-tty"] != 0} { fail "could not start gdb" return } - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load $binfile - # Start a synchronous run/continue on the MI UI. set test "send synchronous execution command" if {$sync_command == "run"} { diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp index 91ca9b16bf8..9bcc90f06b4 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp @@ -396,22 +396,16 @@ proc_with_prefix test_setup { mode } { set any "\[^\r\n\]*" - mi_gdb_exit - save_vars { GDBFLAGS } { if { $mode == "non-stop" } { set GDBFLAGS [concat $GDBFLAGS " -ex \"set non-stop 1\""] } - if { [mi_gdb_start "separate-mi-tty"] != 0 } { + if { [mi_clean_restart $binfile "separate-mi-tty"] != 0 } { return -1 } } - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load $binfile - if { [mi_runto_main] < 0 } { return -1 } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 0963701140e..1a0dc584a4b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1012,7 +1012,7 @@ proc mi_run_with_cli {args} { # EXECUTABLE is the basename of the binary. # Return -1 if starting gdb or loading the executable failed. -proc mi_clean_restart {{executable ""}} { +proc mi_clean_restart {{executable ""} {flags {}}} { global srcdir global subdir global errcnt @@ -1024,7 +1024,7 @@ proc mi_clean_restart {{executable ""}} { set errcnt 0 set warncnt 0 - if {[mi_gdb_start]} { + if {[mi_gdb_start $flags]} { return -1 } -- 2.25.4