Use "maint ignore-probes" in no-libstdcxx-probe.exp

Message ID 20230119185607.1729073-1-tromey@adacore.com
State Committed
Headers
Series Use "maint ignore-probes" in no-libstdcxx-probe.exp |

Commit Message

Tom Tromey Jan. 19, 2023, 6:56 p.m. UTC
  While looking at some test output, I saw that no-libstdcxx-probe.exp
was not being run.  However, it occurred to me that Tom de Vries' new
"maint ignore-probes" command could be used to enable this test
unconditionally.
---
 gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
  

Comments

Tom de Vries Jan. 19, 2023, 10:03 p.m. UTC | #1
On 2023-01-19 18:56, Tom Tromey via Gdb-patches wrote:
> While looking at some test output, I saw that no-libstdcxx-probe.exp
> was not being run.  However, it occurred to me that Tom de Vries' new
> "maint ignore-probes" command could be used to enable this test
> unconditionally.
> ---

Hi,

nice to see the new command being used :)

I've tried out the patch, works for me.

LGTM.

Thanks,
- Tom

>  gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
> b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
> index b10daa638e6..752298af55d 100644
> --- a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
> +++ b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
> @@ -21,12 +21,11 @@ if {[prepare_for_testing "failed to prepare"
> $testfile $srcfile {debug c++}]} {
>      return -1
>  }
> 
> -if {![runto_main]} {
> -    return -1
> -}
> +# This tests that $_exception gives an error when the systemtap probes
> +# are not available, so simulate this by disabling them.
> +gdb_test "maint ignore-probes libstdcxx .*" ".*OBJNAME: ''"
> 
> -if { [skip_libstdcxx_probe_tests] == 0 } {
> -    untested "Have libstdc++ stap probe"
> +if {![runto_main]} {
>      return -1
>  }
  

Patch

diff --git a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
index b10daa638e6..752298af55d 100644
--- a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
+++ b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
@@ -21,12 +21,11 @@  if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if {![runto_main]} {
-    return -1
-}
+# This tests that $_exception gives an error when the systemtap probes
+# are not available, so simulate this by disabling them.
+gdb_test "maint ignore-probes libstdcxx .*" ".*OBJNAME: ''"
 
-if { [skip_libstdcxx_probe_tests] == 0 } {
-    untested "Have libstdc++ stap probe"
+if {![runto_main]} {
     return -1
 }