]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix lib/pascal.exp
authorTom de Vries <tdevries@suse.de>
Sun, 5 Oct 2025 20:50:10 +0000 (22:50 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 5 Oct 2025 20:50:10 +0000 (22:50 +0200)
gdb/tclint.toml
gdb/testsuite/lib/pascal.exp

index 2357c037efa39a78ffb6fefa9f33a3f71c1e7423..5eeb5ed3871253a18ef5d1bee2606814e7ab7229 100644 (file)
@@ -39,7 +39,6 @@ exclude = [
 "gdb/testsuite/lib/gdb.exp",
 "gdb/testsuite/lib/gen-perf-test.exp",
 "gdb/testsuite/lib/mi-support.exp",
-"gdb/testsuite/lib/pascal.exp",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 "gdb/testsuite/lib/ton.tcl", # Imported.
index d76cdcaf41812d7c8f849e7971cad967f87a21df..12f8a2f0f27a67ef55a694474cc985161da94e4a 100644 (file)
@@ -26,11 +26,11 @@ set pascal_init_done 0
 # Second, environment variable FPC is checked
 # if present, Free Pascal compiler is assumed to be the value of
 # that environment variable.
-# Third, gpc executable is searched using `which gpc`  
-# Lastly, fpc executable is searched using `which fpc` 
+# Third, gpc executable is searched using `which gpc`
+# Lastly, fpc executable is searched using `which fpc`
 # Using environment variable allows to force
 # which compiler is used in testsuite
+
 proc pascal_init {} {
     global pascal_init_done
     gdb_persistent_global pascal_compiler_is_gpc
@@ -38,7 +38,7 @@ proc pascal_init {} {
     gdb_persistent_global gpc_compiler
     gdb_persistent_global fpc_compiler
     global env
+
     if { $pascal_init_done == 1 } {
        return
     }
@@ -48,7 +48,7 @@ proc pascal_init {} {
     set gpc_compiler [transform gpc]
     set fpc_compiler [transform fpc]
 
-    if ![is_remote host] {
+    if {![is_remote host]} {
        if { [info exists env(GPC)] } {
            set pascal_compiler_is_gpc 1
            set gpc_compiler $env(GPC)
@@ -66,7 +66,7 @@ proc pascal_init {} {
        }
     }
     set pascal_init_done 1
-}   
+}
 
 proc gpc_compile {source destfile type options} {
     global gpc_compiler
@@ -80,21 +80,21 @@ proc gpc_compile {source destfile type options} {
     if { $type == "preprocess" } {
        append add_flags " -E"
     }
-    
+
     if { $type == "assembly" } {
        append add_flags " -S"
     }
 
     foreach i $options {
        if { $i == "debug" } {
-           if [board_info $dest exists debug_flags] {
+           if {[board_info $dest exists debug_flags]} {
                append add_flags " [board_info $dest debug_flags]"
            } else {
                append add_flags " -g"
            }
        }
        if { $i == "class" } {
-           if [board_info $dest exists pascal_class_flags] {
+           if {[board_info $dest exists pascal_class_flags]} {
                append add_flags " [board_info $dest pascal_class_flags]"
            } else {
                append add_flags " --extended-syntax"
@@ -118,21 +118,21 @@ proc fpc_compile {source destfile type options} {
     if { $type == "preprocess" } {
        return "Free Pascal can not preprocess"
     }
-    
+
     if { $type == "assembly" } {
        append add_flags " -al"
     }
 
     foreach i $options {
        if { $i == "debug" } {
-           if [board_info $dest exists debug_flags] {
+           if {[board_info $dest exists debug_flags]} {
                append add_flags " [board_info $dest debug_flags]"
            } else {
                append add_flags " -g"
            }
        }
        if { $i == "class" } {
-           if [board_info $dest exists pascal_class_flags] {
+           if {[board_info $dest exists pascal_class_flags]} {
                append add_flags " [board_info $dest pascal_class_flags]"
            } else {
                append add_flags " -Mobjfpc"
@@ -149,7 +149,7 @@ proc gdb_compile_pascal {source destfile type options} {
     global pascal_compiler_is_gpc
     global pascal_compiler_is_fpc
 
-    if { $pascal_init_done == 0 } { 
+    if { $pascal_init_done == 0 } {
        pascal_init
     }
 
@@ -164,7 +164,7 @@ proc gdb_compile_pascal {source destfile type options} {
        return "No pascal compiler. Compilation failed."
     }
 
-    if ![file exists $destfile] {
+    if {![file exists $destfile]} {
         unsupported "Pascal compilation failed: $result"
         return "Pascal compilation failed."
     }
@@ -174,11 +174,12 @@ proc gdb_compile_pascal {source destfile type options} {
 # The result is 1 (true) for success, 0 (false) for failure.
 
 proc set_lang_pascal {} {
-    if [gdb_test_no_output "set language pascal"] {
+    if {[gdb_test_no_output "set language pascal"]} {
        return 0
     }
-    if [gdb_test "show language" ".* source language is \"pascal\"." \
-          "set language to \"pascal\""] {
+    if {[gdb_test "show language" \
+            [string_to_regexp {The current source language is "pascal".}] \
+            {set language to "pascal"}]} {
        return 0
     }
     return 1