From patchwork Thu Apr 3 16:26:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 877940 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3355781wrs; Thu, 3 Apr 2025 09:28:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfbrSZ34V/E4HZM5nywnRm8E8jjozOhmXoTmDXYF9CmUxSUhLZtkjgcTalJpyH0JN/F6iBYg==@linaro.org X-Google-Smtp-Source: AGHT+IG2mOKDP59rG7MEEXMGiDPW7QDqULZSgp3uJmK0kQezO2fjV9a5xv/P4n9lRO7kRasyFXBv X-Received: by 2002:a05:622a:448:b0:476:884e:52ee with SMTP id d75a77b69052e-4792490da50mr1167041cf.11.1743697713614; Thu, 03 Apr 2025 09:28:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1743697713; cv=pass; d=google.com; s=arc-20240605; b=lEeCAHDrpCwMNQfziQjjLKpl+dREVNoybT3Gk5U1j4pK9XQv5pUP07+ew+qJ9BtJIY KOT6UHfVhUfR13oMOVxBGd8/h3yzi/5EMLzfSYiuGkfDe5mi8RuAHENA1RHWi7Ltd1CJ XG940aA7aXxoAqSZ89CTHqvixPZfx+JuILhxiFdEapkfRrLMKOt/TBxPrE6Vjl8fH90e 82++nh6NC+uAUlG4vDNgcP1ulK8SQ4KQdo8weiZ1+MSzSqLXwWzdoy4ms3g8/UmOOa4P Vww+Z0R8IyC3OmlbxKeoMfPoc5pWIzWWTMJn8+rSqcgSElQwPcUujv6BykAkqh4BJVSo F43g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=RkxnGp3TVc4Eub1E1vNUtrOc1ypYiN2HW7zqSdJgerA=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=ewKCSoX/F4mxHxgqOtaz4UndFQCidtV3lMUGmlVUnQ7erjwCJp4WQGmO3U+//ndYoJ X0uJlDGuLkO+eMh7EIBTYmG/NGGIyngmBmSMDMDSYdAwfpt80sFpqnD2dgInXyeAKVjw 9itGKkAsboxHcXjg6s2WAEI/CbN9SyLSCvz00roBG7IVg2GqQpN3FTZu+j+fL0HQCx/f m7jpJpw2V6ylfPuEmV1XgcJGd/m0oZELbemBpv2aDFpMS3In5t//3Esf/ovh/31FLmSg 9gAe0s4oWTwt+3CWvHi5zzBJ3agMaA5Ivf2rD9rYLxh8uKUX2EFYguG+8KSJzdGE7avA Fx4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=APIrWRpn; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d75a77b69052e-4791b1995f9si12976731cf.448.2025.04.03.09.28.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 09:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=APIrWRpn; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 341FD383603A for ; Thu, 3 Apr 2025 16:28:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 341FD383603A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=APIrWRpn X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 81A073836011 for ; Thu, 3 Apr 2025 16:26:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81A073836011 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 81A073836011 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743697610; cv=none; b=sCdXxI8/pdJgU8lwD41e+j+6K/5O05lJVi6sak8tqMISY4VrOFTp//PzXdFcI1GbT9R/pZg9KzZ73QsA0amHAdT2kIu8OsoMuz0JN0qzQ/REtWlzlKU8W1orF7FMuJCZL5JW7RoG3iCIpOvLI1Dsx99az6jh4foJeHkB3tBjUUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743697610; c=relaxed/simple; bh=dukSIBp6+0BYwmJbf93BWq1yF4HxVfpwzRKq/Uv1jf4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XzhHbDOq3tu2jyzA0imB8jNH+mmHr8beO1dsuSM1AM2SYzAonOQq5FP4f76mCnYr4p0DNXs/8Yx7wNuZY0mdlVIDJuYQ8Jy23DVmjsunvMe0JD2VuQqBqXiX/TxDFL2smUlMDeVl0bhjeHVfojDDJk0T2qc46BSU4lxA5968i0Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81A073836011 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7399a2dc13fso1464387b3a.2 for ; Thu, 03 Apr 2025 09:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743697609; x=1744302409; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=RkxnGp3TVc4Eub1E1vNUtrOc1ypYiN2HW7zqSdJgerA=; b=APIrWRpnuluY6fxEM182lqyChG17KaIjEMlAyPqHo8DUt4PkTflWHPj5AToHu0mfVJ 2lRMFSPLIPq643/A4Bn3SFZ55+V9Bnkap5lFg933ilC8yjpz+U6BKZoXE+LosSbzMLI9 y7RynExaoYtCe+sXeSq+0seLU2Jn9nDLmoqRglHScg7+tY/8SkCdUypvD/7TWyMU8P5Z sciMECreo1uxk9mkdew8HRCHCahff3FRXKPJ51/W/a/nzth/p3QdJNncMqqItCHUVJOi FNcPDf6idb+INVGHo/XUnrWE8f6R6Jnzn5pIsmqQvR67QLfvOOmqh1s7rLb/8P1tLGzN TwfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743697609; x=1744302409; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RkxnGp3TVc4Eub1E1vNUtrOc1ypYiN2HW7zqSdJgerA=; b=Z8JznymJ8f71+E/ifdsbbgsxN+3BwQ3Gl7vSsD2vIRFSIngDGBQf6aoaAXZBktuydx Jw6zH1NDWXHb79Leu7Oea5+2C64XZbOGpbShJvezILNkorY83M0ywIOYtPw6xOTuxxs3 nPnokWfduus0wX05LuRRMXpIitF9JDBrDkRdT08Gku21dddNe8Wldu6OM60g4eUW8nKh 9uiK5F+EvdwmbbWz1osEXL//ZWlo3uQYtCs0qvs1iTvoNMouMkBPAqxaWg26EHM3z9x9 IQjGOQkqCD5yiD3sgx2KGA3t6cxOmr5PYUPvSaDkPekaly2Am6JG6L+38FiShaO271Yb FAJQ== X-Gm-Message-State: AOJu0YxM3+NjHXRNigEuBjjblxGD965j1SNmL8feY3yeRHPmtFReK0nT yUDo10KKfy8ZHquUGewZe5nR0G7ycTN6Z+gOfGC0XdOgqpn+CK5tbcNCWKG0DZ07FcfX6HQewAJ M X-Gm-Gg: ASbGncvYepU/BPRknIMfYUJC93bQE1KxA0D+9bmTP6qYGPkv5BgVcEMnx2ImQwCKV51 eArDdNy/rybRn4FhL2OIffhn8Y8WDShObL/IBu46W0xbxfDZ7z3KKEBC1WAyH5YlyZDD/b02GQ0 VcHLDJUvZ35ydpeJ/P15syv7iasZ+rKyTBlq/xBRmSu35gDbjabz08YITQBSxM1BTERBl5pVDD+ MognFsF6dnSQLUX4dx5n6C2nJyAcs7fE8gQG3qCBcVjzZxFrYr2M4nOPjYTvdGRZXRndvqMu07a Kc8Z2Ryoi7mu0yk8WUA/dUnjk1xYO8zSAh1XLqsSj5fCGaTzsMfeJ2k= X-Received: by 2002:a05:6a00:2381:b0:735:d89c:4b8e with SMTP id d2e1a72fcca58-739e48cf25bmr268663b3a.5.1743697608787; Thu, 03 Apr 2025 09:26:48 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8209:8d6c:9fab:6cfd:6457]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739da0e3745sm1748231b3a.172.2025.04.03.09.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 09:26:48 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH 1/2] gdb/testsuite: Fix flakiness in gdb.base/default.exp Date: Thu, 3 Apr 2025 13:26:44 -0300 Message-ID: <20250403162645.438432-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patch=linaro.org@sourceware.org The Linaro CI runs the GDB testsuite using the read1 tool, which significantly increases the time it takes DejaGNU to read inferior output. On top of that sometimes the test machine has higher than normal load, which causes tests to run even slower. Because gdb.base/default.exp tests some verbose commands such as "info set", it sometimes times out while waiting for the complete command output when running in the Linaro CI environment. Fix this problem by consuming each line of output from the most verbose commands with gdb_test_multiple's -lbl (line-by-line) option — which causes DejaGNU to reset the timeout after each match — and also by breaking up regular expressions that try to match more than 2000 characters (the default Expect buffer size) in one go into multiple matches. Some tests use the same regular expression, so I created a procedure for them. This is the case for "i" / "info", "info set" / "show", and "set print" tests. The tests for "show print" don't actually test their output, so this patch improves them by checking some lines of the output. --- gdb/testsuite/gdb.base/default.exp | 223 +++++++++++++++++++++-------- 1 file changed, 163 insertions(+), 60 deletions(-) base-commit: d600d392d511f7a304c6bfa4797cde35f839e180 diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 93a6733c9ad4..50345b81278d 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -253,10 +253,42 @@ gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- User-d gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- User-defined aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." #test handle gdb_test "handle" "Argument required .signal to handle.*" -#test info "i" abbreviation -gdb_test "i" "List of \"info\" subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation" + +proc test_info_command { command message } { + set saw_info_header 0 + set saw_help_info 0 + set saw_command_abbrev 0 + gdb_test_multiple $command $message -lbl { + -re "\r\nList of \"info\" subcommands:" { + verbose "Info header displayed" + set saw_info_header 1 + exp_continue + } + -re "Type \"help info\" followed by subcommand name for full documentation\\." { + verbose "Help info displayed" + set saw_help_info 1 + exp_continue + } + -re "\r\nCommand name abbreviations are allowed if unambiguous\\." { + verbose "Command name abbreviations displayed" + set saw_command_abbrev 1 + exp_continue + } + -re -wrap "" { + if { $saw_info_header && $saw_help_info && $saw_command_abbrev } { + pass $gdb_test_name + } else { + fail $gdb_test_name + } + } + } +} + +#test info "i" abbreviation +test_info_command "i" "info \"i\" abbreviation" #test info -gdb_test "info" "List of \"info\" subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." +test_info_command "info" "info" + #test ignore gdb_test "ignore" "Argument required .a breakpoint number.*" #test info address @@ -379,38 +411,58 @@ gdb_test "info registers" "The program has no registers now." gdb_test "info s" "No stack." "info stack \"s\" abbreviation" #test info stack gdb_test "info stack" "No stack." -#test info set -# Test improved to check three parts: -# 1) confirm -# 2) prompt -# 3) write -# And only succeed if all three are matched. -# This should fix an old problem on native solaris 2.8, -# where this test fails due to this line: + +#test "info set" and "show" commands +# The test needs to match the "prompt: ..." part to fix an old problem on native +# Solaris 2.8, where this test fails due to this line: # prompt: Gdb's prompt is "(gdb) ".^M -set set_confirm_seen 0 -set set_prompt_seen 0 -gdb_test_multiple "info set" "info set" { - -re "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename: The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize: Number of source lines gdb will list by default is 10" { - verbose "Confirm dislayed" - set set_confirm_seen 1 - exp_continue - } - -re "Gdb's prompt is \"$gdb_prompt \"" { - verbose "GDB prompt displayed" - set set_prompt_seen 1 - exp_continue - } - -re "Writing into executable.*$gdb_prompt $" { - verbose "write displayed" - if { $set_prompt_seen && $set_confirm_seen } { - pass "info set" - } else { - verbose "prompt $set_prompt_seen confirm $set_confirm_seen" - fail "info set (incomplete output)" +proc test_info_set_show { command } { + set set_confirm_seen 0 + set set_history_filename_seen 0 + set set_listsize_seen 0 + set set_prompt_seen 0 + set set_write_seen 0 + gdb_test_multiple $command $command -lbl { + -re "\r\nconfirm: Whether to confirm potentially dangerous operations is o\[a-z\]+\\." { + verbose "Confirm displayed" + set set_confirm_seen 1 + exp_continue + } + -re "\r\nhistory filename: The filename in which to record the command history is \[^\r\n\]+\\." { + verbose "History filename displayed" + set set_history_filename_seen 1 + exp_continue + } + -re "\r\nlistsize: Number of source lines gdb will list by default is 10\\." { + verbose "Listsize displayed" + set set_listsize_seen 1 + exp_continue + } + -re "\r\nprompt: Gdb's prompt is \"$::gdb_prompt \"" { + verbose "GDB prompt displayed" + set set_prompt_seen 1 + exp_continue + } + -re "write: Writing into executable and core files is o\[a-z\]+\\." { + verbose "Write displayed" + set set_write_seen 1 + exp_continue + } + -re -wrap "" { + if { $set_confirm_seen && $set_history_filename_seen + && $set_listsize_seen && $set_prompt_seen && $set_write_seen } { + pass $gdb_test_name + } else { + verbose "confirm $set_confirm_seen history $set_history_filename_seen" + verbose "listsize $set_listsize_seen prompt $set_prompt_seen" + verbose "write $set_write_seen" + fail "$gdb_test_name (incomplete output)" + } } } } +test_info_set_show "info set" + gdb_test "info symbol" "Argument required .address.." #test info source gdb_test "info source" "No current source file..*" @@ -591,12 +643,44 @@ gdb_test "set history" "List of \"set history\" subcommands:(\[^\r\n\]*\[\r\n\]) gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust." #test set listsize gdb_test "set listsize" "Argument required .integer to set it to.*" + +proc test_set_print { command message } { + set saw_info_header 0 + set saw_help_info 0 + set saw_command_abbrev 0 + gdb_test_multiple $command $message -lbl { + -re "\r\nList of \"set print\" subcommands:" { + verbose "Info header displayed" + set saw_info_header 1 + exp_continue + } + -re "Type \"help set print\" followed by subcommand name for full documentation\\." { + verbose "Help info displayed" + set saw_help_info 1 + exp_continue + } + -re "\r\nCommand name abbreviations are allowed if unambiguous\\." { + verbose "Command name abbreviations displayed" + set saw_command_abbrev 1 + exp_continue + } + -re -wrap "" { + if { $saw_info_header && $saw_help_info && $saw_command_abbrev } { + pass $gdb_test_name + } else { + fail $gdb_test_name + } + } + } +} + #test set print "p" abbreviation -gdb_test "set p" "List of \"set print\" subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation" +test_set_print "set p" "set print \"p\" abbreviation" #test set print "pr" abbreviation -gdb_test "set pr" "List of \"set print\" subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation" +test_set_print "set pr" "set print \"pr\" abbreviation" #test set print -gdb_test "set print" "List of \"set print\" subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." +test_set_print "set print" "set print" + #test set print address gdb_test_no_output "set print address" "set print address" #test set print array @@ -739,12 +823,51 @@ gdb_test "show history" "history expansion: *History expansion on command input gdb_test "show language" "The current source language is \"auto; currently c\"." #test show listsize gdb_test "show listsize" "Number of source lines gdb will list by default is 10." + +proc test_show_print { command } { + set saw_print_address 0 + set saw_print_frame_args 0 + set saw_print_symbol 0 + set saw_print_vtbl 0 + gdb_test_multiple $command $command -lbl { + -re "\r\nprint address: Printing of addresses is o\[a-z\]+\\." { + verbose "Print address displayed" + set saw_print_address 1 + exp_continue + } + -re "\r\nprint frame-arguments: Printing of non-scalar frame arguments is \[^\r\n\]+\\." { + verbose "Print frame-arguments displayed" + set saw_print_frame_args 1 + exp_continue + } + -re "\r\nprint symbol: Printing of symbols when printing pointers is o\[a-z\]+\\." { + verbose "Print symbol displayed" + set saw_print_symbol 1 + exp_continue + } + -re "\r\nprint vtbl: Printing of C\\+\\+ virtual function tables is o\[a-z\]+\\." { + verbose "Print vtbl displayed" + set saw_print_vtbl 1 + exp_continue + } + -re -wrap "" { + if { $saw_print_address && $saw_print_frame_args + && $saw_print_symbol && $saw_print_vtbl } { + pass $gdb_test_name + } else { + fail $gdb_test_name + } + } + } +} + #test show print "p" abbreviation -gdb_test "show p" ".*" +test_show_print "show p" #test show print "pr" abbreviation -gdb_test "show pr" ".*" +test_show_print "show pr" #test show print -gdb_test "show print" ".*" +test_show_print "show print" + #test show paths gdb_test "show paths" "Executable and object file path:.*" #test show print address @@ -790,30 +913,10 @@ gdb_test "show width" "Number of characters gdb thinks are in a line is.*" #test show write # This is only supported on targets which use exec.o. gdb_test "show write" "Writing into executable and core files is o.*" + #test show -set show_confirm_seen 0 -set show_prompt_seen 0 -gdb_test_multiple "show" "show" { - -re "confirm: *Whether to confirm potentially dangerous operations is on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+history save: *Saving of the history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *The size of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number of source lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elements: *Limit on string chars or array elements to print is 200." { - verbose "Confirm displayed" - set show_confirm_seen 1 - exp_continue - } - -re "Gdb's prompt is \"$gdb_prompt \"" { - verbose "GDB prompt displayed" - set show_prompt_seen 1 - exp_continue - } - -re "Writing into executable.*$gdb_prompt $" { - verbose "write displayed" - if { $show_prompt_seen && $show_confirm_seen } { - pass "show" - } else { - verbose "prompt $show_prompt_seen confirm $show_confirm_seen" - fail "show (incomplete output)" - } - } -} +test_info_set_show "show" + #history saving should stay disabled gdb_test_no_output "set history save off" "set history save off" #test stepi "si" abbreviation From patchwork Thu Apr 3 16:26:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 877939 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3355423wrs; Thu, 3 Apr 2025 09:27:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdBl1SqI7B/NwLD7Pzg/NDg8/y4K9/TS3WLaDOW1OuGqNok7/bEgQq+LxSkTv9EXQ7xQvIPQ==@linaro.org X-Google-Smtp-Source: AGHT+IEzIBzLY6X1tjVAM7gPOETbO85SyZGxL7+3f2TiMPdAof/e2/iOyQO/9H7cczmcKgH0IK0x X-Received: by 2002:a05:620a:31a9:b0:7c5:4e7e:189d with SMTP id af79cd13be357-7c690894e36mr3471708385a.50.1743697673184; Thu, 03 Apr 2025 09:27:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1743697673; cv=pass; d=google.com; s=arc-20240605; b=kH9WHFapdMnOV2oYe2N4lDy2S8z7oWhDxQGAPezu0P8h6i7bur+GSjTEPqeOkQ3w2Y hxMp9k/VV49+PHpGuShjPwuq4+nyaJEmQAlAKahDPaHPq02oD4Ogfxis8Wq5E3GGMTd4 oO3E8UjF5E2UtsxY8Jeqce4jwYZT+pSDLHch8yeC+PIwR4v4d560Fo12DyLRFmva2QB8 h/lcPQ+29P0knblPQpMAPtcuqRkJdNw/YeCLxWORp8ZYbELtpGXZX0+abMAtrqoekEx2 lAOImOGSa4XmnPgkwy7vS4yEpAyhlhQ4lJ75iD2v0Pw3g8RzE29JupapvTRN4speNSNr ZqAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:dkim-filter:arc-filter:dmarc-filter:delivered-to :dkim-filter; bh=YDelCDBh68fGSpsIj+MzmPi2d9gnzsxBfIHOS9TvEYQ=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=bNjqKySROkQSV44u0B1aoZa0BkfhK4Oa0m7u+EDClnzwR9qFb/lK4K2WWUy9qWO35J p8oEICXZa8J9lYwHGc/BiqoAhXUZhBcDZwZsytv9ghClWGfmhj/fVhjfOC9as9WEoize sLlg/NeyfOluOtsOUCPtKUPBEwkdB8qHEX0AQNGfOSGpcThZPf5SLTsUYXhA7+vD1+ZZ ZEdl+eZBx4l3yuGn0ZlAEuXKdBQiaEHJ9eis1lTJpTdt/po5WInmk065hSW7gNoCf/NF Ey769uhZmVVzjGJABLGBuXlsWWHMoSLLks+779gdfKbRNzzmut5In/unbJhhLejslkNU 4rag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TpS3C/Zi"; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id af79cd13be357-7c76e74a1a1si143249785a.107.2025.04.03.09.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 09:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TpS3C/Zi"; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AFA723835C38 for ; Thu, 3 Apr 2025 16:27:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFA723835C38 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TpS3C/Zi X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id D40CC3842FD2 for ; Thu, 3 Apr 2025 16:26:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D40CC3842FD2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D40CC3842FD2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743697613; cv=none; b=bUUw0fh+3iI1IMHtV3va9XpyYM2o02Z+FXykdo2GqYupJUPt1ncOToLW5Ew1Q+N77U5keKdHs5n78o7HCtGiRmJi/Ok9UeCbRAr5M1+y9FazFTYZfzHAQQS+4YZNXSpnynFejNmLb8xUbVHCgNRhbZEGQEMKYfhTlFqa4kHIe2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743697613; c=relaxed/simple; bh=AXDt50h61ZAbmJ2sPZ/ntxhkTt/T0VcgxaJeN71s3v4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UvHU4G4lup4EnKkerQvBkMMaQhwhxp3XVTNro+U79oO/Lumzh/rHpP2RKEYpRZ1Jjoz94o6bsHq3JlNl72ZdU8mLKNy66221tCcTiP3xKwkZbWpwV1rtE6oysXcXOtRa4loN7NgeEC7AdmddaLAD4cX2yjW9O4Ksr382PhnA758= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D40CC3842FD2 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2264aefc45dso16347285ad.0 for ; Thu, 03 Apr 2025 09:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743697612; x=1744302412; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YDelCDBh68fGSpsIj+MzmPi2d9gnzsxBfIHOS9TvEYQ=; b=TpS3C/ZiUDO9sJAneB9JEMVCF1XPE2IRltI7n7YIja37mzSb7jT//Ia5G37D0jHjE7 87cJa71GlpubqYGe30w+TaJqpjSTckLqytLFSpJlTqGxPl1mR1rsD/CzxAH2wZb7qFuV jltQ3WXBG0NtpSGoxPYpadkX555bGXFjPsb+JyiQrAMkwsQtkLYuGqHZHmLjQqGtkmPg LgFqhphlrFBwJSSFCsvbgvI5sE2GF1VleXcDtaRzdKg0CqybuSdE0EbhdgF5L9X8RQcS 8c2NewKPSeyhg31Yn/Qb0Es4aM1AwhGfxRfhREQquVQFmfBUG+qsiRuXJLdu9qe5gjts 8uUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743697612; x=1744302412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YDelCDBh68fGSpsIj+MzmPi2d9gnzsxBfIHOS9TvEYQ=; b=mMcC0CiA73DHGe0yEQXsGoZjQuHpuwnkpfD+qT3+LNudN280VoXzRoQTwGpm8Zn18X uXXRh76yLbAzX9xmUmxNvjlx5dY7YPmUZddlUSFM6NSymbcPJ6ITx6cuMlTaRSs90d8U oaEnLucgZSnrG2hHqjqN7V5tMN2a12f9cPPMJyry98PIS5G54zLbDqtSkKyj3dFtn2W8 MzKPVAJ8ZQxgn3t3p3cCVZIGeIw+NX684Ga16S1YbuS4ndjsfcN+lbOS/QvcP82hNhEt O+0vi5lzTJFUugiQ0a+YcnWtAHT5P4qj6a1b/YrzghfiahSLL7Y+ExDFY/LnT07zFCvv P7QA== X-Gm-Message-State: AOJu0YxQ4qYeVnw7n2nLOgtSIH7exLRcn6IngEhrKCl/rdfsxH94ep07 nIHZ/UaD/WJnYuQC4BBu0oKf1W4WTt36RSSww7XKavRj5nhotowvP2Uln9ffbKXe93gRsek3AtC C X-Gm-Gg: ASbGncvZc96+Cryee6teUrcv/tYXzvc6IwHwaml4KCwEwK0blYfp6j5rHTvAxZhWIql rIHYvkxJiUkVAWwAhxJpLR8Gi8cxeQEpgEj/nBmtltId+xrXE0LGGBtu9qwoJREDpaOl572c8Gp 4c534o48cOWSNJ4joM0ztyf+hkH30gX/2dThPLWu8aTuiqMRVhxRJSbZWsMFzp5PoMd02NbgxYD Va7Uq6keLyiZoGh/YEmjkJXBeaYzKKUx+AfzXrShQG9deAfUvbl9BRzGYevAnd6lTrhgARBPlDT mxRVQUfFqhP1OA+Gz+aPym8BCUj9fd700wxScW10JYl/CffdIs2675A= X-Received: by 2002:a17:902:ea03:b0:223:536d:f67b with SMTP id d9443c01a7336-2292f9f607fmr376783845ad.38.1743697611880; Thu, 03 Apr 2025 09:26:51 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8209:8d6c:9fab:6cfd:6457]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-229786608c6sm16545305ad.148.2025.04.03.09.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 09:26:51 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH 2/2] gdb/testsuite: Clarify -lbl option in gdb_test_multiple Date: Thu, 3 Apr 2025 13:26:45 -0300 Message-ID: <20250403162645.438432-2-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250403162645.438432-1-thiago.bauermann@linaro.org> References: <20250403162645.438432-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patch=linaro.org@sourceware.org I was a bit confused about the -lbl option in gdb_test_multiple, and needed to read its implementation to determine that it would be useful for my needs. Explicitly mention what the option does and why it's useful to hopefully help other developers. --- gdb/testsuite/lib/gdb.exp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 59967c70cda9..0ff6b69421cb 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1026,7 +1026,10 @@ proc command_to_message { command } { # should not be anchored at the end of the buffer. This means that the # pattern can match even if there is stuff output after the prompt. Does not # have any effect if -prompt is specified. -# -lbl specifies that line-by-line matching will be used. +# -lbl specifies that line-by-line matching will be used. This means +# that lines from GDB not matched by any pattern will be consumed from +# the output buffer. This helps avoid buffer overflows and timeouts +# when testing verbose commands. # EXPECT_ARGUMENTS will be fed to expect in addition to the standard # patterns. Pattern elements will be evaluated in the caller's # context; action elements will be executed in the caller's context.