[1/4] gdb/observer: Provide target_thread_changed observer
Commit Message
LKD utilises an extra observer to obtain notifications whenever
the target_thread is changed.
This keeps it's internal state aware of any changes that occur
in an event driven manner
---
gdb/doc/observer.texi | 5 +++++
gdb/remote.c | 4 ++++
2 files changed, 9 insertions(+)
Comments
Kieran Bingham <kieran.bingham@linaro.org> writes:
> LKD utilises an extra observer to obtain notifications whenever
> the target_thread is changed.
>
> This keeps it's internal state aware of any changes that occur
> in an event driven manner
Sorry, I don't understand why do we need this observer. What problem
are you trying to fix?
@@ -302,3 +302,8 @@ This observer is used for internal testing. Do not use.
See testsuite/gdb.gdb/observer.exp.
@end deftypefun
+@deftypefun void target_thread_changed (ptid_t @var{somearg})
+The target has changed its current thread to ptid_t. Used by LKD and called
+by the shtdi and remote interfaces.
+@end deftypefun
+
@@ -2162,6 +2162,8 @@ static void
set_general_thread (struct ptid ptid)
{
set_thread (ptid, 1);
+
+ observer_notify_target_thread_changed (ptid);
}
static void
@@ -7071,6 +7073,8 @@ remote_wait (struct target_ops *ops,
mark_async_event_handler (remote_async_inferior_event_token);
}
+ observer_notify_target_thread_changed (event_ptid);
+
return event_ptid;
}