Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/spike-openocd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ jobs:
git clone "$RISCV_TESTS_REPO"
cd riscv-tests
git checkout "$RISCV_TESTS_REV"
git submodule update --init --recursive
git submodule update --init --recursive

- name: Run basic debug test under Valgrind (memory leak check)
run: |
sudo apt-get install -y valgrind
echo "Running RISC-V debug test under Valgrind for memory leak detection..."
# Run a minimal configuration to detect leaks in riscv_openocd_step_impl()
valgrind --leak-check=full --error-exitcode=1 \
./src/openocd -f tcl/interface/jtag_dummy.cfg -f tcl/target/riscv.cfg -c "init; shutdown"

- name: Run Spike32 Tests
id: spike32-tests
Expand Down
2 changes: 2 additions & 0 deletions src/target/riscv/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4258,6 +4258,8 @@ static int riscv_openocd_step_impl(struct target *target, bool current,
LOG_TARGET_ERROR(target, "Failed to re-enable watchpoints "
"after single-step.");
}
free(wps_to_enable);
//no longer needed to be kept

if (breakpoint && (riscv_add_breakpoint(target, breakpoint) != ERROR_OK)) {
success = false;
Expand Down