[gdb/testsuite] Improve argument syntax of proc arange
authorTom de Vries <tdevries@suse.de>
Mon, 30 Aug 2021 08:30:26 +0000 (10:30 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 30 Aug 2021 08:30:26 +0000 (10:30 +0200)
commit590d3faada8a12bf0937bbf68413956dc6a339a9
treef2da67d9f0140da453dbf697d96bc5bb66282618
parentcb03dd22b36b7bd21a81137005ec42dab8355b62
[gdb/testsuite] Improve argument syntax of proc arange

The current syntax of proc arange is:
...
  proc arange { arange_start arange_length {comment ""} {seg_sel ""} } {
...
and a typical call looks like:
...
  arange $start $len
...

This style is somewhat annoying because if you want to specify the last
parameter, you need to give the default values of all the other optional ones
before as well:
...
  arange $start $len "" $seg_sel
...

Update the syntax to:
...
    proc arange { options arange_start arange_length } {
       parse_options {
           { comment "" }
           { seg_sel "" }
       }
...
such that a typical call looks like:
...
  arange {} $start $len
...
and a call using seg_sel looks like:
...
  arange {
    seg_sel $seg_sel
  } $start $len
...

Also update proc aranges, which already has an options argument, to use the
new proc parse_options.

Tested on x86_64-linux.

Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>
gdb/testsuite/gdb.dlang/watch-loc.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
gdb/testsuite/gdb.testsuite/parse_options_args.exp [new file with mode: 0644]
gdb/testsuite/lib/dwarf.exp
gdb/testsuite/lib/gdb.exp