Switch --gdb-dex2oat to GDB

This also fixes the issue with the "--" part erroneously being added
to GDB_DEX2OAT_ARGS twice for the secondary compilation - via
renaming GDB_DEX2OAT_ARGS -> GDB_DEX2OAT_EXTRA_ARGS and introducing
GDB_DEX2OAT_ARGS local variable with value constructed independently
of previous write_dex2oat_cmdlines invocations.

To avoid ambiguity on whether the extra arguments are for gdb or
for dex2oat, move them to an earlier position on the command line.
Also, fix handling of dash symbols in the extra arguments.

Test: art/test.py -v -j56 --host --64 --optimizing --ndebug \
      --ndebuggable --gdb-dex2oat -t 071-dexfile-map-clean \
      --run-test
Test: art/test.py -v -j56 --host --64 --optimizing \
      --ndebuggable --gdb-dex2oat -t 071-dexfile-map-clean \
      --run-test
Test: art/test.py -v -j56 --host --64 --optimizing \
      --ndebuggable --gdb-dex2oat --gdb-dex2oat-args='--version' \
      -t 071-dexfile-map-clean --run-test
Test: art/test.py -v -j56 --host --64 --optimizing \
      --ndebuggable --gdb-dex2oat --gdb-dex2oat-args='--tui' \
      -t 071-dexfile-map-clean --run-test
Test: art/test.py -v -j56 --host --64 --optimizing \
      --ndebuggable --gdb-dex2oat --gdb-dex2oat-args='-ex=run;--tui' \
      -t 071-dexfile-map-clean --run-test
Change-Id: I598be3c3009947fea2fd6f45fa3a94a54a3c3d9e
3 files changed