[Lldb-commits] [lldb] Add a breakpoint override resolver feature to lldb (PR #195392)
via lldb-commits
lldb-commits at lists.llvm.org
Mon May 4 09:31:09 PDT 2026
================
@@ -63,17 +63,26 @@ class BreakpointResolverScripted : public BreakpointResolver {
lldb::BreakpointResolverSP
CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
+ // OverridesResolver will get called before this resolver has been assigned a
+ // breakpoint. You should only need to see the resolver to know whether you
+ // want to override it, but you may need to check something about the target,
+ // which you would normally get to from the breakpoint, so we pass it in here.
+ bool OverridesResolver(Target &target,
+ lldb::BreakpointResolverSP original_sp) override;
+
protected:
void NotifyBreakpointSet() override;
private:
void CreateImplementationIfNeeded(lldb::BreakpointSP bkpt);
+ void CreateImplementationIfNeeded(Target &target, lldb::BreakpointSP bkpt);
----------------
jimingham wrote:
BreakpointResolvers hold their breakpoint once they are assigned to one, but not their targets.
But the way breakpoints and their resolvers work, the Resolvers get made first, and then attached to their breakpoints. So when you are calling the overrides resolver, the breakpoint hasn't decided which resolver it will use yet, and so won't belong to a breakpoint.
I don't want to have to add and remove resolvers from breakpoints, so I'd rather keep the "figure out which resolver we are going to use and then attach it to a breakpoint" behavior. So for overrides_resolver we need to pass in the target explicitly.
https://github.com/llvm/llvm-project/pull/195392
More information about the lldb-commits
mailing list