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 404AD3858D20 for ; Fri, 14 Apr 2023 10:11:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 404AD3858D20 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=1681467108; 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: in-reply-to:in-reply-to:references:references; bh=UZ9z2B95GBKBXa6+FKQltYizJiooRKM5YPtASnglF/k=; b=BC3n1PkHY9V64LbL14VExrA/VTdJ/c+ii9mXLKHmTnAVFVDKOFhOvGrGnWrIfsF0TERfVH ryiMTWYJUX4EJeLdup+jmj1Gibxu9ADsROi+R0qjnYAmDkyZciYO3PwYN2Y66sL2/2oKye YApW4LXMyOePnVX2UmzokfdOS2s3wJ4= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-T5sRU8gwMlurqw4v0Mc0ew-1; Fri, 14 Apr 2023 06:11:47 -0400 X-MC-Unique: T5sRU8gwMlurqw4v0Mc0ew-1 Received: by mail-ej1-f69.google.com with SMTP id rf18-20020a1709076a1200b009333eaeb2b3so6625103ejc.12 for ; Fri, 14 Apr 2023 03:11:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681467106; x=1684059106; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UZ9z2B95GBKBXa6+FKQltYizJiooRKM5YPtASnglF/k=; b=RQcxfJkKoPg8l0r4pfQxYqYptpapUBKful+3PsR9kWuIxpc4GOjarMvFelpKXbkwa/ xHewfx6G3C+BymFQiTKeIVDbTJ+izc2VCwvnn+ya0F43plFJTgoCrb9uasshnjWmoW44 puBs+FQAnwEgaS+uAFwfXo9Cy7KaaYYwpYlyalQ3D4tN4cDeYqmlcf/+N3GIrCDtRJRY fOObxqn2GyNLVyJio2TRHzVBy0sM09Ztf7rYVrwT2Jvv5Z3azSKQRkVT61T2TopYUvuG kevmhLxrrIoWLD8tkHr6AXu9j3YBmw66nUmSMN5PMAJnEdNZ2MeQheXl+ZjfnkM/3hal it0A== X-Gm-Message-State: AAQBX9eR5irnKgO7tffuwAIMt/27Gno7VZO9y67ZThzULAt4875cQ1G2 7D5ZTXI4oV4RRlU6zcslFsTWLJ+JYfOcUN45fxDi7zxyyMdW5KoKFecDpesnzOgo/eFdghV/N7G alrkz1KvQDzqGGt9OnOsO+5UjCIpoig== X-Received: by 2002:a17:906:7387:b0:932:4255:5902 with SMTP id f7-20020a170906738700b0093242555902mr5071742ejl.76.1681467106219; Fri, 14 Apr 2023 03:11:46 -0700 (PDT) X-Google-Smtp-Source: AKy350YadGHVCP1AjLLFK/IZDA7j0/y48nVKwMuaWNMnQleHUtsEMD/Kr/NDfYGAlaoyceVFaa0d/w== X-Received: by 2002:a17:906:7387:b0:932:4255:5902 with SMTP id f7-20020a170906738700b0093242555902mr5071711ejl.76.1681467105526; Fri, 14 Apr 2023 03:11:45 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id q17-20020a170906145100b0094a7c882638sm2236214ejc.90.2023.04.14.03.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 03:11:45 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [PATCH] [gdb/testsuite] Add regression test for PR30325 In-Reply-To: <20230414054944.892-1-tdevries@suse.de> References: <20230414054944.892-1-tdevries@suse.de> Date: Fri, 14 Apr 2023 11:11:42 +0100 Message-ID: <87bkjqai3l.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Tom de Vries writes: > Add regression tests for PR30325, one for the asm window and one for the > source window. > > Use maint set tui-left-margin verbose to make the extend of the left margin > clear. > > Tested on x86_64-linux. LGTM. Thanks for doing this. Approved-By: Andrew Burgess Thanks, Andrew > --- > gdb/testsuite/gdb.tui/main.exp | 9 ++++++++- > gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp | 11 +++++++++-- > 2 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.tui/main.exp b/gdb/testsuite/gdb.tui/main.exp > index e5f26c7aac3..7fc9969044f 100644 > --- a/gdb/testsuite/gdb.tui/main.exp > +++ b/gdb/testsuite/gdb.tui/main.exp > @@ -26,16 +26,23 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { > # Note: don't pass the executable here > Term::clean_restart 24 80 > > +set line " return 0;" > +set nr [gdb_get_line_number $line] > + > # Later on we'd like to avoid having to answer a question. > gdb_test_no_output "set interactive-mode off" > > +# Show the left margin using tui-left-margin-verbose. > +gdb_test_no_output "maint set tui-left-margin-verbose on" > + > if {![Term::enter_tui]} { > unsupported "TUI not supported" > return > } > > Term::command "file [standard_output_file $testfile]" > -Term::check_contents "show main after file" "\\|.*21 *return 0" > +Term::check_contents "show main after file" \ > + [string_to_regexp "|___[format %06d $nr]_$line"] > > # Ensure that "file" clears the source window. > Term::command "file" > diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp > index d32310fffcc..9014622d35c 100644 > --- a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp > +++ b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp > @@ -37,6 +37,9 @@ if { $gdb_file_cmd_debug_info == "nodebug" } { > return > } > > +# Show the left margin using tui-left-margin-verbose. > +gdb_test_no_output "maint set tui-left-margin-verbose on" > + > # This puts us into TUI mode, and should display the ASM window. > Term::command_no_prompt_prefix "layout asm" > Term::check_box_contents "check asm box contents" 0 0 80 15 "<_start>" > @@ -44,13 +47,17 @@ Term::check_box_contents "check asm box contents" 0 0 80 15 "<_start>" > # Record the first line of output, we'll need this later. > set first_line [Term::get_line 1] > > +# Check that the left margin contains three underscores. > +gdb_assert { [string match "|___0x*" $first_line] } \ > + "check verbose left margin" > + > # Scroll forward a large amount, this should take us to the last > # instruction in the program. > Term::command "+ 13" > Term::check_box_contents "check asm box contents again" 0 0 80 15 \ > [multi_line \ > - "^ *$hex\[^\r\n\]+" \ > - "\\s+"] > + "^___$hex\[^\r\n\]+" \ > + "___\\s+"] > > # Now scroll backward again, we should return to the start of the > # program. > > base-commit: f96328accde1e6302b62aa880675594618079cb3 > -- > 2.35.3