X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Finline-frame.c;h=ae0af2e5a523797b1c1c1ca27bcebe9559fde726;hb=2301204a3b3cd6553f7490498b3adc5973157c1b;hp=ac68658b64f6d32c9605200bd97f55f33173996e;hpb=94403fc6cd6f69e61001fcbcb8370312399c72d0;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c index ac68658b64..ae0af2e5a5 100644 --- a/gdb/inline-frame.c +++ b/gdb/inline-frame.c @@ -1,7 +1,7 @@ /* Inline frame unwinder for GDB. - Copyright (C) 2008-2019 Free Software Foundation, Inc. - Copyright (C) 2019 Advanced Micro Devices, Inc. All rights reserved. + Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved. This file is part of GDB. @@ -96,37 +96,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 ())