[gdb/testsuite] Fix quoting issues in gdb.dwarf2 for remote host
authorTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 11:58:09 +0000 (13:58 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 11:58:09 +0000 (13:58 +0200)
commitd0498b325e3c5d65372087fde46351b55980f111
tree79382085ab52d9bf6645766b081ff16ebe7058b3
parent845d99df89b8eee01de354f49489b2863673122c
[gdb/testsuite] Fix quoting issues in gdb.dwarf2 for remote host

A few test-cases in gdb.dwarf2 use something like:
...
  additional_flags=\"-DFOO=BAR + 10\"
...
which doesn't work on remote host.

Fix this by introducing a new proc quote_for_host that also works for remote
host, such that we have:
...
  additional_flags=[quote_for_host -DFOO=BAR + 10]
...

Tested on x86_64-linux.
gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
gdb/testsuite/lib/gdb.exp