[all-commits] [llvm/llvm-project] 27893f: Call WatchpointList::RemoveAll in Target::Destroy.

jimingham via All-commits all-commits at lists.llvm.org
Wed Jul 27 15:15:22 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27893ff1ad750d9828ca3a774ba9f0029c16149f
  Author: Jim Ingham <jingham at apple.com>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

  Changed paths:
    M lldb/source/Target/Target.cpp

  Log Message:
  Call WatchpointList::RemoveAll in Target::Destroy.

I noticed that the test TestSetWatchpoint.py was failing every so often
on macOS.  The failure was in the last assert, that after destroying the
SBTarget containing it, the SBWatchpoint was still saying it was valid.

IsValid in this case just meant the watchpoint weak pointer could be turned
into a shared pointer.  The watchpoint shared pointers have two strong references
in general, one to the "Target::m_last_created_watchpoint", and one in the
Target::m_watchpoint_list.  Target::Destroy reset the last created watchpoint
but neglected to call RemoveAll on the watchpoint list (it does the analogous
work for the internal & external breakpoint lists...)  This patch does the
equivalent cleanup for the watchpoint list.

More information about the All-commits mailing list