gdb.multi/multi-arch-exec.exp: Also test -m32 => -m64
authorPedro Alves <palves@redhat.com>
Mon, 9 Oct 2017 17:11:02 +0000 (18:11 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 9 Oct 2017 17:11:02 +0000 (18:11 +0100)
commit777a42f1f86b60d11cfe0e5964036823e6920f79
tree0efc8783c0a60e3c6fb7ee09340adaf11d57e1ef
parentcbd2b4e316370ab740433b06ed65786831232c8f
gdb.multi/multi-arch-exec.exp: Also test -m32 => -m64

The gdb.multi/multi-arch-exec.exp testcase currently tests execing
from -m64 to -m32, but does not test the other direction.  For
thoroughness, this commit fixes that.  Without the fix in the previous
commit for example ("Multi-arch exec, more register reading
avoidance"), on x86_64 we would get different symptoms depending on
"execing direction".  Vis:

  Continuing.
  Truncated register 50 in remote 'g' packet
  Truncated register 50 in remote 'g' packet
  (gdb) FAIL: gdb.multi/multi-arch-exec.exp: first_arch=1: selected_thread=2: follow_exec_mode=same: continue across exec that changes architecture

Vs:

  Continuing.
  Remote 'g' packet reply is too long (expected 440 bytes, got 816 bytes): daffffffffffffff0000[snip]
  Remote 'g' packet reply is too long (expected 440 bytes, got 816 bytes): daffffffffffffff0000[snip]
  (gdb) FAIL: gdb.multi/multi-arch-exec.exp: first_arch=2: selected_thread=2: follow_exec_mode=same: continue across exec that changes architecture

gdb/testsuite/ChangeLog:
2017-10-09  Pedro Alves  <palves@redhat.com>

Test both arch1=>arch2 and arch2=>arch1.

* gdb.multi/multi-arch-exec.exp (exec1, srcfile1, binfile1, exec2)
(srcfile2, binfile2, march1, march2): Remove globals.  Largely
factored out to...
(append_arch1_options, append_arch2_options, append_arch_options)
(build_executables): New procedures.
(do_test): New 'first_arch' parameter.  Use it to define 'from_exec'
local.
(top level): Add new 'first_arch' testing axis.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.multi/multi-arch-exec.exp