aboutsummaryrefslogtreecommitdiff
path: root/gdb/inline-frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inline-frame.c')
-rw-r--r--gdb/inline-frame.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
index 9982046..0ee1de3 100644
--- a/gdb/inline-frame.c
+++ b/gdb/inline-frame.c
@@ -95,37 +95,54 @@ find_inline_frame_state (thread_info *thread)
return &state;
}
-/* Forget about any hidden inlined functions in PTID, which is new or
- about to be resumed. PTID may be minus_one_ptid (all processes)
- or a PID (all threads in this process). */
+/* See inline-frame.h. */
void
-clear_inline_frame_state (ptid_t ptid)
+clear_inline_frame_state (process_stratum_target *target, ptid_t filter_ptid)
{
- if (ptid == minus_one_ptid)
- {
- inline_states.clear ();
- return;
- }
+ gdb_assert (target != NULL);
- if (ptid.is_pid ())
+ if (filter_ptid == minus_one_ptid || filter_ptid.is_pid ())
{
- int pid = ptid.pid ();
+ auto matcher = [target, &filter_ptid] (const inline_state &state)
+ {
+ thread_info *t = state.thread;
+ return (t->inf->process_target () == target
+ && t->ptid.matches (filter_ptid));
+ };
+
auto it = std::remove_if (inline_states.begin (), inline_states.end (),
- [pid] (const inline_state &state)
- {
- return pid == state.thread->inf->pid;
- });
+ matcher);
inline_states.erase (it, inline_states.end ());
return;
}
+
+ auto matcher = [target, &filter_ptid] (const inline_state &state)
+ {
+ thread_info *t = state.thread;
+ return (t->inf->process_target () == target
+ && filter_ptid == t->ptid);
+ };
+
+ auto it = std::find_if (inline_states.begin (), inline_states.end (),
+ matcher);
+
+ if (it != inline_states.end ())
+ unordered_remove (inline_states, it);
+}
+
+/* See inline-frame.h. */
+
+void
+clear_inline_frame_state (thread_info *thread)
+{
auto it = std::find_if (inline_states.begin (), inline_states.end (),
- [&ptid] (const inline_state &state)
+ [thread] (const inline_state &state)
{
- return ptid == state.thread->ptid;
+ return thread == state.thread;
});
if (it != inline_states.end ())