]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Improve formatting of 'show architecture' messages
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 25 Jun 2020 16:59:34 +0000 (17:59 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 14 Jul 2020 12:21:42 +0000 (13:21 +0100)
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.

12 files changed:
gdb/ChangeLog
gdb/arch-utils.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-osabi.exp
gdb/testsuite/gdb.arch/arm-disassembler-options.exp
gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp
gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp
gdb/testsuite/gdb.arch/s390-disassembler-options.exp
gdb/testsuite/gdb.base/all-architectures.exp.tcl
gdb/testsuite/gdb.base/attach-pie-noexec.exp
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/testsuite/gdb.xml/tdesc-arch.exp

index 57b37b8872b95956e86786ef0172996b14a3014b..675aee6a539689d9abd27fa4d93ebe7f90281f06 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-14  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * arch-utils.c (show_architecture): Update formatting of messages.
+
 2020-07-12  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (struct type) <bounds>: Handle array and string
index 04955ea847b2eb93602b2bf82d2741284cd0912e..f89260a32b77f17ac9fbe2998d690bbb588f2107 100644 (file)
@@ -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);
 }
 
index 7690acf03385b885d54670b65d89e5f8d22d3a97..61260483ba4af2e3e9890fa05125367fca85fdc9 100644 (file)
@@ -1,3 +1,15 @@
+2020-07-14  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * 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.
+
 2020-07-14  Tom de Vries  <tdevries@suse.de>
 
        * gdb.threads/clone-new-thread-event.c (gettid): Rename to ...
index aebaaffeeae12432ff96fd102b9bf4fb23f20343..7702af99bc8e9419b975cbd7e062ffd53f1492f3 100644 (file)
@@ -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"
index b347cc5270dd48cf7df0866b373f1c734e8d4242..ac1d8a8bdaa3836fd9640bc6dd321b6b236ef7d5 100644 (file)
@@ -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" \
index 5d77fd7048c2534058f54a4e3c3dc7b3dcb62bae..68d9bf61e17c82fbcec70cdd01bb932469fd8148 100644 (file)
@@ -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" \
index 207c50893acc2a5423889942052d0e72b94d97ab..fa5bff9cebf5bcbdf9d19f133c39c567e7303662 100644 (file)
@@ -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"
     }
 }
index 72fb00bb07cf7e7fdddcdbedeb71a61a93ace950..a9ae230aa05a0589ea4b6b4ed9382069213ae4cc 100644 (file)
@@ -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" \
index ebdd3444540220ab7db254b2e96a7933aa333870..4c59728b8c09483ff9abfed44c65591301714803 100644 (file)
@@ -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 $" {
index 08573a1c21f0dd377b5623a185d93e35eca87258..43d9e3c5fa74e46b0f549e0623e3b4a7aef7e55c 100644 (file)
@@ -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
index d5f5862c5c16dd3575d133791e20550f2781ae0e..eb4fdb5e7c1c3a900711d65fe0ae5b04fbd18695 100644 (file)
@@ -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}\\\]\\)" \
index 386435dd171eddd9e19a73e61819093f19f3d2d3..3da40810984cb95e927d1aa949da591992761879 100644 (file)
@@ -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