LLDB mainline
ProcessFreeBSDKernelCore.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_FREEBSDKERNEL_PROCESSFREEBSDKERNELCORE_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_PROCESSFREEBSDKERNELCORE_H
11
12#include "lldb/Core/Debugger.h"
14
15#include <kvm.h>
16
18public:
20 kvm_t *kvm, const lldb_private::FileSpec &core_file);
21
23
24 static lldb::ProcessSP
26 const lldb_private::FileSpec *crash_file_path,
27 bool can_connect);
28
29 static void Initialize();
30
31 static void DebuggerInitialize(lldb_private::Debugger &debugger);
32
33 static void Terminate();
34
35 static llvm::StringRef GetPluginNameStatic() { return "freebsd-kernel-core"; }
36
37 static llvm::StringRef GetPluginDescriptionStatic() {
38 return "FreeBSD kernel core debugging plug-in.";
39 }
40
41 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
42
43 bool CanDebug(lldb::TargetSP target_sp,
44 bool plugin_specified_by_name) override;
45
47
49
51
52 void RefreshStateAfterStop() override;
53
54 size_t DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size,
55 lldb_private::Status &error) override;
56
57protected:
58 bool DoUpdateThreadList(lldb_private::ThreadList &old_thread_list,
59 lldb_private::ThreadList &new_thread_list) override;
60
61 size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
62 lldb_private::Status &error) override;
63
64 lldb::addr_t FindSymbol(const char *name);
65
66private:
67 void PrintUnreadMessage();
68
69 const char *GetError();
70
72
73 kvm_t *m_kvm;
74};
75
76#endif // LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_PROCESSFREEBSDKERNELCORE_H
static llvm::raw_ostream & error(Stream &strm)
lldb_private::Status DoDestroy() override
static llvm::StringRef GetPluginNameStatic()
lldb::addr_t FindSymbol(const char *name)
size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override
Actually do the reading of memory from a process.
static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener, const lldb_private::FileSpec *crash_file_path, bool can_connect)
void RefreshStateAfterStop() override
Currently called as part of ShouldStop.
static void DebuggerInitialize(lldb_private::Debugger &debugger)
static llvm::StringRef GetPluginDescriptionStatic()
lldb_private::Status DoLoadCore() override
lldb_private::DynamicLoader * GetDynamicLoader() override
Get the dynamic loader plug-in for this process.
ProcessFreeBSDKernelCore(lldb::TargetSP target_sp, lldb::ListenerSP listener, kvm_t *kvm, const lldb_private::FileSpec &core_file)
size_t DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size, lldb_private::Status &error) override
Actually do the writing of memory to a process.
bool DoUpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override
Update the thread list following process plug-in's specific logic.
llvm::StringRef GetPluginName() override
bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override
Check if a plug-in instance can debug the file in module.
A class to manage flag bits.
Definition Debugger.h:87
A plug-in interface definition class for dynamic loaders.
A file utility class.
Definition FileSpec.h:57
Base class for all processes that don't represent a live process, such as coredumps or processes trac...
An error handling class.
Definition Status.h:118
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Listener > ListenerSP
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP