]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix gdb.base/testenv.exp against --target_board=native-extended-gdbserver
authorPedro Alves <palves@redhat.com>
Thu, 12 Oct 2017 17:27:20 +0000 (18:27 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 13 Oct 2017 16:50:19 +0000 (17:50 +0100)
commit50500caf810fcc6c05e3fd89bc37fe8f9e4adb07
tree91a9d5f2a3a0a3ddae3cf6cf8a6990b4c1e540ff
parentdad0c6d2f7410d3b451800f856f3c6818303c316
Fix gdb.base/testenv.exp against --target_board=native-extended-gdbserver

Currently we get:

  Running ..../src/gdb/testsuite/gdb.base/testenv.exp ...
  FAIL: gdb.base/testenv.exp: test no TEST_GDB var
  FAIL: gdb.base/testenv.exp: test with one TEST_GDB var
  FAIL: gdb.base/testenv.exp: test with two TEST_GDB var
  FAIL: gdb.base/testenv.exp: test with one TEST_GDB var, after unset
  FAIL: gdb.base/testenv.exp: test with TEST_GDB_GLOBAL
  FAIL: gdb.base/testenv.exp: test with TEST_GDB_GLOBAL unset

The problem is that the testcase relies on stdio.  While we could fix
this for gdbserver by read output from inferior_spawn_id, a better fix
it to not rely on stdio at all.  That's what this commit does.
Instead, it reads variables off of the inferior to extract the
necessary information.

Along the way, most of the .exp file is reimplemented/cleaned up using
more modern mechanisms.  E.g., with_test_prefix, proc_with_prefix,
save_vars, etc.  Also, a missing check for "is_remote host" is added.

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

* gdb.base/testenv.exp: Check use_gdb_stub instead of is_remote.
(test_num_test_vars, run_and_count_vars, find_env)
(test_set_unset_env, test_inherit_env_var): New procedures.
(top level): Use them.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/testenv.exp