From patchwork Fri Jan 6 10:25:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 62780 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B77C9385800A for ; Fri, 6 Jan 2023 10:26:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B77C9385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673000784; bh=PShYEFtoO9Sa7eigusz3QJbiNJpNfGbXjX26lZZR/gc=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ySjtFndwKjQ1m4Epi3rqbyLRHuz5QrdLDRCl1WH4b56utQ5vVKwRII8Kv9P7Tl9wO Fifc97lxWHe3uDXn6sSng5wvo9XyvqOGBOjWrhets49IsIUflK4zqS2/1Omjaf4QVR r4JETIiN/YLwqZgpBs4WCVnQ/Tn1ueDcZQ2T5P0M= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 32FF4385841D for ; Fri, 6 Jan 2023 10:25:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32FF4385841D Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-446-Ic2Q2ZN_NlekRsaR2kPLpg-1; Fri, 06 Jan 2023 05:25:52 -0500 X-MC-Unique: Ic2Q2ZN_NlekRsaR2kPLpg-1 Received: by mail-ej1-f71.google.com with SMTP id jg25-20020a170907971900b007c0e98ad898so869696ejc.15 for ; Fri, 06 Jan 2023 02:25:52 -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=PShYEFtoO9Sa7eigusz3QJbiNJpNfGbXjX26lZZR/gc=; b=CCb/FU6T440uCauZ2TjuvuzfdlLLsH1UpzF7vpvFtPyfvU8ZEOprr3zCXcuwuy3EMJ l9mcn6va6u+86qwF1z+pl4njh+6q+4OcIlGhA3fQGjhUaMDmEza71T0ZcO6YnoOdjUSn 1JOVQ7rhUC4txea1y60aRJPkqSFC7h40VktVI186lziLR1UtOvsBWKoy4qtX8zxEXIc8 NiUK9le2lTRq0k2+l2TdGgmDbPB0GsNWxpRVOYDcj/NmlGgybyBAUh+jCVBPO5qPoBCa KRfVuO76XwyJeeUiHCWFS1dxNFqMF+GfaGIjRp+6u+7pbIORkB42o/bptQgmYGKh1UhU HArw== X-Gm-Message-State: AFqh2ko/iphTBJgNfRihY1szslm0Afz+fEq5X3ob4WDteR9zjlbUtUMB xRF+GGtD/f2A95hJWFtZrIG/S8SJ7n4AeE9Plca/JSrqZSbD5R5x8gXahb1V3wCza4sFHy2alaT xUjxMYKqOswlKVAw++Ef0t79MK2OWz3cdIAP3N5JFKCx9Ts+nXCvMycTMtrWqhaVd/9lKWJAkpw == X-Received: by 2002:a17:906:688f:b0:7ae:31a0:571c with SMTP id n15-20020a170906688f00b007ae31a0571cmr47862483ejr.57.1673000751567; Fri, 06 Jan 2023 02:25:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXskfPOwIotcwZ0OzXf59fIA/YkI/nTMXoZ273w2qMFFFiD06ZjVMuOhBNGFdxt9ItRkcjmONg== X-Received: by 2002:a17:906:688f:b0:7ae:31a0:571c with SMTP id n15-20020a170906688f00b007ae31a0571cmr47862470ejr.57.1673000751279; Fri, 06 Jan 2023 02:25:51 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id e6-20020a170906314600b00781be3e7badsm272826eje.53.2023.01.06.02.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 02:25:50 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 02/15] gdb/testsuite: update gdb.tui/tui-disasm-long-lines.exp Date: Fri, 6 Jan 2023 10:25:29 +0000 Message-Id: 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 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, KAM_SHORT, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Following on from the previous commit, in this commit I am updating the test script gdb.tui/tui-disasm-long-lines.exp to take account of the changes in commit: commit 9162a27c5f5828240b53379d735679e2a69a9f41 Date: Tue Nov 13 11:59:03 2018 -0700 Change gdb test suite's TERM setting In the above commit the TERM environment variable was changed to be 'dumb' by default, which means that tests, that previously activated tui mode, no longer do unless TERM is set to 'ansi'. As the gdb.tui/tui-disasm-long-lines.exp script didn't do this, the test stopped working. As the expect patterns in this script were pretty generic no tests actually started failing, and we never noticed. In this commit I update the script to use Term::clean_restart, which correctly sets TERM to 'ansi'. I've also added a check that the asm box does appear on the screen, which should indicate that tui mode has correctly activated. However, I also notice that GDB doesn't appear to fully work correctly. The test should display the disassembly for the test program, but it doesn't. The test is trying to disassemble some code that (deliberately) uses a very long symbol name, this eventually results in GDB entering tui_source_window_base::show_source_content and trying to allocate an ncurses pad in order to hold the current page of disassembler output. Unfortunately, due to the very long line, the call to newpad fails, meaning that tui_source_window_base::m_pad is nullptr. Luckily non of the following calls appear to crash when passed a nullptr, however, all the output that is written to the pad is lost, which is why we don't see any assembly code written to the screen. As the test history indicates that the script was originally checking for a crash in GDB when the long identifier was encountered, I think there is value in just leaving the test as it is for now, I'll see if I can come up with a solution to the long line problem in a later commit. --- .../gdb.tui/tui-disasm-long-lines.exp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp index 0ad91308ca4..acc4c54063f 100644 --- a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp +++ b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp @@ -16,6 +16,8 @@ # Test that the logic for displaying the TUI disassembly window # handles very long lines. +tuiterm_env + standard_testfile set ccopts {debug quiet} @@ -31,13 +33,16 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" \ } } -clean_restart "$binfile" - -if {[skip_tui_tests]} { - # TUI support is disabled. Check for error message. - gdb_test "layout asm" "Undefined command: \"layout\". Try \"help\"." +Term::clean_restart 24 80 $binfile +if {![Term::prepare_for_tui]} { + unsupported "TUI not supported" return } -# Just check the command does not cause gdb to crash. -gdb_test "layout asm" +# Just check the command does not cause gdb to crash. It is worth +# noting that the asm window does infact fail to correctly display the +# disassembler output at this point, but initially we are just +# checking that GDB doesn't crash, fixing the asm display will come +# later. +Term::command_no_prompt_prefix "layout asm" +Term::check_box "asm box" 0 0 80 15