public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target
@ 2021-08-09 11:47 Luc Michel
  2021-08-17 15:55 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Luc Michel @ 2021-08-09 11:47 UTC (permalink / raw)
  To: libstdc++, Jonathan Wakely; +Cc: Luc Michel, Marc Poulhies

This fixes an incorrect invocation of gdb on remote targets where
DejaGNU would try to run host's gdb in remote target simulator.
gdb-test skips the testing when target is remote or non native but the
gdb version check function does not.

Co-authored-by: Marc Poulhies <mpoulhies@kalrayinc.com>
Suggested-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Michel <lmichel@kalray.eu>
---
Hi

Marc has now left Kalray so I'll carry on with this patch. I applied
Jonathan's suggestion. Let me know if things are OK.

v2 changes:
    * Put the check in gdb_version_check/gdb_version_check_xmethods
      instead of gdb_batch_check [Jonathan]

Thanks.

Luc
---
 libstdc++-v3/testsuite/lib/gdb-test.exp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
index af20c85e5a0..f993355c2b4 100644
--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -278,18 +278,22 @@ proc gdb_batch_check {command pattern} {
 # require gdb 7.3, but we don't want to test versions, so instead we
 # check for the python "lookup_global_symbol" method, which is in 7.3
 # 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>"]
 }
 
 # Check for a version of gdb which supports xmethod tests.  It is done
 # 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'>"]
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target
  2021-08-09 11:47 [PATCH v2] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target Luc Michel
@ 2021-08-17 15:55 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-08-17 15:55 UTC (permalink / raw)
  To: Luc Michel; +Cc: libstdc++, Marc Poulhies, gcc Patches

On Mon, 9 Aug 2021 at 12:47, Luc Michel wrote:
>
> This fixes an incorrect invocation of gdb on remote targets where
> DejaGNU would try to run host's gdb in remote target simulator.
> gdb-test skips the testing when target is remote or non native but the
> gdb version check function does not.
>
> Co-authored-by: Marc Poulhies <mpoulhies@kalrayinc.com>
> Suggested-by: Jonathan Wakely <jwakely@redhat.com>
> Signed-off-by: Luc Michel <lmichel@kalray.eu>
> ---
> Hi
>
> Marc has now left Kalray so I'll carry on with this patch. I applied
> Jonathan's suggestion. Let me know if things are OK.
>
> v2 changes:
>     * Put the check in gdb_version_check/gdb_version_check_xmethods
>       instead of gdb_batch_check [Jonathan]
>
> Thanks.

Thanks for the updated patch, I've tested it and pushed it to trunk now.


> Luc
> ---
>  libstdc++-v3/testsuite/lib/gdb-test.exp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
> index af20c85e5a0..f993355c2b4 100644
> --- a/libstdc++-v3/testsuite/lib/gdb-test.exp
> +++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
> @@ -278,18 +278,22 @@ proc gdb_batch_check {command pattern} {
>  # require gdb 7.3, but we don't want to test versions, so instead we
>  # check for the python "lookup_global_symbol" method, which is in 7.3
>  # 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>"]
>  }
>
>  # Check for a version of gdb which supports xmethod tests.  It is done
>  # 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'>"]
>  }
>
> --
> 2.17.1
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-17 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 11:47 [PATCH v2] libstdc++: Fix testsuite for skipping gdb tests on remote/non-native target Luc Michel
2021-08-17 15:55 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).