On 26/05/21 13:24, Vladimir Sementsov-Ogievskiy wrote:
Define -gdb flag and GDB_OPTIONS environment variable
Let's use --option notation for new long options
Why make a mix of two styles? -- suggests that single-character options
like -d and -v can be combined, is that the case?
if -gdb is not provided but $GDB_OPTIONS is set, ignore the
environment variable.
Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
---
tests/qemu-iotests/check | 6 +++++-
tests/qemu-iotests/iotests.py | 5 +++++
tests/qemu-iotests/testenv.py | 19 ++++++++++++++++---
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index d1c87ceaf1..b9820fdaaf 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -33,6 +33,9 @@ def make_argparser() -> argparse.ArgumentParser:
help='pretty print output for make check')
p.add_argument('-d', dest='debug', action='store_true',
help='debug')
+ p.add_argument('-gdb', action='store_true',
+ help="start gdbserver with $GDB_OPTIONS options \
+ ('localhost:12345' if $GDB_OPTIONS is empty)")
Hmm.. Why not just make --gdb a string option, that defaults to
GDB_OPTIONS? This way it will more similar with other options.
I think then something like "./check -gdb 030" would not work, right?
Paolo