Merge pull request #38 from richardxia/disable_tcl_and_telnet_servers
authorTim Newsome <tim@sifive.com>
Tue, 13 Dec 2016 00:06:31 +0000 (16:06 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Dec 2016 00:06:31 +0000 (16:06 -0800)
Disable tcl and telnet servers when running OpenOCD

debug/testlib.py

index 6655e05511ecb7863284fa36f09109d62bc017c1..ac1d7713f9f5f63d319efd3dbbfb42f98d500c73 100644 (file)
@@ -140,8 +140,18 @@ class Openocd(object):
 
         # This command needs to come before any config scripts on the command
         # line, since they are executed in order.
-        # Tell OpenOCD to bind to an unused port.
-        cmd[1:1] = ["--command", "gdb_port %d" % 0]
+        cmd[1:1] = [
+            # Tell OpenOCD to bind gdb to an unused, ephemeral port.
+            "--command",
+            "gdb_port 0",
+            # Disable tcl and telnet servers, since they are unused and because
+            # the port numbers will conflict if multiple OpenOCD processes are
+            # running on the same server.
+            "--command",
+            "tcl_port disabled",
+            "--command",
+            "telnet_port disabled",
+        ]
 
         logfile = open(Openocd.logname, "w")
         logfile.write("+ %s\n" % " ".join(cmd))