Urgent fix for debugger port selection in run_tests.py
@@ -4,6 +4,7 @@ import argparse
import pexpect
import sys
import random
+import os
N_SIMPLE = 5
N_THOROUGH = 100
@@ -11,6 +12,7 @@ TIMEOUT = 5
RETRIES_MAX = 5
REPEAT = 5
+GDB_PORT_BASE = 9100
# Tries to decode binary output as ASCII, as hard as it can.
def safe_decode(data):
@@ -19,11 +21,12 @@ def safe_decode(data):
# Tries to start gdb in order to investigate kernel state on deadlock.
def gdb_inspect():
+ gdb_port = GDB_PORT_BASE + os.getuid()
gdb_command = 'mipsel-mimiker-elf-gdb'
# Note: These options are different than .gdbinit.
gdb_opts = ['-nx',
'mimiker.elf',
- '-ex=target remote localhost:1234',
+ '-ex=target remote localhost:%d' % gdb_port,
'-ex=source debug/kdump.py']
gdb = pexpect.spawn(gdb_command, gdb_opts, timeout=1)
gdb.expect_exact('(gdb)', timeout=2)
