Skip to content

Commit

Permalink
Merge pull request #476 from riscv-software-src/env_args
Browse files Browse the repository at this point in the history
Get gcc and gdb path from environment.
  • Loading branch information
timsifive committed Jun 13, 2023
2 parents 7b52ba3 + 6c5455c commit d0d1b08
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions debug/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ def __init__(self, stdout, stderr):

gcc_cmd = None
def compile(args): # pylint: disable=redefined-builtin
if gcc_cmd:
cmd = [gcc_cmd]
else:
cmd = ["riscv64-unknown-elf-gcc"]
cmd = [gcc_cmd]
cmd.append("-g")
for arg in args:
found = find_file(arg)
Expand Down Expand Up @@ -607,7 +604,7 @@ def __init__(self, target, ports, cmd=None, timeout=60, binaries=None):

self.target = target
self.ports = ports
self.cmd = cmd or "riscv64-unknown-elf-gdb"
self.cmd = cmd
self.timeout = timeout
self.binaries = binaries or [None] * len(ports)

Expand Down Expand Up @@ -1059,9 +1056,15 @@ def add_test_run_options(parser):
parser.add_argument("test", nargs='*',
help="Run only tests that are named here.")
parser.add_argument("--gcc",
help="The command to use to start gcc.")
help="The command to use to start gcc. Defaults to the contents of "
"RISCV_TESTS_DEBUG_GCC, or riscv64-unknown-elf-gcc.",
default=os.environ.get("RISCV_TESTS_DEBUG_GCC",
"riscv64-unknown-elf-gcc"))
parser.add_argument("--gdb",
help="The command to use to start gdb.")
help="The command to use to start gdb. Defaults to the contents of "
"RISCV_TESTS_DEBUG_GDB, or riscv64-unknown-elf-gdb.",
default=os.environ.get("RISCV_TESTS_DEBUG_GDB",
"riscv64-unknown-elf-gdb"))
parser.add_argument("--misaval",
help="Don't run ExamineTarget, just assume the misa value which is "
"specified.")
Expand Down

0 comments on commit d0d1b08

Please sign in to comment.