This prevents calling Breakpoint::shared_from_this of an object that is not owned by any shared_ptr.
The patch is a consequence of D74556
Paths
| Differential D74557
[lldb] Make BreakpointResolver hold weak_ptr instead of raw pointer to breakpoint ClosedPublic Authored by tatyana-krasnukha on Feb 13 2020, 7:05 AM.
Details Summary This prevents calling Breakpoint::shared_from_this of an object that is not owned by any shared_ptr. The patch is a consequence of D74556
Diff Detail Event TimelineComment Actions I wonder if it wouldn't be better to assert in GetBreakpoint. Except when you are making the resolver, you should never have a breakpoint resolver without a valid breakpoint. And there's no point in calling GetBreakpoint when you know you haven't set it yet. You assert after most of the calls to GetBreakpoint, but not all. Of the ones you don't, I think most of them should be. Were there any places you found where it was legit to ask for the Breakpoint for a resolver and not have one? Other than that LGTM. Comment Actions Moved assertion into GetBreakpoint().
I didn't find any, however, it seems to be possible in theory as BreakpointResolver is allowed to be constructed with nullptr instead of breakpoint (it is expected to call SetBreakpoint later). Comment Actions Just realized that BreakpointResolverScripted::CreateImplementationIfNeeded should work when m_breakpoint == nullptr. Comment Actions You mean for BreakpointResolverScripted::CreateImplementationIfNeeded? Passing in the BreakpointSP is fine. This revision is now accepted and ready to land.Mar 3 2020, 10:01 AM Closed by commit rG6c17cc531f9f: [lldb] Make BreakpointResolver hold weak_ptr instead of raw pointer to… (authored by tatyana-krasnukha). · Explain WhyMar 4 2020, 6:12 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 244645 lldb/include/lldb/Breakpoint/BreakpointResolver.h
lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
lldb/include/lldb/Breakpoint/BreakpointResolverName.h
lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
lldb/include/lldb/Target/LanguageRuntime.h
lldb/source/Breakpoint/Breakpoint.cpp
lldb/source/Breakpoint/BreakpointResolver.cpp
lldb/source/Breakpoint/BreakpointResolverAddress.cpp
lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
lldb/source/Breakpoint/BreakpointResolverName.cpp
lldb/source/Breakpoint/BreakpointResolverScripted.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Target/LanguageRuntime.cpp
lldb/source/Target/Target.cpp
|