From: Alexey Makhalov <alexey.makhalov(a)broadcom.com>
By doing it we avoid dropping gdb caches unnecessarily.
Cc: Sourabh Jain <sourabhjain(a)linux.ibm.com>
Cc: Hari Bathini <hbathini(a)linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh(a)linux.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao(a)linux.vnet.ibm.com>
Cc: Lianbo Jiang <lijiang(a)redhat.com>
Cc: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab(a)nec.com>
Cc: Tao Liu <ltao(a)redhat.com>
Cc: Alexey Makhalov <alexey.makhalov(a)broadcom.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov(a)broadcom.com>
---
task.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/task.c b/task.c
index b91acb2..c131cc3 100644
--- a/task.c
+++ b/task.c
@@ -5295,6 +5295,10 @@ set_context(ulong task, ulong pid, uint update_gdb_thread)
struct task_context *tc;
int found;
+ if (CURRENT_CONTEXT() &&
+ (CURRENT_TASK() == task || CURRENT_PID() == pid))
+ return TRUE;
+
tc = FIRST_CONTEXT();
for (i = 0, found = FALSE; i < RUNNING_TASKS(); i++, tc++) {
--
2.40.1