From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 1AE0E3861857 for ; Wed, 8 Jul 2020 08:55:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1AE0E3861857 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-wr1-x436.google.com with SMTP id z13so47992272wrw.5 for ; Wed, 08 Jul 2020 01:55:03 -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=niWREJ+GQjn24AimyC1m7vJQMOz+ojaUMWtuzxsVb0I=; b=Vr5hyUOJ6mUbAbZZMvgQgBCwCr1jcSnvXGQQf263m1+SE4OQ5so3M3YPtn0QoRPATK HKp0pK3H/JJSfVlYTMY7WqY9KxzmYNl0B7l1PbtiAS+sjcGloVa3jjBFGna710bEJdw3 QmtZiRbdNjE7P3F4k4sWoMi7ZR+p446EW/m6Rt7UenrYIvA+4Ptk80FlqwFlwjFOMOtD JBUhDhASsOI/bBuJGwc8dc0zXats3QGTRQZsh4rEeetfc5nysIag9CXeY2NF25UDa7MA fx6DgoAYNwVyGw6kmz91a2O4IfGKdWNNe9SG3bz7KYpLx1AlLtt6QJ6xCcMN0tH/sR3O +JXA== 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=niWREJ+GQjn24AimyC1m7vJQMOz+ojaUMWtuzxsVb0I=; b=fY+qO9ToxfbxNYJyOms0xa8DfcktbkknZVwacqeAzbq3WFWukRQwJkigZFm2+M/brq 9g/KGz5eDut7acFb9ZrzZVwIS1Lo/lIlhyFDOuNJSe16wilox1x3VvPnNEMJvX6amRPO QdhKq7wOYdKkx1xJPbEzQtC6NrZbqwvNHZw+RaXSKE1bH/Qfiz/fVt3QtTvBuZ4FiLMJ s3E3HFE/SMsQFH687Z5TIzgnoGix7q3LBsYEzxNkED9NB7XS/RbIGTI2OhuglK94RQ4s +jknIBO04xjlGnMKd+GQ8PuTUPe+ShW3Ud72FwxJNslntAkBTcszJjtlDDUXsjaKLJoA R7gg== X-Gm-Message-State: AOAM5323RJRdKoZ/H34SLXhaIL3OPPDblKda9PygW5+Ycd6qk9/Wttnr bte6skjBwpKmNi13vhDPDw42HKznZ5Q= X-Google-Smtp-Source: ABdhPJwvkEHl9suYnkN3Mvt79JpgEuf0Vllvyltf0Yty2xswv7ZWfiWTj1U6udU6nCT6ioB6pK4zGQ== X-Received: by 2002:a05:6000:1107:: with SMTP id z7mr56517742wrw.355.1594198501920; Wed, 08 Jul 2020 01:55:01 -0700 (PDT) Received: from localhost (host109-154-20-168.range109-154.btcentralplus.com. [109.154.20.168]) by smtp.gmail.com with ESMTPSA id k185sm4796487wmk.47.2020.07.08.01.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 01:55:01 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 2/2] gdb: Improve formatting of 'show endian' messages Date: Wed, 8 Jul 2020 09:54:55 +0100 Message-Id: <556fa65f8daa47ce8776fb12f0be0c06099f1a5c.1594198122.git.andrew.burgess@embecosm.com> 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.0 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: Wed, 08 Jul 2020 08:55:04 -0000 This commit changes the output of 'show endian'. Here is a session before this commit: (gdb) show endian The target endianness is set automatically (currently little endian) (gdb) set endian big The target is assumed to be big endian (gdb) show endian The target is assumed to be big endian (gdb) After this commit the session now looks like this: (gdb) show endian The target endianness is set automatically (currently little endian). (gdb) set endian big The target is set to big endian. (gdb) show endian The target is set to big endian. (gdb) The changes are: 1. Each line ends with '.', and 2. After setting the endianness GDB is now a little more assertive; 'target is set to' not 'target is assumed to be', the user did just tell us after all! --- gdb/arch-utils.c | 8 ++--- .../gdb.base/all-architectures.exp.tcl | 4 +-- gdb/testsuite/gdb.base/endian.exp | 34 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index a19fc026623..4ed26cf49b5 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -317,17 +317,17 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c, if (target_byte_order_user == BFD_ENDIAN_UNKNOWN) if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG) fprintf_unfiltered (file, _("The target endianness is set automatically " - "(currently big endian)\n")); + "(currently big endian).\n")); else fprintf_unfiltered (file, _("The target endianness is set automatically " - "(currently little endian)\n")); + "(currently little endian).\n")); else if (target_byte_order_user == BFD_ENDIAN_BIG) fprintf_unfiltered (file, - _("The target is assumed to be big endian\n")); + _("The target is set to big endian.\n")); else fprintf_unfiltered (file, - _("The target is assumed to be little endian\n")); + _("The target is set to little endian.\n")); } static void diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.tcl b/gdb/testsuite/gdb.base/all-architectures.exp.tcl index 4c59728b8c0..34afa434b1c 100644 --- a/gdb/testsuite/gdb.base/all-architectures.exp.tcl +++ b/gdb/testsuite/gdb.base/all-architectures.exp.tcl @@ -225,7 +225,7 @@ with_test_prefix "tests" { continue } elseif {$endian == "auto"} { gdb_test_multiple "set endian $endian" $test { - -re "^set endian $endian\r\n(${osabi_warning})?The target endianness is set automatically \\(currently .* endian\\)\r\n$gdb_prompt $" { + -re "^set endian $endian\r\n(${osabi_warning})?The target endianness is set automatically \\(currently .* endian\\)\\.\r\n$gdb_prompt $" { internal_pass $test } } @@ -235,7 +235,7 @@ with_test_prefix "tests" { internal_pass $test continue } - -re "^set endian $endian\r\n(${osabi_warning})?The target is assumed to be $endian endian\r\n$gdb_prompt $" { + -re "^set endian $endian\r\n(${osabi_warning})?The target is set to $endian endian\\.\r\n$gdb_prompt $" { internal_pass $test } } diff --git a/gdb/testsuite/gdb.base/endian.exp b/gdb/testsuite/gdb.base/endian.exp index 611b0ff5fbc..3058e6294aa 100644 --- a/gdb/testsuite/gdb.base/endian.exp +++ b/gdb/testsuite/gdb.base/endian.exp @@ -18,26 +18,26 @@ standard_testfile set en_auto "The target endianness is set automatically" -set en_set "The target is assumed to be" +set en_set "The target is set to" clean_restart # First check that the automatic endianness is updated # with the `set endian' command. gdb_test "set endian auto" \ - "$en_auto \\\(currently \(\?:big\|little\) endian\\\)" \ + "$en_auto \\\(currently \(\?:big\|little\) endian\\\)\\." \ "default target endianness" -gdb_test "set endian big" "$en_set big endian" \ +gdb_test "set endian big" "$en_set big endian\\." \ "set target endianness" -gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)" \ +gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)\\." \ "auto target endianness" -gdb_test "set endian little" "$en_set little endian" \ +gdb_test "set endian little" "$en_set little endian\\." \ "set target endianness little" -gdb_test "set endian auto" "$en_auto \\\(currently little endian\\\)" \ +gdb_test "set endian auto" "$en_auto \\\(currently little endian\\\)\\." \ "auto target endianness little" -gdb_test "set endian big" "$en_set big endian" \ +gdb_test "set endian big" "$en_set big endian\\." \ "set target endianness big" -gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)" \ +gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)\\." \ "auto target endianness big" if { [build_executable ${testfile}.exp $testfile] } { @@ -49,7 +49,7 @@ if { [gdb_file_cmd $binfile] } { } set test "get target endianness" if { [gdb_test_multiple "show endian" "$test" { - -re "$en_auto \\\(currently \(big\|little\) endian\\\).*$gdb_prompt" { + -re "$en_auto \\\(currently \(big\|little\) endian\\\)\\..*$gdb_prompt" { set endian $expect_out(1,string) pass "$test" } @@ -64,31 +64,31 @@ if { [gdb_test_multiple "show endian" "$test" { if { [gdb_unload] } { gdb_suppress_entire_file "$pf_prefix cannot unselect executable" } -gdb_test "set endian big" "$en_set big endian" \ +gdb_test "set endian big" "$en_set big endian\\." \ "override target endianness big" -gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)" \ +gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)\\." \ "override auto target endianness big" if { [gdb_file_cmd $binfile] } { gdb_suppress_entire_file "$pf_prefix cannot select executable" } -gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)" \ +gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \ "previously big default executable endianness" if { [gdb_unload] } { gdb_suppress_entire_file "$pf_prefix cannot unselect executable" } -gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)" \ +gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \ "previously big default no executable endianness" -gdb_test "set endian little" "$en_set little endian" \ +gdb_test "set endian little" "$en_set little endian\\." \ "override target endianness little" -gdb_test "set endian auto" "$en_auto \\\(currently little endian\\\)" \ +gdb_test "set endian auto" "$en_auto \\\(currently little endian\\\)\\." \ "override auto target endianness little" if { [gdb_file_cmd $binfile] } { gdb_suppress_entire_file "$pf_prefix cannot select executable" } -gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)" \ +gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \ "previously little default executable endianness" if { [gdb_unload] } { gdb_suppress_entire_file "$pf_prefix cannot unselect executable" } -gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)" \ +gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \ "previously little default no executable endianness" -- 2.25.4