LLDB  mainline
PlatformLinux.cpp
Go to the documentation of this file.
1 //===-- PlatformLinux.cpp -------------------------------------------------===//
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 #include "PlatformLinux.h"
10 #include "lldb/Host/Config.h"
11 
12 #include <cstdio>
13 #if LLDB_ENABLE_POSIX
14 #include <sys/utsname.h>
15 #endif
16 
18 #include "lldb/Core/Debugger.h"
20 #include "lldb/Host/HostInfo.h"
21 #include "lldb/Symbol/UnwindPlan.h"
22 #include "lldb/Target/Process.h"
23 #include "lldb/Target/Target.h"
24 #include "lldb/Utility/FileSpec.h"
25 #include "lldb/Utility/LLDBLog.h"
26 #include "lldb/Utility/Log.h"
27 #include "lldb/Utility/State.h"
28 #include "lldb/Utility/Status.h"
30 
31 // Define these constants from Linux mman.h for use when targeting remote linux
32 // systems even when host has different values.
33 #define MAP_PRIVATE 2
34 #define MAP_ANON 0x20
35 
36 using namespace lldb;
37 using namespace lldb_private;
38 using namespace lldb_private::platform_linux;
39 
41 
43 
44 
45 PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) {
46  Log *log = GetLog(LLDBLog::Platform);
47  LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force,
48  arch ? arch->GetArchitectureName() : "<null>",
49  arch ? arch->GetTriple().getTriple() : "<null>");
50 
51  bool create = force;
52  if (!create && arch && arch->IsValid()) {
53  const llvm::Triple &triple = arch->GetTriple();
54  switch (triple.getOS()) {
55  case llvm::Triple::Linux:
56  create = true;
57  break;
58 
59 #if defined(__linux__)
60  // Only accept "unknown" for the OS if the host is linux and it "unknown"
61  // wasn't specified (it was just returned because it was NOT specified)
62  case llvm::Triple::OSType::UnknownOS:
63  create = !arch->TripleOSWasSpecified();
64  break;
65 #endif
66  default:
67  break;
68  }
69  }
70 
71  LLDB_LOG(log, "create = {0}", create);
72  if (create) {
73  return PlatformSP(new PlatformLinux(false));
74  }
75  return PlatformSP();
76 }
77 
78 llvm::StringRef PlatformLinux::GetPluginDescriptionStatic(bool is_host) {
79  if (is_host)
80  return "Local Linux user platform plug-in.";
81  return "Remote Linux user platform plug-in.";
82 }
83 
84 void PlatformLinux::Initialize() {
86 
87  if (g_initialize_count++ == 0) {
88 #if defined(__linux__) && !defined(__ANDROID__)
89  PlatformSP default_platform_sp(new PlatformLinux(true));
90  default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
91  Platform::SetHostPlatform(default_platform_sp);
92 #endif
93  PluginManager::RegisterPlugin(
94  PlatformLinux::GetPluginNameStatic(false),
95  PlatformLinux::GetPluginDescriptionStatic(false),
96  PlatformLinux::CreateInstance, nullptr);
97  }
98 }
99 
100 void PlatformLinux::Terminate() {
101  if (g_initialize_count > 0) {
102  if (--g_initialize_count == 0) {
103  PluginManager::UnregisterPlugin(PlatformLinux::CreateInstance);
104  }
105  }
106 
108 }
109 
110 /// Default Constructor
111 PlatformLinux::PlatformLinux(bool is_host)
112  : PlatformPOSIX(is_host) // This is the local host platform
113 {
114  if (is_host) {
115  ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);
116  m_supported_architectures.push_back(hostArch);
117  if (hostArch.GetTriple().isArch64Bit()) {
118  m_supported_architectures.push_back(
119  HostInfo::GetArchitecture(HostInfo::eArchKind32));
120  }
121  } else {
123  {llvm::Triple::x86_64, llvm::Triple::x86, llvm::Triple::arm,
124  llvm::Triple::aarch64, llvm::Triple::mips64, llvm::Triple::mips64,
125  llvm::Triple::hexagon, llvm::Triple::mips, llvm::Triple::mips64el,
126  llvm::Triple::mipsel, llvm::Triple::systemz},
127  llvm::Triple::Linux);
128  }
129 }
130 
131 std::vector<ArchSpec>
134  return m_remote_platform_sp->GetSupportedArchitectures(process_host_arch);
136 }
137 
139  Platform::GetStatus(strm);
140 
141 #if LLDB_ENABLE_POSIX
142  // Display local kernel information only when we are running in host mode.
143  // Otherwise, we would end up printing non-Linux information (when running on
144  // Mac OS for example).
145  if (IsHost()) {
146  struct utsname un;
147 
148  if (uname(&un))
149  return;
150 
151  strm.Printf(" Kernel: %s\n", un.sysname);
152  strm.Printf(" Release: %s\n", un.release);
153  strm.Printf(" Version: %s\n", un.version);
154  }
155 #endif
156 }
157 
158 uint32_t
160  uint32_t resume_count = 0;
161 
162  // Always resume past the initial stop when we use eLaunchFlagDebug
163  if (launch_info.GetFlags().Test(eLaunchFlagDebug)) {
164  // Resume past the stop for the final exec into the true inferior.
165  ++resume_count;
166  }
167 
168  // If we're not launching a shell, we're done.
169  const FileSpec &shell = launch_info.GetShell();
170  if (!shell)
171  return resume_count;
172 
173  std::string shell_string = shell.GetPath();
174  // We're in a shell, so for sure we have to resume past the shell exec.
175  ++resume_count;
176 
177  // Figure out what shell we're planning on using.
178  const char *shell_name = strrchr(shell_string.c_str(), '/');
179  if (shell_name == nullptr)
180  shell_name = shell_string.c_str();
181  else
182  shell_name++;
183 
184  if (strcmp(shell_name, "csh") == 0 || strcmp(shell_name, "tcsh") == 0 ||
185  strcmp(shell_name, "zsh") == 0 || strcmp(shell_name, "sh") == 0) {
186  // These shells seem to re-exec themselves. Add another resume.
187  ++resume_count;
188  }
189 
190  return resume_count;
191 }
192 
194  if (IsHost()) {
195  return true;
196  } else {
197  // If we're connected, we can debug.
198  return IsConnected();
199  }
200 }
201 
203  m_trap_handlers.push_back(ConstString("_sigtramp"));
204  m_trap_handlers.push_back(ConstString("__kernel_rt_sigreturn"));
205  m_trap_handlers.push_back(ConstString("__restore_rt"));
206 }
207 
208 static lldb::UnwindPlanSP GetAArch64TrapHanlderUnwindPlan(ConstString name) {
209  UnwindPlanSP unwind_plan_sp;
210  if (name != "__kernel_rt_sigreturn")
211  return unwind_plan_sp;
212 
213  UnwindPlan::RowSP row = std::make_shared<UnwindPlan::Row>();
214  row->SetOffset(0);
215 
216  // In the signal trampoline frame, sp points to an rt_sigframe[1], which is:
217  // - 128-byte siginfo struct
218  // - ucontext struct:
219  // - 8-byte long (uc_flags)
220  // - 8-byte pointer (uc_link)
221  // - 24-byte stack_t
222  // - 128-byte signal set
223  // - 8 bytes of padding because sigcontext has 16-byte alignment
224  // - sigcontext/mcontext_t
225  // [1]
226  // https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/signal.c
227  int32_t offset = 128 + 8 + 8 + 24 + 128 + 8;
228  // Then sigcontext[2] is:
229  // - 8 byte fault address
230  // - 31 8 byte registers
231  // - 8 byte sp
232  // - 8 byte pc
233  // [2]
234  // https://github.com/torvalds/linux/blob/master/arch/arm64/include/uapi/asm/sigcontext.h
235 
236  // Skip fault address
237  offset += 8;
238  row->GetCFAValue().SetIsRegisterPlusOffset(arm64_dwarf::sp, offset);
239 
240  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x0, 0 * 8, false);
241  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x1, 1 * 8, false);
242  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x2, 2 * 8, false);
243  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x3, 3 * 8, false);
244  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x4, 4 * 8, false);
245  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x5, 5 * 8, false);
246  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x6, 6 * 8, false);
247  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x7, 7 * 8, false);
248  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x8, 8 * 8, false);
249  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x9, 9 * 8, false);
250  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x10, 10 * 8, false);
251  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x11, 11 * 8, false);
252  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x12, 12 * 8, false);
253  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x13, 13 * 8, false);
254  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x14, 14 * 8, false);
255  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x15, 15 * 8, false);
256  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x16, 16 * 8, false);
257  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x17, 17 * 8, false);
258  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x18, 18 * 8, false);
259  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x19, 19 * 8, false);
260  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x20, 20 * 8, false);
261  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x21, 21 * 8, false);
262  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x22, 22 * 8, false);
263  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x23, 23 * 8, false);
264  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x24, 24 * 8, false);
265  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x25, 25 * 8, false);
266  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x26, 26 * 8, false);
267  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x27, 27 * 8, false);
268  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x28, 28 * 8, false);
269  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::fp, 29 * 8, false);
270  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::x30, 30 * 8, false);
271  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::sp, 31 * 8, false);
272  row->SetRegisterLocationToAtCFAPlusOffset(arm64_dwarf::pc, 32 * 8, false);
273 
274  // The sigcontext may also contain floating point and SVE registers.
275  // However this would require a dynamic unwind plan so they are not included
276  // here.
277 
278  unwind_plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
279  unwind_plan_sp->AppendRow(row);
280  unwind_plan_sp->SetSourceName("AArch64 Linux sigcontext");
281  unwind_plan_sp->SetSourcedFromCompiler(eLazyBoolYes);
282  // Because sp is the same throughout the function
283  unwind_plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolYes);
284  unwind_plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolYes);
285 
286  return unwind_plan_sp;
287 }
288 
289 lldb::UnwindPlanSP
290 PlatformLinux::GetTrapHandlerUnwindPlan(const llvm::Triple &triple,
291  ConstString name) {
292  if (triple.isAArch64())
293  return GetAArch64TrapHanlderUnwindPlan(name);
294 
295  return {};
296 }
297 
299  addr_t addr, addr_t length,
300  unsigned prot, unsigned flags,
301  addr_t fd, addr_t offset) {
302  uint64_t flags_platform = 0;
303  uint64_t map_anon = arch.IsMIPS() ? 0x800 : MAP_ANON;
304 
305  if (flags & eMmapFlagsPrivate)
306  flags_platform |= MAP_PRIVATE;
307  if (flags & eMmapFlagsAnon)
308  flags_platform |= map_anon;
309 
310  MmapArgList args({addr, length, prot, flags_platform, fd, offset});
311  return args;
312 }
313 
314 CompilerType PlatformLinux::GetSiginfoType(const llvm::Triple &triple) {
315  if (!m_type_system_up)
316  m_type_system_up.reset(new TypeSystemClang("siginfo", triple));
317  TypeSystemClang *ast = m_type_system_up.get();
318 
319  bool si_errno_then_code = true;
320 
321  switch (triple.getArch()) {
322  case llvm::Triple::mips:
323  case llvm::Triple::mipsel:
324  case llvm::Triple::mips64:
325  case llvm::Triple::mips64el:
326  // mips has si_code and si_errno swapped
327  si_errno_then_code = false;
328  break;
329  default:
330  break;
331  }
332 
333  // generic types
334  CompilerType int_type = ast->GetBasicType(eBasicTypeInt);
336  CompilerType short_type = ast->GetBasicType(eBasicTypeShort);
337  CompilerType long_type = ast->GetBasicType(eBasicTypeLong);
339 
340  // platform-specific types
341  CompilerType &pid_type = int_type;
342  CompilerType &uid_type = uint_type;
343  CompilerType &clock_type = long_type;
344  CompilerType &band_type = long_type;
345 
346  CompilerType sigval_type = ast->CreateRecordType(
347  nullptr, OptionalClangModuleID(), lldb::eAccessPublic, "__lldb_sigval_t",
348  clang::TTK_Union, lldb::eLanguageTypeC);
349  ast->StartTagDeclarationDefinition(sigval_type);
350  ast->AddFieldToRecordType(sigval_type, "sival_int", int_type,
352  ast->AddFieldToRecordType(sigval_type, "sival_ptr", voidp_type,
354  ast->CompleteTagDeclarationDefinition(sigval_type);
355 
356  CompilerType sigfault_bounds_type = ast->CreateRecordType(
358  clang::TTK_Union, lldb::eLanguageTypeC);
359  ast->StartTagDeclarationDefinition(sigfault_bounds_type);
360  ast->AddFieldToRecordType(sigfault_bounds_type, "_addr_bnd",
362  {
363  {"_lower", voidp_type},
364  {"_upper", voidp_type},
365  }),
367  ast->AddFieldToRecordType(sigfault_bounds_type, "_pkey", uint_type,
369  ast->CompleteTagDeclarationDefinition(sigfault_bounds_type);
370 
371  // siginfo_t
372  CompilerType siginfo_type = ast->CreateRecordType(
373  nullptr, OptionalClangModuleID(), lldb::eAccessPublic, "__lldb_siginfo_t",
374  clang::TTK_Struct, lldb::eLanguageTypeC);
375  ast->StartTagDeclarationDefinition(siginfo_type);
376  ast->AddFieldToRecordType(siginfo_type, "si_signo", int_type,
378 
379  if (si_errno_then_code) {
380  ast->AddFieldToRecordType(siginfo_type, "si_errno", int_type,
382  ast->AddFieldToRecordType(siginfo_type, "si_code", int_type,
384  } else {
385  ast->AddFieldToRecordType(siginfo_type, "si_code", int_type,
387  ast->AddFieldToRecordType(siginfo_type, "si_errno", int_type,
389  }
390 
391  // the structure is padded on 64-bit arches to fix alignment
392  if (triple.isArch64Bit())
393  ast->AddFieldToRecordType(siginfo_type, "__pad0", int_type,
395 
396  // union used to hold the signal data
397  CompilerType union_type = ast->CreateRecordType(
399  clang::TTK_Union, lldb::eLanguageTypeC);
400  ast->StartTagDeclarationDefinition(union_type);
401 
403  union_type, "_kill",
405  {
406  {"si_pid", pid_type},
407  {"si_uid", uid_type},
408  }),
410 
412  union_type, "_timer",
414  {
415  {"si_tid", int_type},
416  {"si_overrun", int_type},
417  {"si_sigval", sigval_type},
418  }),
420 
422  union_type, "_rt",
424  {
425  {"si_pid", pid_type},
426  {"si_uid", uid_type},
427  {"si_sigval", sigval_type},
428  }),
430 
432  union_type, "_sigchld",
434  {
435  {"si_pid", pid_type},
436  {"si_uid", uid_type},
437  {"si_status", int_type},
438  {"si_utime", clock_type},
439  {"si_stime", clock_type},
440  }),
442 
444  union_type, "_sigfault",
446  {
447  {"si_addr", voidp_type},
448  {"si_addr_lsb", short_type},
449  {"_bounds", sigfault_bounds_type},
450  }),
452 
454  union_type, "_sigpoll",
456  {
457  {"si_band", band_type},
458  {"si_fd", int_type},
459  }),
461 
462  // NB: SIGSYS is not present on ia64 but we don't seem to support that
464  union_type, "_sigsys",
466  {
467  {"_call_addr", voidp_type},
468  {"_syscall", int_type},
469  {"_arch", uint_type},
470  }),
472 
473  ast->CompleteTagDeclarationDefinition(union_type);
474  ast->AddFieldToRecordType(siginfo_type, "_sifields", union_type,
476 
477  ast->CompleteTagDeclarationDefinition(siginfo_type);
478  return siginfo_type;
479 }
lldb_private::RemoteAwarePlatform::IsConnected
bool IsConnected() const override
Definition: RemoteAwarePlatform.cpp:344
arm64_dwarf::x5
@ x5
Definition: ARM64_DWARF_Registers.h:22
arm64_dwarf::x4
@ x4
Definition: ARM64_DWARF_Registers.h:21
arm64_dwarf::x6
@ x6
Definition: ARM64_DWARF_Registers.h:23
arm64_dwarf::x16
@ x16
Definition: ARM64_DWARF_Registers.h:33
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::ArchSpec::IsMIPS
bool IsMIPS() const
if MIPS architecture return true.
Definition: ArchSpec.cpp:546
lldb_private::MmapArgList
llvm::SmallVector< lldb::addr_t, 6 > MmapArgList
Definition: Platform.h:58
MAP_ANON
#define MAP_ANON
Definition: PlatformLinux.cpp:34
lldb::eRegisterKindDWARF
@ eRegisterKindDWARF
the register numbers seen DWARF
Definition: lldb-enumerations.h:229
lldb_private::platform_linux::PlatformLinux::m_type_system_up
std::unique_ptr< TypeSystemClang > m_type_system_up
Definition: PlatformLinux.h:68
arm64_dwarf::x18
@ x18
Definition: ARM64_DWARF_Registers.h:35
lldb_private::platform_linux::PlatformLinux::GetStatus
void GetStatus(Stream &strm) override
Report the current status for this platform.
Definition: PlatformLinux.cpp:138
arm64_dwarf::x12
@ x12
Definition: ARM64_DWARF_Registers.h:29
arm64_dwarf::sp
@ sp
Definition: ARM64_DWARF_Registers.h:51
lldb_private::platform_linux::PlatformLinux::CalculateTrapHandlerSymbolNames
void CalculateTrapHandlerSymbolNames() override
Ask the Platform subclass to fill in the list of trap handler names.
Definition: PlatformLinux.cpp:202
arm64_dwarf::x22
@ x22
Definition: ARM64_DWARF_Registers.h:39
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
arm64_dwarf::x0
@ x0
Definition: ARM64_DWARF_Registers.h:17
lldb_private::Platform::m_trap_handlers
std::vector< ConstString > m_trap_handlers
Definition: Platform.h:897
lldb_private::Flags::Test
bool Test(ValueType bit) const
Test a single flag bit.
Definition: Flags.h:96
lldb_private::ProcessLaunchInfo::GetFlags
Flags & GetFlags()
Definition: ProcessLaunchInfo.h:64
arm64_dwarf::x3
@ x3
Definition: ARM64_DWARF_Registers.h:20
lldb_private::Stream
Definition: Stream.h:28
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:455
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
arm64_dwarf::x21
@ x21
Definition: ARM64_DWARF_Registers.h:38
Debugger.h
lldb_private::platform_linux::PlatformLinux::GetSiginfoType
CompilerType GetSiginfoType(const llvm::Triple &triple) override
Definition: PlatformLinux.cpp:314
arm64_dwarf::x27
@ x27
Definition: ARM64_DWARF_Registers.h:44
arm64_dwarf::x19
@ x19
Definition: ARM64_DWARF_Registers.h:36
lldb::eBasicTypeShort
@ eBasicTypeShort
Definition: lldb-enumerations.h:761
Process.h
arm64_dwarf::x28
@ x28
Definition: ARM64_DWARF_Registers.h:45
Target.h
lldb_private::TypeSystemClang::CreateStructForIdentifier
CompilerType CreateStructForIdentifier(ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
Definition: TypeSystemClang.cpp:2269
arm64_dwarf::fp
@ fp
Definition: ARM64_DWARF_Registers.h:47
lldb_private::FileSpec
Definition: FileSpec.h:56
PlatformPOSIX
Definition: PlatformPOSIX.h:18
arm64_dwarf::x17
@ x17
Definition: ARM64_DWARF_Registers.h:34
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
Log.h
lldb_private::TypeSystemClang::AddFieldToRecordType
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
Definition: TypeSystemClang.cpp:7274
GetAArch64TrapHanlderUnwindPlan
static lldb::UnwindPlanSP GetAArch64TrapHanlderUnwindPlan(ConstString name)
Definition: PlatformLinux.cpp:208
lldb_private::RemoteAwarePlatform::m_remote_platform_sp
lldb::PlatformSP m_remote_platform_sp
Definition: RemoteAwarePlatform.h:104
StreamString.h
lldb::eBasicTypeInt
@ eBasicTypeInt
Definition: lldb-enumerations.h:763
arm64_dwarf::x9
@ x9
Definition: ARM64_DWARF_Registers.h:26
arm64_dwarf::x23
@ x23
Definition: ARM64_DWARF_Registers.h:40
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo
uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override
Definition: PlatformLinux.cpp:159
lldb_private::Platform::Terminate
static void Terminate()
Definition: Platform.cpp:140
lldb_private::platform_linux::PlatformLinux::GetSupportedArchitectures
std::vector< ArchSpec > GetSupportedArchitectures(const ArchSpec &process_host_arch) override
Get the platform's supported architectures in the order in which they should be searched.
Definition: PlatformLinux.cpp:132
lldb::eBasicTypeVoid
@ eBasicTypeVoid
Definition: lldb-enumerations.h:751
HostInfo.h
lldb_private::platform_linux::PlatformLinux
Definition: PlatformLinux.h:18
MAP_PRIVATE
#define MAP_PRIVATE
Definition: PlatformLinux.cpp:33
arm64_dwarf::x26
@ x26
Definition: ARM64_DWARF_Registers.h:43
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::eBasicTypeLong
@ eBasicTypeLong
Definition: lldb-enumerations.h:765
lldb_private::Platform::Initialize
static void Initialize()
Definition: Platform.cpp:138
arm64_dwarf::x15
@ x15
Definition: ARM64_DWARF_Registers.h:32
UnwindPlan.h
arm64_dwarf::x30
@ x30
Definition: ARM64_DWARF_Registers.h:48
arm64_dwarf::x8
@ x8
Definition: ARM64_DWARF_Registers.h:25
ARM64_DWARF_Registers.h
PlatformLinux.h
lldb::eBasicTypeUnsignedInt
@ eBasicTypeUnsignedInt
Definition: lldb-enumerations.h:764
lldb_private::UnwindPlan::RowSP
std::shared_ptr< Row > RowSP
Definition: UnwindPlan.h:395
lldb::eAccessPublic
@ eAccessPublic
Definition: lldb-enumerations.h:509
lldb_private::platform_linux::PlatformLinux::GetMmapArgumentList
MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr, lldb::addr_t length, unsigned prot, unsigned flags, lldb::addr_t fd, lldb::addr_t offset) override
Definition: PlatformLinux.cpp:298
arm64_dwarf::x24
@ x24
Definition: ARM64_DWARF_Registers.h:41
lldb_private::CompilerType::GetPointerType
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
Definition: CompilerType.cpp:407
lldb_private::OptionalClangModuleID
A Clang module ID.
Definition: TypeSystemClang.h:56
uint32_t
arm64_dwarf::x7
@ x7
Definition: ARM64_DWARF_Registers.h:24
lldb_private::platform_linux::PlatformLinux::CanDebugProcess
bool CanDebugProcess() override
Not all platforms will support debugging a process by spawning somehow halted for a debugger (specifi...
Definition: PlatformLinux.cpp:193
arm64_dwarf::x25
@ x25
Definition: ARM64_DWARF_Registers.h:42
lldb_private::platform_linux::PlatformLinux::m_supported_architectures
std::vector< ArchSpec > m_supported_architectures
Definition: PlatformLinux.h:65
arm64_dwarf::x20
@ x20
Definition: ARM64_DWARF_Registers.h:37
lldb_private::ProcessLaunchInfo::GetShell
const FileSpec & GetShell() const
Definition: ProcessLaunchInfo.cpp:139
arm64_dwarf::x11
@ x11
Definition: ARM64_DWARF_Registers.h:28
PluginManager.h
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:336
lldb_private::TypeSystemClang::CreateRecordType
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)
Definition: TypeSystemClang.cpp:1270
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
Status.h
lldb_private::TypeSystemClang::StartTagDeclarationDefinition
static bool StartTagDeclarationDefinition(const CompilerType &type)
Definition: TypeSystemClang.cpp:8221
arm64_dwarf::pc
@ pc
Definition: ARM64_DWARF_Registers.h:52
lldb::eLanguageTypeC
@ eLanguageTypeC
Non-standardized C, such as K&R.
Definition: lldb-enumerations.h:439
lldb_private::Platform::CreateArchList
static std::vector< ArchSpec > CreateArchList(llvm::ArrayRef< llvm::Triple::ArchType > archs, llvm::Triple::OSType os)
Create a list of ArchSpecs with the given OS and a architectures.
Definition: Platform.cpp:1142
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::eMmapFlagsAnon
@ eMmapFlagsAnon
Definition: Platform.h:40
g_initialize_count
static uint32_t g_initialize_count
Definition: PlatformLinux.cpp:42
lldb_private::TypeSystemClang::GetBasicType
CompilerType GetBasicType(lldb::BasicType type)
Definition: TypeSystemClang.cpp:930
FileSpec.h
lldb_private::TypeSystemClang
A TypeSystem implementation based on Clang.
Definition: TypeSystemClang.h:105
State.h
arm64_dwarf::x2
@ x2
Definition: ARM64_DWARF_Registers.h:19
lldb_private::Platform::GetStatus
virtual void GetStatus(Stream &strm)
Report the current status for this platform.
Definition: Platform.cpp:285
LLDB_PLUGIN_DEFINE
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
arm64_dwarf::x13
@ x13
Definition: ARM64_DWARF_Registers.h:30
lldb_private::Log
Definition: Log.h:115
lldb_private::Platform::IsHost
bool IsHost() const
Definition: Platform.h:420
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:308
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:347
lldb_private::eMmapFlagsPrivate
@ eMmapFlagsPrivate
Definition: Platform.h:40
arm64_dwarf::x10
@ x10
Definition: ARM64_DWARF_Registers.h:27
lldb_private::TypeSystemClang::CompleteTagDeclarationDefinition
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
Definition: TypeSystemClang.cpp:8246
lldb
Definition: SBAddress.h:15
lldb_private::platform_linux::PlatformLinux::GetTrapHandlerUnwindPlan
lldb::UnwindPlanSP GetTrapHandlerUnwindPlan(const llvm::Triple &triple, ConstString name) override
Try to get a specific unwind plan for a named trap handler.
Definition: PlatformLinux.cpp:290
arm64_dwarf::x1
@ x1
Definition: ARM64_DWARF_Registers.h:18
LLDBLog.h
lldb_private::platform_linux
Definition: PlatformLinux.h:16
arm64_dwarf::x14
@ x14
Definition: ARM64_DWARF_Registers.h:31