[Lldb-commits] [lldb] [LLDB] Add module hook implementation (PR #185465)

Bar Soloveychik via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 9 12:12:07 PDT 2026


barsolo2000 wrote:

> Excellent! Just two more things and this is all good.
> 
> I think you should call "Confirm" before deleting all the hooks - we generally do that for "delete all of something it took some effort to set up".
> 
> You correctly documented what GetAbstractRequirements should do, but didn't implement what you documented. Now that you have GetSupportedMethods that should be easy. When this sort of thing fails it can be really opaque and confusing, and we've been kind of undisciplined about reporting these errors, which we need to stop doing...

The at-least-one check is implemented in `HookScripted::SetScriptCallback` (Target.cpp:4556-4560), after `CreatePluginObject` succeeds, it calls `GetSupportedMethods()` and rejects the hook if `!methods.any()`. I couldn't use `GetAbstractMethodRequirements` for this because that mechanism is AND-based (every listed method must exist), but our constraint is OR-based (at least one of three)..

Let me know if you'd like it enforced differently.

https://github.com/llvm/llvm-project/pull/185465


More information about the lldb-commits mailing list