Go to the documentation of this file.
10 #include "lldb/Host/Config.h"
14 #include <sys/utsname.h>
31 #define MAP_PRIVATE 0x0002
32 #define MAP_ANON 0x1000
45 LLDB_LOG(log,
"force = {0}, arch=({1}, {2})", force,
46 arch ? arch->GetArchitectureName() :
"<null>",
47 arch ? arch->GetTriple().getTriple() :
"<null>");
50 if (!create && arch && arch->IsValid()) {
51 const llvm::Triple &triple = arch->GetTriple();
52 switch (triple.getOS()) {
53 case llvm::Triple::NetBSD:
62 LLDB_LOG(log,
"create = {0}", create);
69 llvm::StringRef PlatformNetBSD::GetPluginDescriptionStatic(
bool is_host) {
71 return "Local NetBSD user platform plug-in.";
72 return "Remote NetBSD user platform plug-in.";
75 void PlatformNetBSD::Initialize() {
79 #if defined(__NetBSD__)
81 default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
82 Platform::SetHostPlatform(default_platform_sp);
84 PluginManager::RegisterPlugin(
85 PlatformNetBSD::GetPluginNameStatic(
false),
86 PlatformNetBSD::GetPluginDescriptionStatic(
false),
87 PlatformNetBSD::CreateInstance,
nullptr);
91 void PlatformNetBSD::Terminate() {
94 PluginManager::UnregisterPlugin(PlatformNetBSD::CreateInstance);
102 PlatformNetBSD::PlatformNetBSD(
bool is_host)
106 ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);
108 if (hostArch.
GetTriple().isArch64Bit()) {
110 HostInfo::GetArchitecture(HostInfo::eArchKind32));
114 {llvm::Triple::x86_64, llvm::Triple::x86}, llvm::Triple::NetBSD);
118 std::vector<ArchSpec>
128 #if LLDB_ENABLE_POSIX
138 strm.
Printf(
" Kernel: %s\n", un.sysname);
139 strm.
Printf(
" Release: %s\n", un.release);
140 strm.
Printf(
" Version: %s\n", un.version);
165 const char *shell_name = strrchr(shell_string.c_str(),
'/');
166 if (shell_name ==
nullptr)
167 shell_name = shell_string.c_str();
171 if (strcmp(shell_name,
"csh") == 0 || strcmp(shell_name,
"tcsh") == 0 ||
172 strcmp(shell_name,
"zsh") == 0 || strcmp(shell_name,
"sh") == 0) {
195 unsigned prot,
unsigned flags,
197 uint64_t flags_platform = 0;
204 MmapArgList args({addr, length, prot, flags_platform, fd, offset});
210 std::lock_guard<std::mutex> guard(
m_mutex);
212 m_type_system = std::make_shared<TypeSystemClang>(
"siginfo", triple);
268 if (triple.isArch64Bit())
284 {
"_value", sigval_type},
289 union_type,
"_child",
294 {
"_status", int_type},
295 {
"_utime", clock_type},
296 {
"_stime", clock_type},
301 union_type,
"_fault",
304 {
"_addr", voidp_type},
306 {
"_trap2", int_type},
307 {
"_trap3", int_type},
315 {
"_band", long_type},
324 {
"_sysnum", int_type},
326 {
"_error", int_type},
332 union_type,
"_ptrace_state",
335 {
"_pe_report_event", int_type},
336 {
"_option", ptrace_option_type},
llvm::SmallVector< lldb::addr_t, 6 > MmapArgList
bool Test(ValueType bit) const
Test a single flag bit.
llvm::Triple & GetTriple()
Architecture triple accessor.
CompilerType CreateStructForIdentifier(ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
string(SUBSTRING ${p} 10 -1 pStripped) if($
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
const FileSpec & GetShell() const
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
CompilerType CreateRecordType(clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, llvm::StringRef name, int kind, lldb::LanguageType language, ClangASTMetadata *metadata=nullptr, bool exports_symbols=false)
Generic representation of a type in a programming language.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
static bool StartTagDeclarationDefinition(const CompilerType &type)
@ eLanguageTypeC
Non-standardized C, such as K&R.
A class that represents a running process on the host machine.
CompilerType GetBasicType(lldb::BasicType type)
A TypeSystem implementation based on Clang.
#define LLDB_PLUGIN_DEFINE(PluginName)
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
CompilerType GetArrayType(uint64_t size) const