From: Tom Tromey Date: Sat, 27 Feb 2021 00:25:38 +0000 (-0700) Subject: Minor fix in skip_ctf_tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=573dc0cc43f2c3ce4d28ec1aa1bf05fc43810cda;p=binutils-gdb.git Minor fix in skip_ctf_tests I noticed an oddity in skip_ctf_tests -- for me it ends up caching the string "!0", because it ends with 'return ![...]'. In Tcl, this is just string concatenation. The result works because the users of this function have unbraced if conditions, like: if [skip_ctf_tests] { ... which works because "if" re-parses the returned string as an expression, and evaluates that. There's only a latent bug here, but this is also un-idiomatic, so I am checking in this patch to fix it. This way, if someone in the future uses a braced condition (which is what I normally recommend), it will continue to work. gdb/testsuite/ChangeLog 2021-02-26 Tom Tromey * lib/gdb.exp (skip_ctf_tests): Use expr on result. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d29f6d4d448..625c4ecf493 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2021-02-26 Tom Tromey + + * lib/gdb.exp (skip_ctf_tests): Use expr on result. + 2021-02-26 Jan Vrany * gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 142051296cb..7480bd5665f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -7433,11 +7433,13 @@ gdb_caching_proc skip_ctf_tests { return 1 } - return ![gdb_can_simple_compile ctfdebug { + set can_ctf [gdb_can_simple_compile ctfdebug { int main () { return 0; } } executable "additional_flags=-gt"] + + return [expr {!$can_ctf}] } # Return 1 if compiler supports -gstatement-frontiers. Otherwise,