From aaf4df2371624744bd90e2c9e71cabab2d91d9e1 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Tue, 12 Dec 2017 08:02:38 -0800 Subject: [PATCH] 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.) --- debug/testlib.py | 7 ++++++- env | 2 +- 2 files changed, 7 insertions(+), 2 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 index 68cad7b..db0bfa2 160000 --- a/env +++ b/env @@ -1 +1 @@ -Subproject commit 68cad7baf3ed0a4553fffd14726d24519ee1296a +Subproject commit db0bfa223142e56b17dae6d92610f195014bbb80 -- 2.30.2