From patchwork Wed Nov 9 03:10:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 17335 Received: (qmail 46803 invoked by alias); 9 Nov 2016 03:10:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 46736 invoked by uid 89); 9 Nov 2016 03:10:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:sk:cable-1, H*RU:sk:cable-1, H*r:sk:cable-1, 8.5 X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Nov 2016 03:10:46 +0000 X-ASG-Debug-ID: 1478661044-0c856e65d59b3070001-fS2M51 Received: from smtp.electronicbox.net (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id sUdsOG8RiKKS8N92 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 08 Nov 2016 22:10:44 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.lan (cable-11.246.173-162.electronicbox.net [173.246.11.162]) by smtp.electronicbox.net (Postfix) with ESMTP id 5359C440E7D; Tue, 8 Nov 2016 22:10:44 -0500 (EST) From: Simon Marchi X-Barracuda-Effective-Source-IP: cable-11.246.173-162.electronicbox.net[173.246.11.162] X-Barracuda-Apparent-Source-IP: 173.246.11.162 X-Barracuda-RBL-IP: 173.246.11.162 To: gdb-patches@sourceware.org Cc: Pedro Alves , Simon Marchi Subject: [PATCH] Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix Date: Tue, 8 Nov 2016 22:10:43 -0500 X-ASG-Orig-Subj: [PATCH] Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix Message-Id: <20161109031043.7132-1-simon.marchi@polymtl.ca> In-Reply-To: <1478650771-24430-2-git-send-email-palves@redhat.com> References: <1478650771-24430-2-git-send-email-palves@redhat.com> X-Barracuda-Connect: smtp.electronicbox.net[96.127.255.82] X-Barracuda-Start-Time: 1478661044 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 6513 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.34361 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-IsSubscribed: yes Pedro's patch provides a cleaner way to prefix tests with the proc name, so let's use that. gdb/testsuite/ChangeLog: * gdb.mi/user-selected-context-sync.exp (with_test_prefix_procname): Remove. (test_setup); Define with proc_with_prefix. (test_cli_inferior): Likewise. (test_cli_thread): Likewise. (test_cli_frame): Likewise. (test_cli_select_frame): Likewise. (test_cli_up_down): Likewise. (test_mi_thread_select): Likewise. (test_mi_stack_select_frame): Likewise. (test_cli_in_mi_inferior): Likewise. (test_cli_in_mi_thread): Likewise. (test_cli_in_mi_frame): Likewise. (top level): Do not use with_test_prefix_procname. --- .../gdb.mi/user-selected-context-sync.exp | 55 +++++++++------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp index 382763c..d3f75d8 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp @@ -50,17 +50,6 @@ set main_break_line [gdb_get_line_number "main break line"] set thread_loop_line [gdb_get_line_number "thread loop line"] set thread_caller_line [gdb_get_line_number "thread caller line"] -# Call PROCNAME with the given arguments, inside a with_test_prefix $procname -# block. - -proc with_test_prefix_procname { procname args } { - with_test_prefix $procname { - # Note: this syntax requires TCL 8.5, if we need to support 8.4, - # we'll need to find an alternative. - $procname {*}$args - } -} - # Return whether we expect thread THREAD to be running in mode MODE. # # MODE can be either "all-stop" or "non-stop". @@ -377,7 +366,7 @@ proc test_continue_to_start { mode inf } { # # MODE can be either "all-stop" or "non-stop". -proc test_setup { mode } { +proc_with_prefix test_setup { mode } { global srcfile global srcdir global subdir @@ -535,7 +524,7 @@ proc match_re_or_ensure_not_output { re test } { # Test selecting an inferior from CLI. -proc test_cli_inferior { mode } { +proc_with_prefix test_cli_inferior { mode } { global gdb_main_spawn_id mi_spawn_id reset_selection "1.1" @@ -567,7 +556,7 @@ proc test_cli_inferior { mode } { # Test thread selection from CLI. -proc test_cli_thread { mode } { +proc_with_prefix test_cli_thread { mode } { global gdb_main_spawn_id global mi_spawn_id @@ -671,7 +660,7 @@ proc test_cli_thread { mode } { # Test frame selection from CLI. -proc test_cli_frame { mode } { +proc_with_prefix test_cli_frame { mode } { global gdb_main_spawn_id mi_spawn_id with_test_prefix "thread 1.2" { @@ -756,7 +745,7 @@ proc test_cli_frame { mode } { # Test frame selection from CLI with the select-frame command. -proc test_cli_select_frame { mode } { +proc_with_prefix test_cli_select_frame { mode } { global gdb_main_spawn_id mi_spawn_id expect_out with_test_prefix "thread 1.2" { @@ -818,7 +807,7 @@ proc test_cli_select_frame { mode } { # Test doing an up and then down command from CLI. -proc test_cli_up_down { mode } { +proc_with_prefix test_cli_up_down { mode } { global gdb_main_spawn_id mi_spawn_id reset_selection "1.2" @@ -853,7 +842,7 @@ proc test_cli_up_down { mode } { # Test selecting a thread from MI. -proc test_mi_thread_select { mode } { +proc_with_prefix test_mi_thread_select { mode } { global gdb_main_spawn_id mi_spawn_id reset_selection "1.1" @@ -948,7 +937,7 @@ proc test_mi_thread_select { mode } { # place to test it. } -proc test_mi_stack_select_frame { mode } { +proc_with_prefix test_mi_stack_select_frame { mode } { global gdb_main_spawn_id mi_spawn_id with_test_prefix "thread 1.2" { @@ -1019,7 +1008,7 @@ proc make_cli_in_mi_command { cli_in_mi_mode command } { # Test selecting the inferior using a CLI command in the MI channel. -proc test_cli_in_mi_inferior { mode cli_in_mi_mode } { +proc_with_prefix test_cli_in_mi_inferior { mode cli_in_mi_mode } { global gdb_main_spawn_id mi_spawn_id reset_selection "1.1" @@ -1051,7 +1040,7 @@ proc test_cli_in_mi_inferior { mode cli_in_mi_mode } { # Test selecting the thread using a CLI command in the MI channel. -proc test_cli_in_mi_thread { mode cli_in_mi_mode } { +proc_with_prefix test_cli_in_mi_thread { mode cli_in_mi_mode } { global gdb_main_spawn_id mi_spawn_id reset_selection "1.1" @@ -1164,7 +1153,7 @@ proc test_cli_in_mi_thread { mode cli_in_mi_mode } { # Test selecting the frame using a CLI command in the MI channel. -proc test_cli_in_mi_frame { mode cli_in_mi_mode } { +proc_with_prefix test_cli_in_mi_frame { mode cli_in_mi_mode } { global gdb_main_spawn_id mi_spawn_id with_test_prefix "thread 1.2" { @@ -1258,28 +1247,28 @@ proc test_cli_in_mi_frame { mode cli_in_mi_mode } { } foreach_with_prefix mode { "all-stop" "non-stop" } { - with_test_prefix_procname test_setup $mode + test_setup $mode # Test selecting inferior, thread and frame from CLI - with_test_prefix_procname test_cli_inferior $mode - with_test_prefix_procname test_cli_thread $mode - with_test_prefix_procname test_cli_frame $mode - with_test_prefix_procname test_cli_select_frame $mode - with_test_prefix_procname test_cli_up_down $mode + test_cli_inferior $mode + test_cli_thread $mode + test_cli_frame $mode + test_cli_select_frame $mode + test_cli_up_down $mode # Test selecting thread and frame from MI - with_test_prefix_procname test_mi_thread_select $mode - with_test_prefix_procname test_mi_stack_select_frame $mode + test_mi_thread_select $mode + test_mi_stack_select_frame $mode # Test some CLI commands sent through MI, both with a "direct" command, # such as "thread 1", and with -interpreter-exec, such as # '-interpreter-exec console "thread 1"'. foreach_with_prefix exec_mode {"direct" "interpreter-exec"} { - with_test_prefix_procname test_cli_in_mi_inferior $mode $exec_mode - with_test_prefix_procname test_cli_in_mi_thread $mode $exec_mode - with_test_prefix_procname test_cli_in_mi_frame $mode $exec_mode + test_cli_in_mi_inferior $mode $exec_mode + test_cli_in_mi_thread $mode $exec_mode + test_cli_in_mi_frame $mode $exec_mode } }