Add tests for new alias default-args related commands and arguments.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / style.exp
index c450f16b609a79ffed3abd7f0a6298feb91b1b84..bfd26144fa4e66d53b3dde96efcdd5aa32e6525e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2018-2019 Free Software Foundation, Inc.
+# Copyright 2018-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,11 +34,18 @@ save_vars { env(TERM) } {
        return -1
     }
 
+    set readnow [readnow]
+
     if {![runto_main]} {
        fail "style tests failed"
        return
     }
 
+    # Check that the source highlighter has not stripped away the leading
+    # newlines.
+    set main_line [gdb_get_line_number "break here"]
+    gdb_test "list $main_line,$main_line" "return.*some_called_function.*"
+
     gdb_test_no_output "set style enabled on"
 
     set main_expr [style main function]
@@ -79,14 +86,22 @@ save_vars { env(TERM) } {
     }
 
     if {$test_macros} {
+       set macro_line [gdb_get_line_number "\#define SOME_MACRO"]
        gdb_test "info macro SOME_MACRO" \
-           "Defined at $base_file_expr:16\r\n#define SOME_MACRO 23"
+           "Defined at $base_file_expr:$macro_line\r\n#define SOME_MACRO 23"
     }
 
     set func [style some_called_function function]
     # Somewhere should see the call to the function.
     gdb_test "disassemble main" "[style $hex address].*$func.*"
 
+    set ifield [style int_field variable]
+    set sfield [style string_field variable]
+    set efield [style e_field variable]
+    set evalue [style VALUE_TWO variable]
+    gdb_test "print struct_value" \
+       "\{$ifield = 23,.*$sfield = .*,.*$efield = $evalue.*"
+
     gdb_exit
     gdb_spawn
 
@@ -105,7 +120,7 @@ save_vars { env(TERM) } {
        [multi_line \
             "List of classes of commands:" \
             "" \
-            "${aliases_expr} -- Aliases of other commands\." \
+            "${aliases_expr} -- User-defined aliases of other commands\." \
             "${breakpoints_expr} -- Making program stop at certain points\." \
             ".*" \
            ] \
@@ -117,18 +132,27 @@ save_vars { env(TERM) } {
     gdb_test "apropos -v cut for 'thre" \
        [multi_line \
             "" \
-            "${taas_expr} --.*" \
+            "${taas_expr}" \
+            "Apply a command to all .*" \
             "Usage:.*" \
             "short${cut_for_thre_expr}ad apply.*" \
             "" \
-            "${tfaas_expr} --.*" \
+            "${tfaas_expr}" \
+            "Apply a command to all .*" \
             "Usage:.*" \
             "short${cut_for_thre_expr}ad apply.*" \
            ]
 
     set quoted [string_to_regexp $binfile]
+    set pass_re "Reading symbols from [style $quoted file]\.\.\."
+    if { $readnow } {
+       set pass_re \
+           [multi_line \
+                $pass_re \
+                "Expanding full symbols from [style $quoted file]\.\.\."]
+    }
     gdb_test "file $binfile" \
-       "Reading symbols from [style $quoted file]..." \
+       $pass_re \
        "filename is styled when loading symbol file"
 
     gdb_test "pwd" "Working directory [style .*? file].*"
@@ -139,4 +163,10 @@ save_vars { env(TERM) } {
 
     gdb_test "show logging file" \
        "The current logfile is \"[style .*? file]\"\\..*"
+
+    # Check warnings are styled by setting a rubbish data directory.
+    gdb_test "set data-directory Makefile" \
+       "warning: [style .*? file] is not a directory\\..*"
+    gdb_test "show data-directory" \
+       "GDB's data directory is \"[style .*? file]\"\\..*"
 }
This page took 0.025905 seconds and 4 git commands to generate.