[Pdbg] [PATCH 8/8] libpdbg: Update thread state when starting/stopping all threads
Amitay Isaacs
amitay at ozlabs.org
Fri Oct 9 15:00:01 AEDT 2020
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/sbefifo.c | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index fae2ab7..a8e4522 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -263,12 +263,32 @@ static int sbefifo_pib_thread_op(struct pib *pib, uint32_t oper)
static int sbefifo_pib_thread_start(struct pib *pib)
{
- return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_START);
+ struct pdbg_target *target;
+ int rc;
+
+ rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_START);
+
+ pdbg_for_each_target("thread", &pib->target, target) {
+ struct thread *thread = target_to_thread(target);
+ thread->status = thread->state(thread);
+ }
+
+ return rc;
}
static int sbefifo_pib_thread_stop(struct pib *pib)
{
- return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_STOP);
+ struct pdbg_target *target;
+ int rc;
+
+ rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_STOP);
+
+ pdbg_for_each_target("thread", &pib->target, target) {
+ struct thread *thread = target_to_thread(target);
+ thread->status = thread->state(thread);
+ }
+
+ return rc;
}
static int sbefifo_pib_thread_step(struct pib *pib, int count)
@@ -283,7 +303,17 @@ static int sbefifo_pib_thread_step(struct pib *pib, int count)
static int sbefifo_pib_thread_sreset(struct pib *pib)
{
- return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_SRESET);
+ struct pdbg_target *target;
+ int rc;
+
+ rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_SRESET);
+
+ pdbg_for_each_target("thread", &pib->target, target) {
+ struct thread *thread = target_to_thread(target);
+ thread->status = thread->state(thread);
+ }
+
+ return rc;
}
static int sbefifo_thread_probe(struct pdbg_target *target)
--
2.26.2
More information about the Pdbg
mailing list