LLDB mainline
ScriptedHookInterface.h
Go to the documentation of this file.
1//===-- ScriptedHookInterface.h ---------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_INTERPRETER_INTERFACES_SCRIPTEDHOOKINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDHOOKINTERFACE_H
11
12#include "lldb/lldb-private.h"
13
14#include "ScriptedInterface.h"
15
16namespace lldb_private {
18public:
19 /// Describes which hook callback methods the Python class implements.
23 bool handle_stop = false;
24
25 bool any() const {
27 }
28 };
29
30 virtual llvm::Expected<StructuredData::GenericSP>
31 CreatePluginObject(llvm::StringRef class_name, lldb::TargetSP target_sp,
32 const StructuredDataImpl &args_sp) = 0;
33
34 /// Check which hook callback methods the Python class implements.
35 /// Called after CreatePluginObject to determine the trigger mask.
37
38 /// Called when modules are loaded into the target.
39 virtual void HandleModuleLoaded(lldb::StreamSP &output_sp) {}
40
41 /// Called when modules are unloaded from the target. Optional.
42 virtual void HandleModuleUnloaded(lldb::StreamSP &output_sp) {}
43
44 /// Called when the process stops. Returns "should_stop" if false, the
45 /// process will continue. Defaults to true (stop on unimplemented).
46 virtual llvm::Expected<bool> HandleStop(ExecutionContext &exe_ctx,
47 lldb::StreamSP &output_sp) {
48 return true;
49 }
50};
51} // namespace lldb_private
52
53#endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDHOOKINTERFACE_H
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, lldb::TargetSP target_sp, const StructuredDataImpl &args_sp)=0
virtual SupportedHookMethods GetSupportedMethods()
Check which hook callback methods the Python class implements.
virtual llvm::Expected< bool > HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP &output_sp)
Called when the process stops.
virtual void HandleModuleUnloaded(lldb::StreamSP &output_sp)
Called when modules are unloaded from the target. Optional.
virtual void HandleModuleLoaded(lldb::StreamSP &output_sp)
Called when modules are loaded into the target.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Target > TargetSP
Describes which hook callback methods the Python class implements.