[binutils-gdb] [gdb/testsuite, tclint] Fix lib/pascal.exp

Tom de Vries vries@sourceware.org
Sun Oct 5 20:52:18 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=de1b25b93c592c6cd9227484d1aded3adea882b2

commit de1b25b93c592c6cd9227484d1aded3adea882b2
Author: Tom de Vries <tdevries@suse.de>
Date:   Sun Oct 5 22:50:10 2025 +0200

    [gdb/testsuite, tclint] Fix lib/pascal.exp

Diff:
---
 gdb/tclint.toml              |  1 -
 gdb/testsuite/lib/pascal.exp | 35 ++++++++++++++++++-----------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/gdb/tclint.toml b/gdb/tclint.toml
index 2357c037efa..5eeb5ed3871 100644
--- a/gdb/tclint.toml
+++ b/gdb/tclint.toml
@@ -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.
diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
index d76cdcaf418..12f8a2f0f27 100644
--- a/gdb/testsuite/lib/pascal.exp
+++ b/gdb/testsuite/lib/pascal.exp
@@ -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


More information about the Gdb-cvs mailing list