From: <ge...@op...> - 2019-02-26 19:25:29
|
This is an automated email from Gerrit. Graham Sanderson (gra...@gm...) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4976 -- gerrit commit 88a88d881e7b8fe3034caff7f8faff6673c700d8 Author: graham sanderson <gra...@gm...> Date: Tue Feb 26 12:02:41 2019 -0600 rtos/hwthread: switch the smp thread based on the requested target. Because there is only one thread per target, hwthread is able to make a thread requested by gdb current (it is always current on its target) if hwthread finds the thread_id. This avoids the fake_step behavior in gdbserver.c and allows you to hit a breakpoint, switch threads, and step on the new thread correctly. I had a similar change http://openocd.zylin.com/#/c/4937/ which did this also. That had an explicit boolean parameter to gate update of target->rtos->current_thread, however in all current usages, setting it is safe (it just sets it to the same value except in the one case we care about). Perhaps we should change the function name accordingly. Change-Id: I108392732768c8dbb320ad9f9531b93caa23b5d4 Signed-off-by: graham sanderson <gra...@gm...> diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 2d9e42f..ada5a25 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -287,6 +287,8 @@ static int hwthread_target_for_threadid(struct connection *connection, int64_t t if (head == NULL) return ERROR_FAIL; + + target->rtos->current_thread = thread_id; } else { curr = target; if (thread_id != threadid_from_target(curr)) -- |