The libstdc++ prettyprinter tests require a certain level of support
from GDB, and the check for that GDB support runs a command that
includes a quoted string.  This causes an error from the testsuite
infrastructure for embedded processors whose board support passes
commands through additional levels of procedures that lose the
backslashes that escape the quotes.  Adding more backslashes wouldn't
work because it would prevent the command from working for the majority
of boards.  I can't figure out a real solution to the problem.

Rather than gdb_version_check resulting in an error for boards that
pass a command through additional levels of procedure calls, this
patch lets it catch the error so that it can fail gracefully and the
tests will be reported as UNSUPPORTED.  This will skip the tests for
a relatively small number of test setups.

OK for trunk?

Janis
2013-01-03  Janis Johnson  <jani...@codesourcery.com>

        * testsuite/lib/gdb-test.exp (gdb_batch_check): Catch error running
        gdb command.

Index: libstdc++-v3/testsuite/lib/gdb-test.exp
===================================================================
--- libstdc++-v3/testsuite/lib/gdb-test.exp     (revision 194619)
+++ libstdc++-v3/testsuite/lib/gdb-test.exp     (working copy)
@@ -219,7 +219,9 @@
     set gdb_name $::env(GUALITY_GDB_NAME)
     set cmd "$gdb_name -nw -nx -quiet -batch -ex \"$command\""
     send_log "Spawning: $cmd\n"
-    set res [remote_spawn target "$cmd"]
+    if [catch { set res [remote_spawn target "$cmd"] } ] {
+       return 0
+    }
     if { $res < 0 || $res == "" } {
        return 0
     }

Reply via email to