[LLDB] Add module hook implementation (#185465)
Introduce a unified target hook command system for LLDB that handles
multiple target lifecycle events (module load, module unload, process
stop) through a single Hook class.
The existing target stop-hook commands remain unchanged for now, meaning
stop-hooks can now be created through either target stop-hook add or
target hook add -S.
A future follow-up can alias target stop-hook to the unified system to
consolidate the two paths.
New commands:
- target hook add [-o cmd] [-P class] [-u] [-S] - create a hook (fires
on module load by default, optionally on unload/stop)
- target hook add-filter [filter-opts] <hook-id> - attach stop-event
filters (shlib, function, file/line, thread) to an existing hook
- target hook list / delete / enable / disable - manage hooks
- target hook {enable,disable} {module-loaded|module-unloaded|stop-hook}
<id> - per-event toggling
top-event filter options live on a separate add-filter command rather
than on target hook add, keeping the add command clean and making the
system safe for filters on other event types.
Ran the tests + Made sure stop tests are passing as well.
---------
Co-authored-by: Bar Soloveychik <barsolo@fb.com>
This commit is contained in:
1 parent
f70ed1f758
commit
b1c027b3aa
21 files changed
+2000
-1
No files matched your search
@@ -1525,6 +1525,11 @@ ScriptInterpreterPythonImpl::CreateScriptedStopHookInterface() {
|
||||
return std::make_shared<ScriptedStopHookPythonInterface>(*this);
|
||||
}
|
||||
|
||||
ScriptedHookInterfaceSP
|
||||
ScriptInterpreterPythonImpl::CreateScriptedHookInterface() {
|
||||
return std::make_shared<ScriptedHookPythonInterface>(*this);
|
||||
}
|
||||
|
||||
ScriptedBreakpointInterfaceSP
|
||||
ScriptInterpreterPythonImpl::CreateScriptedBreakpointInterface() {
|
||||
return std::make_shared<ScriptedBreakpointPythonInterface>(*this);
|
||||
|
||||
Reference in new issue
Block a user