From: Tom Tromey Date: Sat, 15 Nov 2025 17:44:45 +0000 (-0700) Subject: Reformat gdb.objc tests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0221c9eea71291e6bbfdd5187cde0b5dadb5dd02;p=thirdparty%2Fbinutils-gdb.git Reformat gdb.objc tests This patch applies some minor formatting changes and cleanups to the gdb.objc tests. --- diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp index b5fb4d70302..d1fb64a42de 100644 --- a/gdb/testsuite/gdb.objc/basicclass.exp +++ b/gdb/testsuite/gdb.objc/basicclass.exp @@ -21,8 +21,9 @@ standard_testfile .m # Objective-C program compilation isn't standard. We need to figure out # which libraries to link in. Most of the time it uses pthread # -if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } { - return -1 +if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ + executable {debug}] != ""} { + return } # @@ -147,7 +148,7 @@ gdb_test "break hiddenMethod" \ # gdb_test continue \ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass\\(Private\\) hiddenMethod. \\(self=.*, _cmd=.*\\) at .*$srcfile:61.*" \ - "continue until category method" + "continue until category method" # # Test calling Objective-C methods diff --git a/gdb/testsuite/gdb.objc/nondebug.exp b/gdb/testsuite/gdb.objc/nondebug.exp index 2cd25b19315..321aa229045 100644 --- a/gdb/testsuite/gdb.objc/nondebug.exp +++ b/gdb/testsuite/gdb.objc/nondebug.exp @@ -23,8 +23,9 @@ standard_testfile .m # Objective-C program compilation isn't standard. We need to figure out # which libraries to link in. Most of the time it uses pthread # -if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list ] ] != "" } { - return -1 +if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ + executable {}] != ""} { + return } proc do_objc_tests {} { @@ -42,8 +43,7 @@ gdb_test "set breakpoint pending off" "" "set breakpoint pending" # Break on multiply defined non-debuggable symbol (PR objc/1236) # set name "break on non-debuggable method" -gdb_test_multiple "break someMethod" $name \ -{ +gdb_test_multiple "break someMethod" $name { -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\]\[ \]+-.NonDebug someMethod.*\\\[3\\\]\[ \]+-.NonDebug2 someMethod.*" { send_gdb "2\n" exp_continue diff --git a/gdb/testsuite/gdb.objc/objcdecode.exp b/gdb/testsuite/gdb.objc/objcdecode.exp index 5414f0f96f3..7840a2ed5d3 100644 --- a/gdb/testsuite/gdb.objc/objcdecode.exp +++ b/gdb/testsuite/gdb.objc/objcdecode.exp @@ -23,8 +23,9 @@ standard_testfile .m # Objective-C program compilation isn't standard. We need to figure out # which libraries to link in. Most of the time it uses pthread # -if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } { - return -1 +if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ + {debug}] != ""} { + return } proc do_objc_tests {} { @@ -40,8 +41,7 @@ gdb_test_no_output "set multiple-symbols ask" # Break on multiply defined method (PR objc/1236) # set name "break on multiply defined method" -gdb_test_multiple "break multipleDef" $name \ -{ +gdb_test_multiple "break multipleDef" $name { -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] .*${srcfile}:-.Decode multipleDef.\r\n\\\[3\\\] .*${srcfile}:multipleDef\r\n> $" { send_gdb "3\n" exp_continue @@ -52,8 +52,7 @@ gdb_test_multiple "break multipleDef" $name \ set name "continue after break on multiply defined symbol" gdb_run_cmd -gdb_test_multiple "" $name \ -{ +gdb_test_multiple "" $name { -re "Breakpoint \[0-9\]+, multipleDef \\\(\\\) at .*\r\n$gdb_prompt $" { pass $name }