Skip to content

Commit

Permalink
ri5cy: Allow gdbserver command override with env variable
Browse files Browse the repository at this point in the history
This allows an alternative gdbserver command to be used when
running the tests.

testsuite/ChangeLog:

	* config/ri5cyverilator.exp (beebs_load): Pick up
	GDBSERVER_CMD environment variable if set.
  • Loading branch information
edward-jones committed Apr 24, 2019
1 parent dbf6b68 commit 75c94b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2019-04-24 Edward Jones <[email protected]>

* config/ri5cyverilator.exp (beebs_load): Pick up
GDBSERVER_CMD environment variable if set.

2019-04-23 Edward Jones <[email protected]>

* config/ri5cyverilator.exp (beebs_load): Check for
Expand Down
10 changes: 8 additions & 2 deletions testsuite/config/ri5cyverilator.exp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ set_board_info beebs,benchmarks "$env(BENCHMARKS)"

proc beebs_load { file } {
set GDB riscv32-unknown-elf-gdb
set GDB_SERVER riscv32-gdbserver
set GDBSERVER_CMD "riscv32-gdbserver -c ri5cy --stdin"

# Maybe override the gdbserver command with an environment variable
if { [llength [array names ::env GDBSERVER_CMD]] > 0 } {
set GDBSERVER_CMD $::env(GDBSERVER_CMD)
verbose "GDBSERVER_CMD set to $GDBSERVER_CMD"
}

# Launch GDB, the target, and start running.
#
Expand All @@ -37,7 +43,7 @@ proc beebs_load { file } {
# We set all required breakpoints here then begin execution.
spawn $GDB --interpreter=mi -ex "set height 0" \
-ex "file $file" \
-ex "target remote | $GDB_SERVER -c ri5cy --stdin" \
-ex "target remote | $GDBSERVER_CMD" \
-ex "stepi" \
-ex "stepi" \
-ex "load" \
Expand Down

0 comments on commit 75c94b5

Please sign in to comment.