[gdb/testsuite] Add cond_wrap proc
authorTom de Vries <tdevries@suse.de>
Fri, 14 Oct 2022 11:09:50 +0000 (13:09 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 14 Oct 2022 11:09:50 +0000 (13:09 +0200)
commit1e4be05b752cc94019ed12d6d305e13e55530724
tree194f86c0fb404c22f78b92c184bba71ced0d948f
parent2ff50ff02d99b27b6b2069c931f759d86afdbbe2
[gdb/testsuite] Add cond_wrap proc

Add a new proc cond_wrap, that can be used to replace the repetitive:
...
    if { $cond } {
wrap {
    <body>
}
    } else {
<body>
    }
...
with the shorter:
...
    cond_wrap $cond wrap {
<body>
    }
...

Tested on x86_64-linux.
gdb/testsuite/gdb.testsuite/cond-wrap.exp [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp