xref: /freebsd/contrib/llvm-project/lldb/include/lldb/Interpreter/Interfaces/ScriptedStopHookInterface.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- ScriptedStopHookInterface.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_SCRIPTEDSTOPHOOKINTERFACE_H
10 #define LLDB_INTERPRETER_INTERFACES_SCRIPTEDSTOPHOOKINTERFACE_H
11 
12 #include "lldb/lldb-private.h"
13 
14 #include "ScriptedInterface.h"
15 
16 namespace lldb_private {
17 class ScriptedStopHookInterface : public ScriptedInterface {
18 public:
19   virtual llvm::Expected<StructuredData::GenericSP>
20   CreatePluginObject(llvm::StringRef class_name, lldb::TargetSP target_sp,
21                      const StructuredDataImpl &args_sp) = 0;
22 
23   /// "handle_stop" will return a bool with the meaning "should_stop"...
24   /// If nothing is returned, we'll assume we are going to stop.
25   /// Also any errors should return true, since we should stop on error.
HandleStop(ExecutionContext & exe_ctx,lldb::StreamSP & output_sp)26   virtual llvm::Expected<bool> HandleStop(ExecutionContext &exe_ctx,
27                                           lldb::StreamSP &output_sp) {
28     return true;
29   }
30 };
31 } // namespace lldb_private
32 
33 #endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDSTOPHOOKINTERFACE_H
34