riscv-openocd/src
Tim Newsome 0b965363a6
Deal with halt race. (#664)
* Deal with halt race.

What could happen:
1. hart 1 halts due to a breakpoint
2. OpenOCD polls and notices hart 1 has halted.
3. hart 0 halts because it is in a halt group with halt 1
4. OpenOCD decides to halt hart 0 also.
5. OpenOCD discovers hart 0 is already halted, and doesn't update the
debug reason.

In that case OpenOCD would tell gdb that hart 0 halted, while the
interesting event is that hart 1 halted.

Fix this by updating the debug reason when we discover a hart is already
halted when we try to halt it.

This race was exposed in the Sv* address translation tests, but the bug
has nothing to do with address translation.

Change-Id: I59d871e8545bd644bf42581266f15234b93e9900
Signed-off-by: Tim Newsome <tim@sifive.com>

* Comment set_debug_reason

Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com>

Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com>
2021-11-24 10:20:15 -08:00
..
flash Merge branch 'master' into from_upstream 2021-10-25 10:20:31 -07:00
helper Merge branch 'master' into from_upstream 2021-10-25 10:20:31 -07:00
jtag Merge branch 'master' into from_upstream 2021-10-25 10:20:31 -07:00
pld openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
rtos Fix incorrectly resolved conflict. 2021-10-06 14:35:04 -07:00
rtt From upstream (#580) 2021-02-11 11:27:18 -08:00
server Merge branch 'master' into from_upstream 2021-10-05 17:46:02 -07:00
svf openocd: fix Yoda conditions with checkpatch 2021-07-24 10:38:31 +01:00
target Deal with halt race. (#664) 2021-11-24 10:20:15 -08:00
transport openocd: remove NULL comparisons with checkpatch [1/2] 2021-07-24 10:38:00 +01:00
xsvf openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
Makefile.am Remove gnulib. (#615) 2021-05-28 13:24:51 -07:00
hello.c openocd: fix simple cases of Yoda condition 2021-07-20 14:55:24 +01:00
hello.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
main.c Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
openocd.c openocd: prepare for jimtcl 0.81 'expr' syntax change 2021-09-04 07:23:08 +00:00
openocd.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00