You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
libcxxabi
libunwind
lld
lldb
cmake
docs
examples
include
lit
lldb.xcodeproj
lldb.xcworkspace
packages
resources
scripts
source
API
Breakpoint
Commands
Core
DataFormatters
Expression
Host
Initialization
Interpreter
Plugins
ABI
Architecture
Disassembler
DynamicLoader
ExpressionParser
Instruction
InstrumentationRuntime
JITLoader
Language
LanguageRuntime
MemoryHistory
ObjectContainer
ObjectFile
OperatingSystem
Platform
Process
Darwin
FreeBSD
Linux
MacOSX-Kernel
NetBSD
CMakeLists.txt
NativeProcessNetBSD.cpp
NativeProcessNetBSD.h
NativeRegisterContextNetBSD.cpp
NativeRegisterContextNetBSD.h
NativeRegisterContextNetBSD_x86_64.cpp
NativeRegisterContextNetBSD_x86_64.h
NativeThreadNetBSD.cpp
NativeThreadNetBSD.h
POSIX
Utility
Windows
elf-core
gdb-remote
mach-core
minidump
CMakeLists.txt
ScriptInterpreter
StructuredData
SymbolFile
SymbolVendor
SystemRuntime
UnwindAssembly
CMakeLists.txt
Symbol
Target
Utility
CMakeLists.txt
lldb.cpp
third_party
tools
unittests
utils
www
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
CODE_OWNERS.txt
INSTALL.txt
LICENSE.TXT
use_lldb_suite_root.py
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
141 lines
5.0 KiB
C
141 lines
5.0 KiB
C
![]() |
//===-- NativeProcessNetBSD.h --------------------------------- -*- C++ -*-===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#ifndef liblldb_NativeProcessNetBSD_H_
|
||
|
#define liblldb_NativeProcessNetBSD_H_
|
||
|
|
||
|
#include "lldb/Target/MemoryRegionInfo.h"
|
||
|
#include "lldb/Utility/ArchSpec.h"
|
||
|
#include "lldb/Utility/FileSpec.h"
|
||
|
|
||
|
#include "NativeThreadNetBSD.h"
|
||
|
#include "lldb/Host/common/NativeProcessProtocol.h"
|
||
|
|
||
|
namespace lldb_private {
|
||
|
namespace process_netbsd {
|
||
|
/// @class NativeProcessNetBSD
|
||
|
/// @brief Manages communication with the inferior (debugee) process.
|
||
|
///
|
||
|
/// Upon construction, this class prepares and launches an inferior process for
|
||
|
/// debugging.
|
||
|
///
|
||
|
/// Changes in the inferior process state are broadcasted.
|
||
|
class NativeProcessNetBSD : public NativeProcessProtocol {
|
||
|
public:
|
||
|
class Factory : public NativeProcessProtocol::Factory {
|
||
|
public:
|
||
|
llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
|
||
|
Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate,
|
||
|
MainLoop &mainloop) const override;
|
||
|
|
||
|
llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
|
||
|
Attach(lldb::pid_t pid, NativeDelegate &native_delegate,
|
||
|
MainLoop &mainloop) const override;
|
||
|
};
|
||
|
|
||
|
// ---------------------------------------------------------------------
|
||
|
// NativeProcessProtocol Interface
|
||
|
// ---------------------------------------------------------------------
|
||
|
Status Resume(const ResumeActionList &resume_actions) override;
|
||
|
|
||
|
Status Halt() override;
|
||
|
|
||
|
Status Detach() override;
|
||
|
|
||
|
Status Signal(int signo) override;
|
||
|
|
||
|
Status Kill() override;
|
||
|
|
||
|
Status GetMemoryRegionInfo(lldb::addr_t load_addr,
|
||
|
MemoryRegionInfo &range_info) override;
|
||
|
|
||
|
Status ReadMemory(lldb::addr_t addr, void *buf, size_t size,
|
||
|
size_t &bytes_read) override;
|
||
|
|
||
|
Status ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size,
|
||
|
size_t &bytes_read) override;
|
||
|
|
||
|
Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size,
|
||
|
size_t &bytes_written) override;
|
||
|
|
||
|
Status AllocateMemory(size_t size, uint32_t permissions,
|
||
|
lldb::addr_t &addr) override;
|
||
|
|
||
|
Status DeallocateMemory(lldb::addr_t addr) override;
|
||
|
|
||
|
lldb::addr_t GetSharedLibraryInfoAddress() override;
|
||
|
|
||
|
size_t UpdateThreads() override;
|
||
|
|
||
|
const ArchSpec &GetArchitecture() const override { return m_arch; }
|
||
|
|
||
|
Status SetBreakpoint(lldb::addr_t addr, uint32_t size,
|
||
|
bool hardware) override;
|
||
|
|
||
|
Status GetLoadedModuleFileSpec(const char *module_path,
|
||
|
FileSpec &file_spec) override;
|
||
|
|
||
|
Status GetFileLoadAddress(const llvm::StringRef &file_name,
|
||
|
lldb::addr_t &load_addr) override;
|
||
|
|
||
|
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
|
||
|
GetAuxvData() const override;
|
||
|
|
||
|
// ---------------------------------------------------------------------
|
||
|
// Interface used by NativeRegisterContext-derived classes.
|
||
|
// ---------------------------------------------------------------------
|
||
|
static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr,
|
||
|
int data = 0, int *result = nullptr);
|
||
|
|
||
|
protected:
|
||
|
// ---------------------------------------------------------------------
|
||
|
// NativeProcessProtocol protected interface
|
||
|
// ---------------------------------------------------------------------
|
||
|
|
||
|
Status
|
||
|
GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint,
|
||
|
size_t &actual_opcode_size,
|
||
|
const uint8_t *&trap_opcode_bytes) override;
|
||
|
|
||
|
private:
|
||
|
MainLoop::SignalHandleUP m_sigchld_handle;
|
||
|
ArchSpec m_arch;
|
||
|
LazyBool m_supports_mem_region = eLazyBoolCalculate;
|
||
|
std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache;
|
||
|
|
||
|
// ---------------------------------------------------------------------
|
||
|
// Private Instance Methods
|
||
|
// ---------------------------------------------------------------------
|
||
|
NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate,
|
||
|
const ArchSpec &arch, MainLoop &mainloop);
|
||
|
|
||
|
bool HasThreadNoLock(lldb::tid_t thread_id);
|
||
|
|
||
|
NativeThreadNetBSD &AddThread(lldb::tid_t thread_id);
|
||
|
|
||
|
void MonitorCallback(lldb::pid_t pid, int signal);
|
||
|
void MonitorExited(lldb::pid_t pid, WaitStatus status);
|
||
|
void MonitorSIGSTOP(lldb::pid_t pid);
|
||
|
void MonitorSIGTRAP(lldb::pid_t pid);
|
||
|
void MonitorSignal(lldb::pid_t pid, int signal);
|
||
|
|
||
|
Status GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size);
|
||
|
Status FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread);
|
||
|
Status PopulateMemoryRegionCache();
|
||
|
void SigchldHandler();
|
||
|
|
||
|
Status Attach();
|
||
|
Status ReinitializeThreads();
|
||
|
};
|
||
|
|
||
|
} // namespace process_netbsd
|
||
|
} // namespace lldb_private
|
||
|
|
||
|
#endif // #ifndef liblldb_NativeProcessNetBSD_H_
|