xref: /openbsd-src/gnu/llvm/lldb/source/Plugins/Process/OpenBSDKernel/ProcessOpenBSDKernel.h (revision 7c0ec4b8992567abb1e1536622dc789a9a39d9f1)
1 //===-- ProcessOpenBSDKernel.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_SOURCE_PLUGINS_PROCESS_OPENBSDKERNEL_PROCESSOPENBSDKERNEL_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_OPENBSDKERNEL_PROCESSOPENBSDKERNEL_H
11 
12 #include "lldb/Target/PostMortemProcess.h"
13 
14 class ProcessOpenBSDKernel : public lldb_private::PostMortemProcess {
15 public:
16   ProcessOpenBSDKernel(lldb::TargetSP target_sp, lldb::ListenerSP listener);
17 
18   static lldb::ProcessSP
19   CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener,
20 		 const lldb_private::FileSpec *crash_file_path,
21 		 bool can_connect);
22 
23   static void Initialize();
24 
25   static void Terminate();
26 
27   static llvm::StringRef GetPluginNameStatic() { return "openbsd-kernel"; }
28 
29   static llvm::StringRef GetPluginDescriptionStatic() {
30 	return "OpenBSD kernel vmcore debugging plug-in.";
31   }
32 
33   llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
34 
35   lldb_private::Status DoDestroy() override;
36 
37   bool CanDebug(lldb::TargetSP target_sp,
38 		bool plugin_specified_by_name) override;
39 
40   void RefreshStateAfterStop() override;
41 
42   lldb_private::Status DoLoadCore() override;
43 
44   lldb_private::DynamicLoader *GetDynamicLoader() override;
45 
46   // Process Queries
47   bool WarnBeforeDetach() const override { return false; }
48 
49 protected:
50   bool DoUpdateThreadList(lldb_private::ThreadList &old_thread_list,
51 			  lldb_private::ThreadList &new_thread_list) override;
52 
53   lldb::addr_t FindSymbol(const char* name);
54 };
55 
56 #endif // LLDB_SOURCE_PLUGINS_PROCESS_OPENBSDKERNEL_PROCESSOPENBSDKERNEL_H
57