From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by sourceware.org (Postfix) with ESMTPS id 39E273861841 for ; Tue, 14 Jul 2020 12:27:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 39E273861841 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x342.google.com with SMTP id o8so5292544wmh.4 for ; Tue, 14 Jul 2020 05:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lUOycJe9KSMrfogrJY5zjOoaB4hQpHFs4wG64/8qxJ8=; b=asWa5tqYHDtr9iWQnx0XrwzCzDCH/tj4s6bTNIeCcMkwwq5ict1MBSrjkgOmuFwTca 2viOV1rZrj92LZ+EVvbuFlQ/31vwwpynmBl19c8roKGKPzv2qfdDa1x6NR7E/6zbk1gJ xeyIi0twWxuzw8g756RpzqcviziwHGx/IQqROGgY77NaxlaIg5RCjKPBY8fY4O66LIbC cuT5UJGSwcyI0r2OtzPLCNkV5F91jOO+rxFgn6alMHHdUnhscS5S683ly/tvS21ndXaf a3KPCUyb3fegWYWGRTCqhTNFyXbf8P6GmxU8ON6+ZsbE33P4WBXy+4zMHD+L/bxIM5KI +sOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lUOycJe9KSMrfogrJY5zjOoaB4hQpHFs4wG64/8qxJ8=; b=og4i1iTw2Nanrdc+kfIBXk4kvXnspTNAN/5UaPRVpmUo53ShuhYk7GVz86oY8nIg3F ByFi42dl3qa3KAPN5Be/5vYRdnVfnx15QGdZpgdovFa4wn/G3PL2G1R0/Ti2B5RGqxzw 8J/sUILjhrO7FbYFRx2UZXEENk1Fhd2tRR6dWHZSHk81daD2rsXAOdytcT83OOFeECdV TDqLjqM5qCxUh+sqyK26/Bw3do5f6W7XI2qG864w1ttS/lcd5TUdzRGUz4iO4M4DMLyO uPtEs7XE14Bfgbae23acDZYSktqe/h1U6AhyVa11249rBwWfzj6zQNsHIZ0MCvB8bv84 vj/g== X-Gm-Message-State: AOAM531MNmetfmk/CwK5EQcLXU/5dAFl+nnLPE0GkmZya86/ZcApWUFH +226235YVHbPe1O6nnFHx7FNus3Vl0M= X-Google-Smtp-Source: ABdhPJw/vQxlA+ctUEPzdVfDH6gWe8Na0TKpPm1Qnp8zY1cwMFIwbrdd5vS/tEV+adu4JiemCbdVMQ== X-Received: by 2002:a05:600c:2154:: with SMTP id v20mr4446338wml.185.1594729632764; Tue, 14 Jul 2020 05:27:12 -0700 (PDT) Received: from localhost (host86-128-12-23.range86-128.btcentralplus.com. [86.128.12.23]) by smtp.gmail.com with ESMTPSA id t141sm4532441wmt.26.2020.07.14.05.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 05:27:12 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PUSHED 1/2] gdb: Improve formatting of 'show architecture' messages Date: Tue, 14 Jul 2020 13:27:07 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 14 Jul 2020 12:27:16 -0000 This commit changes the output of 'show architecture'. Here is a session before this commit: (gdb) show architecture The target architecture is set automatically (currently i386) (gdb) set architecture mips The target architecture is assumed to be mips (gdb) show architecture The target architecture is assumed to be mips (gdb) After this commit the session now looks like this: (gdb) show architecture The target architecture is set to "auto" (currently "i386"). (gdb) set architecture mips The target architecture is set to "mips". (gdb) show architecture The target architecture is set to "mips". (gdb) The changes are: 1. The value is now enclosed in quotes, 2. Each line ends with '.', and 3. After setting the architecture GDB is now a little more assertive; 'architecture is set to' not 'is assumed to be', the user did just tell us after all! gdb/ChangeLog: * arch-utils.c (show_architecture): Update formatting of messages. gdb/testsuite/ChangeLog: * gdb.arch/amd64-osabi.exp: Update. * gdb.arch/arm-disassembler-options.exp: Update. * gdb.arch/powerpc-disassembler-options.exp: Update. * gdb.arch/ppc64-symtab-cordic.exp: Update. * gdb.arch/s390-disassembler-options.exp: Update. * gdb.base/all-architectures.exp.tcl: Update. * gdb.base/attach-pie-noexec.exp: Update. * gdb.base/catch-syscall.exp: Update. * gdb.xml/tdesc-arch.exp: Update. --- gdb/ChangeLog | 4 ++++ gdb/arch-utils.c | 6 +++--- gdb/testsuite/ChangeLog | 12 ++++++++++++ gdb/testsuite/gdb.arch/amd64-osabi.exp | 2 +- gdb/testsuite/gdb.arch/arm-disassembler-options.exp | 4 ++-- .../gdb.arch/powerpc-disassembler-options.exp | 4 ++-- gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp | 4 ++-- gdb/testsuite/gdb.arch/s390-disassembler-options.exp | 4 ++-- gdb/testsuite/gdb.base/all-architectures.exp.tcl | 2 +- gdb/testsuite/gdb.base/attach-pie-noexec.exp | 4 ++-- gdb/testsuite/gdb.base/catch-syscall.exp | 4 ++-- gdb/testsuite/gdb.xml/tdesc-arch.exp | 6 +++--- 12 files changed, 36 insertions(+), 20 deletions(-) diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 04955ea847b..f89260a32b7 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -476,11 +476,11 @@ show_architecture (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { if (target_architecture_user == NULL) - fprintf_filtered (file, _("The target architecture is set " - "automatically (currently %s)\n"), + fprintf_filtered (file, _("The target architecture is set to " + "\"auto\" (currently \"%s\").\n"), gdbarch_bfd_arch_info (get_current_arch ())->printable_name); else - fprintf_filtered (file, _("The target architecture is assumed to be %s\n"), + fprintf_filtered (file, _("The target architecture is set to \"%s\".\n"), set_architecture_string); } diff --git a/gdb/testsuite/gdb.arch/amd64-osabi.exp b/gdb/testsuite/gdb.arch/amd64-osabi.exp index aebaaffeeae..7702af99bc8 100644 --- a/gdb/testsuite/gdb.arch/amd64-osabi.exp +++ b/gdb/testsuite/gdb.arch/amd64-osabi.exp @@ -24,7 +24,7 @@ if { ![istarget x86_64-*-* ] } { proc test_osabi_none { arch void_ptr_size long_double_size } { clean_restart - gdb_test "set architecture i386:x86-64" "The target architecture is assumed to be i386:x86-64" + gdb_test "set architecture i386:x86-64" "The target architecture is set to \"i386:x86-64\"\\." gdb_test_no_output "set osabi none" "set osabi none" gdb_test "print sizeof (void*)" " = 8" gdb_test "print sizeof (long double)" " = 16" diff --git a/gdb/testsuite/gdb.arch/arm-disassembler-options.exp b/gdb/testsuite/gdb.arch/arm-disassembler-options.exp index b347cc5270d..ac1d8a8bdaa 100644 --- a/gdb/testsuite/gdb.arch/arm-disassembler-options.exp +++ b/gdb/testsuite/gdb.arch/arm-disassembler-options.exp @@ -31,7 +31,7 @@ set arch1 "armv2" set arch2 "armv5" gdb_test "set architecture $arch1" \ - "The target architecture is assumed to be $arch1" \ + "The target architecture is set to \"$arch1\"" \ "set architecture $arch1" gdb_test_no_output "set disassembler-options" @@ -47,7 +47,7 @@ gdb_test "show disassembler-options" \ # Change architectures and verify the disassembler options have been preserved. gdb_test "set architecture $arch2" \ - "The target architecture is assumed to be $arch2" \ + "The target architecture is set to \"$arch2\"" \ "set architecture $arch2" gdb_test "show disassembler-options" \ diff --git a/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp b/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp index 5d77fd7048c..68d9bf61e17 100644 --- a/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp +++ b/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp @@ -31,7 +31,7 @@ set arch1 "rs6000:6000" set arch2 "powerpc:common64" gdb_test "set architecture $arch1" \ - "The target architecture is assumed to be $arch1" \ + "The target architecture is set to \"$arch1\"" \ "set architecture $arch1" gdb_test_no_output "set disassembler-options" @@ -47,7 +47,7 @@ gdb_test "show disassembler-options" \ # Change architectures and verify the disassembler options have been preserved. gdb_test "set architecture $arch2" \ - "The target architecture is assumed to be $arch2" \ + "The target architecture is set to \"$arch2\"" \ "set architecture $arch2" gdb_test "show disassembler-options" \ diff --git a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp index 207c50893ac..fa5bff9cebf 100644 --- a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp +++ b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp @@ -47,10 +47,10 @@ gdb_load ${kofile} set test "show architecture" gdb_test_multiple $test $test { - -re "\r\nThe target architecture is set automatically \\(currently powerpc:common64\\)\r\n$gdb_prompt $" { + -re "\r\nThe target architecture is set to \"auto\" \\(currently \"powerpc:common64\"\\)\r\n$gdb_prompt $" { pass $test } - -re "\r\nThe target architecture is set automatically \\(currently .*\\)\r\n$gdb_prompt $" { + -re "\r\nThe target architecture is set to \"auto\" \\(currently \".*\"\\)\r\n$gdb_prompt $" { untested "powerpc:common64 is not supported" } } diff --git a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp index 72fb00bb07c..a9ae230aa05 100644 --- a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp +++ b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp @@ -31,7 +31,7 @@ set arch1 "s390:64-bit" set arch2 "s390:31-bit" gdb_test "set architecture $arch1" \ - "The target architecture is assumed to be $arch1" \ + "The target architecture is set to \"$arch1\"" \ "set architecture $arch1" gdb_test_no_output "set disassembler-options" @@ -47,7 +47,7 @@ gdb_test "show disassembler-options" \ # Change architectures and verify the disassembler options have been preserved. gdb_test "set architecture $arch2" \ - "The target architecture is assumed to be $arch2" \ + "The target architecture is set to \"$arch2\"" \ "set architecture $arch2" gdb_test "show disassembler-options" \ diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.tcl b/gdb/testsuite/gdb.base/all-architectures.exp.tcl index ebdd3444540..4c59728b8c0 100644 --- a/gdb/testsuite/gdb.base/all-architectures.exp.tcl +++ b/gdb/testsuite/gdb.base/all-architectures.exp.tcl @@ -246,7 +246,7 @@ with_test_prefix "tests" { set arch_re [string_to_regexp $arch] set test "set architecture $arch" gdb_test_multiple $test $test { - -re "^set architecture $arch_re\r\n(${osabi_warning})?The target architecture is assumed to be $arch_re\r\n$gdb_prompt $" { + -re "^set architecture $arch_re\r\n(${osabi_warning})?The target architecture is set to \"$arch_re\"\\.\r\n$gdb_prompt $" { internal_pass $test } -re "Architecture .* not recognized.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp index 08573a1c21f..43d9e3c5fa7 100644 --- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp +++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp @@ -28,7 +28,7 @@ clean_restart $executable set arch "" set test "show architecture" gdb_test_multiple $test $test { - -re "The target architecture is set automatically \\(currently (.*)\\)\r\n$gdb_prompt $" { + -re "The target architecture is set to \"auto\" \\(currently \"(.*)\"\\)\\.\r\n$gdb_prompt $" { set arch $expect_out(1,string) pass $test } @@ -61,7 +61,7 @@ set testpid [spawn_id_get_pid $test_spawn_id] gdb_start file delete -- $binfile gdb_test "attach $testpid" "Attaching to process $testpid\r\n.*" "attach" -gdb_test "set architecture $arch" "The target architecture is assumed to be $arch" +gdb_test "set architecture $arch" "The target architecture is set to \"$arch\"\\." gdb_test "info shared" "From\[ \t\]+To\[ \t\]+Syms Read\[ \t\]+Shared Object Library\r\n0x.*" kill_wait_spawned_process $test_spawn_id diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index d5f5862c5c1..eb4fdb5e7c1 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -593,14 +593,14 @@ proc test_catch_syscall_multi_arch {} { gdb_start gdb_test "set architecture $arch1" \ - "The target architecture is assumed to be $arch1" + "The target architecture is set to \"$arch1\"\\." gdb_test "catch syscall $syscall_number" \ "Catchpoint $decimal \\(syscall .${syscall1_name}. \\\[${syscall_number}\\\]\\)" \ "insert catch syscall on syscall $syscall_number -- $syscall1_name on $arch1" gdb_test "set architecture $arch2" \ - "The target architecture is assumed to be $arch2" + "The target architecture is set to \"$arch2\"\\." gdb_test "catch syscall $syscall_number" \ "Catchpoint $decimal \\(syscall .${syscall2_name}. \\\[${syscall_number}\\\]\\)" \ diff --git a/gdb/testsuite/gdb.xml/tdesc-arch.exp b/gdb/testsuite/gdb.xml/tdesc-arch.exp index 386435dd171..3da40810984 100644 --- a/gdb/testsuite/gdb.xml/tdesc-arch.exp +++ b/gdb/testsuite/gdb.xml/tdesc-arch.exp @@ -41,7 +41,7 @@ gdb_test_multiple "set architecture" $msg { set default_arch "" set msg "read default architecture" gdb_test_multiple "show architecture" $msg { - -re "The target architecture is set automatically \\(currently (\[^ \]*)\\)\r\n$gdb_prompt $" { + -re "The target architecture is set to \"auto\" \\(currently \"(\[^ \]*)\"\\)\\.\r\n$gdb_prompt $" { set default_arch $expect_out(1,string) pass $msg } @@ -89,7 +89,7 @@ proc set_arch { arch which trans_mode } { set cmd "show architecture" gdb_test $cmd \ - "The target architecture is set automatically \\(currently $arch\\)" \ + "The target architecture is set to \"auto\" \\(currently \"$arch\"\\)\\." \ "$cmd ($which architecture)" remote_file host delete $filename @@ -122,7 +122,7 @@ gdb_test $cmd \ set cmd "show architecture" gdb_test $cmd \ - "The target architecture is set automatically \\(currently $default_arch\\)" \ + "The target architecture is set to \"auto\" \\(currently \"$default_arch\"\\)\\." \ "$cmd (invalid architecture)" remote_file host delete $filename -- 2.25.4