[NEWS] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target

Jonathan Wakely jwakely@redhat.com
Wed Jul 21 15:53:52 GMT 2021


On Wed, 21 Jul 2021 at 16:02, Marc Poulhies via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> With the correct patch attached, sorry for the incorrect previous one !

Thanks for the patch. I agree we should skip the version checks, not
only the actual tests. But I wonder whether we want to do that in
xmethods.exp and prettyprinters.exp rather than in the gdb_batch_check
proc. Or maybe like this instead:

--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -280,6 +280,8 @@ proc gdb_batch_check {command pattern} {
# but not earlier versions.
# Return 1 if the version is ok, 0 otherwise.
proc gdb_version_check {} {
+    if { ![isnative] || [is_remote target] } { return 0 }
+
    return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
             "<built-in function lookup_global_symbol>"]
}
@@ -288,6 +290,8 @@ proc gdb_version_check {} {
# in a manner similar to the check for a version of gdb which supports the
# pretty-printer tests below.
proc gdb_version_check_xmethods {} {
+    if { ![isnative] || [is_remote target] } { return 0 }
+
    return [gdb_batch_check \
             "python import gdb.xmethod; print(gdb.xmethod.XMethod)" \
             "<class 'gdb\\.xmethod\\.XMethod'>"]



I don't think it really makes much difference, I'm just unsure what is
"cleaner" and more consistent with DG conventions and/or the rest of
the gdb-test.exp file.



More information about the Libstdc++ mailing list