diff options
author | Tim Newsome <tim@sifive.com> | 2017-12-12 08:02:38 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-12-12 08:02:38 -0800 |
commit | aaf4df2371624744bd90e2c9e71cabab2d91d9e1 (patch) | |
tree | 7706624f7b2d9fc560e615267d1d8bbf99188960 | |
parent | b747a10a7dd789620ebcde2197581ef8bf0fda33 (diff) | |
download | riscv-tests-aaf4df2371624744bd90e2c9e71cabab2d91d9e1.zip riscv-tests-aaf4df2371624744bd90e2c9e71cabab2d91d9e1.tar.gz riscv-tests-aaf4df2371624744bd90e2c9e71cabab2d91d9e1.tar.bz2 |
Display env variables used when invoking OpenOCD
This makes it a little easier to just cut and paste from the log when
reproducing a failure. (The port number still needs changing though.)
-rw-r--r-- | debug/testlib.py | 7 | ||||
m--------- | env | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/debug/testlib.py b/debug/testlib.py index 21eeb3d..39a6fc4 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -9,6 +9,7 @@ import sys import tempfile import time import traceback +import pipes import pexpect @@ -237,7 +238,11 @@ class Openocd(object): logfile = open(Openocd.logname, "w") if print_log_names: real_stdout.write("Temporary OpenOCD log: %s\n" % Openocd.logname) - logfile.write("+ %s\n" % " ".join(cmd)) + env_entries = ("REMOTE_BITBANG_HOST", "REMOTE_BITBANG_PORT") + env_entries = [key for key in env_entries if key in os.environ] + logfile.write("+ %s%s\n" % ( + "".join("%s=%s " % (key, os.environ[key]) for key in env_entries), + " ".join(map(pipes.quote, cmd)))) logfile.flush() self.gdb_ports = [] diff --git a/env b/env -Subproject 68cad7baf3ed0a4553fffd14726d24519ee1296 +Subproject db0bfa223142e56b17dae6d92610f195014bbb8 |