Multi-target support
[deliverable/binutils-gdb.git] / gdb / inline-frame.c
index 998204618549a434d75dd147ea0d79e4ff667a45..0ee1de3a1f1c6a423eec4486e5beb7090520d2f5 100644 (file)
@@ -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 ())
This page took 0.041754 seconds and 4 git commands to generate.