LLDB  mainline
ItaniumABILanguageRuntime.cpp
Go to the documentation of this file.
1 //===-- ItaniumABILanguageRuntime.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 
10 
13 #include "lldb/Core/Mangled.h"
14 #include "lldb/Core/Module.h"
16 #include "lldb/Core/ValueObject.h"
24 #include "lldb/Symbol/Symbol.h"
25 #include "lldb/Symbol/SymbolFile.h"
26 #include "lldb/Symbol/TypeList.h"
27 #include "lldb/Target/Process.h"
30 #include "lldb/Target/StopInfo.h"
31 #include "lldb/Target/Target.h"
32 #include "lldb/Target/Thread.h"
34 #include "lldb/Utility/Log.h"
35 #include "lldb/Utility/Scalar.h"
36 #include "lldb/Utility/Status.h"
37 
38 #include <vector>
39 
40 using namespace lldb;
41 using namespace lldb_private;
42 
44 
45 static const char *vtable_demangled_prefix = "vtable for ";
46 
48 
49 bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
50  const bool check_cxx = true;
51  const bool check_objc = false;
52  return in_value.GetCompilerType().IsPossibleDynamicType(nullptr, check_cxx,
53  check_objc);
54 }
55 
56 TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
57  ValueObject &in_value, lldb::addr_t original_ptr,
58  lldb::addr_t vtable_load_addr) {
59  if (m_process && vtable_load_addr != LLDB_INVALID_ADDRESS) {
60  // Find the symbol that contains the "vtable_load_addr" address
61  Address vtable_addr;
62  Target &target = m_process->GetTarget();
63  if (!target.GetSectionLoadList().IsEmpty()) {
64  if (target.GetSectionLoadList().ResolveLoadAddress(vtable_load_addr,
65  vtable_addr)) {
66  // See if we have cached info for this type already
67  TypeAndOrName type_info = GetDynamicTypeInfo(vtable_addr);
68  if (type_info)
69  return type_info;
70 
71  SymbolContext sc;
73  vtable_addr, eSymbolContextSymbol, sc);
74  Symbol *symbol = sc.symbol;
75  if (symbol != nullptr) {
76  const char *name =
77  symbol->GetMangled().GetDemangledName().AsCString();
78  if (name && strstr(name, vtable_demangled_prefix) == name) {
79  Log *log(
81  LLDB_LOGF(log,
82  "0x%16.16" PRIx64
83  ": static-type = '%s' has vtable symbol '%s'\n",
84  original_ptr, in_value.GetTypeName().GetCString(), name);
85  // We are a C++ class, that's good. Get the class name and look it
86  // up:
87  const char *class_name = name + strlen(vtable_demangled_prefix);
88  // We know the class name is absolute, so tell FindTypes that by
89  // prefixing it with the root namespace:
90  std::string lookup_name("::");
91  lookup_name.append(class_name);
92 
93  type_info.SetName(class_name);
94  const bool exact_match = true;
95  TypeList class_types;
96 
97  // First look in the module that the vtable symbol came from and
98  // look for a single exact match.
99  llvm::DenseSet<SymbolFile *> searched_symbol_files;
100  if (sc.module_sp)
101  sc.module_sp->FindTypes(ConstString(lookup_name), exact_match, 1,
102  searched_symbol_files, class_types);
103 
104  // If we didn't find a symbol, then move on to the entire module
105  // list in the target and get as many unique matches as possible
106  if (class_types.Empty())
107  target.GetImages().FindTypes(nullptr, ConstString(lookup_name),
108  exact_match, UINT32_MAX,
109  searched_symbol_files, class_types);
110 
111  lldb::TypeSP type_sp;
112  if (class_types.Empty()) {
113  LLDB_LOGF(log, "0x%16.16" PRIx64 ": is not dynamic\n",
114  original_ptr);
115  return TypeAndOrName();
116  }
117  if (class_types.GetSize() == 1) {
118  type_sp = class_types.GetTypeAtIndex(0);
119  if (type_sp) {
120  if (TypeSystemClang::IsCXXClassType(
121  type_sp->GetForwardCompilerType())) {
122  LLDB_LOGF(
123  log,
124  "0x%16.16" PRIx64
125  ": static-type = '%s' has dynamic type: uid={0x%" PRIx64
126  "}, type-name='%s'\n",
127  original_ptr, in_value.GetTypeName().AsCString(),
128  type_sp->GetID(), type_sp->GetName().GetCString());
129  type_info.SetTypeSP(type_sp);
130  }
131  }
132  } else {
133  size_t i;
134  if (log) {
135  for (i = 0; i < class_types.GetSize(); i++) {
136  type_sp = class_types.GetTypeAtIndex(i);
137  if (type_sp) {
138  LLDB_LOGF(
139  log,
140  "0x%16.16" PRIx64
141  ": static-type = '%s' has multiple matching dynamic "
142  "types: uid={0x%" PRIx64 "}, type-name='%s'\n",
143  original_ptr, in_value.GetTypeName().AsCString(),
144  type_sp->GetID(), type_sp->GetName().GetCString());
145  }
146  }
147  }
148 
149  for (i = 0; i < class_types.GetSize(); i++) {
150  type_sp = class_types.GetTypeAtIndex(i);
151  if (type_sp) {
152  if (TypeSystemClang::IsCXXClassType(
153  type_sp->GetForwardCompilerType())) {
154  LLDB_LOGF(
155  log,
156  "0x%16.16" PRIx64 ": static-type = '%s' has multiple "
157  "matching dynamic types, picking "
158  "this one: uid={0x%" PRIx64 "}, type-name='%s'\n",
159  original_ptr, in_value.GetTypeName().AsCString(),
160  type_sp->GetID(), type_sp->GetName().GetCString());
161  type_info.SetTypeSP(type_sp);
162  }
163  }
164  }
165 
166  if (log) {
167  LLDB_LOGF(log,
168  "0x%16.16" PRIx64
169  ": static-type = '%s' has multiple matching dynamic "
170  "types, didn't find a C++ match\n",
171  original_ptr, in_value.GetTypeName().AsCString());
172  }
173  }
174  if (type_info)
175  SetDynamicTypeInfo(vtable_addr, type_info);
176  return type_info;
177  }
178  }
179  }
180  }
181  }
182  return TypeAndOrName();
183 }
184 
185 bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
186  ValueObject &in_value, lldb::DynamicValueType use_dynamic,
187  TypeAndOrName &class_type_or_name, Address &dynamic_address,
188  Value::ValueType &value_type) {
189  // For Itanium, if the type has a vtable pointer in the object, it will be at
190  // offset 0 in the object. That will point to the "address point" within the
191  // vtable (not the beginning of the vtable.) We can then look up the symbol
192  // containing this "address point" and that symbol's name demangled will
193  // contain the full class name. The second pointer above the "address point"
194  // is the "offset_to_top". We'll use that to get the start of the value
195  // object which holds the dynamic type.
196  //
197 
198  class_type_or_name.Clear();
199  value_type = Value::ValueType::Scalar;
200 
201  // Only a pointer or reference type can have a different dynamic and static
202  // type:
203  if (!CouldHaveDynamicValue(in_value))
204  return false;
205 
206  // First job, pull out the address at 0 offset from the object.
207  AddressType address_type;
208  lldb::addr_t original_ptr = in_value.GetPointerValue(&address_type);
209  if (original_ptr == LLDB_INVALID_ADDRESS)
210  return false;
211 
212  ExecutionContext exe_ctx(in_value.GetExecutionContextRef());
213 
214  Process *process = exe_ctx.GetProcessPtr();
215 
216  if (process == nullptr)
217  return false;
218 
219  Status error;
220  const lldb::addr_t vtable_address_point =
221  process->ReadPointerFromMemory(original_ptr, error);
222 
223  if (!error.Success() || vtable_address_point == LLDB_INVALID_ADDRESS)
224  return false;
225 
226  class_type_or_name = GetTypeInfoFromVTableAddress(in_value, original_ptr,
227  vtable_address_point);
228 
229  if (!class_type_or_name)
230  return false;
231 
232  CompilerType type = class_type_or_name.GetCompilerType();
233  // There can only be one type with a given name, so we've just found
234  // duplicate definitions, and this one will do as well as any other. We
235  // don't consider something to have a dynamic type if it is the same as
236  // the static type. So compare against the value we were handed.
237  if (!type)
238  return true;
239 
240  if (TypeSystemClang::AreTypesSame(in_value.GetCompilerType(), type)) {
241  // The dynamic type we found was the same type, so we don't have a
242  // dynamic type here...
243  return false;
244  }
245 
246  // The offset_to_top is two pointers above the vtable pointer.
247  const uint32_t addr_byte_size = process->GetAddressByteSize();
248  const lldb::addr_t offset_to_top_location =
249  vtable_address_point - 2 * addr_byte_size;
250  // Watch for underflow, offset_to_top_location should be less than
251  // vtable_address_point
252  if (offset_to_top_location >= vtable_address_point)
253  return false;
254  const int64_t offset_to_top = process->ReadSignedIntegerFromMemory(
255  offset_to_top_location, addr_byte_size, INT64_MIN, error);
256 
257  if (offset_to_top == INT64_MIN)
258  return false;
259  // So the dynamic type is a value that starts at offset_to_top above
260  // the original address.
261  lldb::addr_t dynamic_addr = original_ptr + offset_to_top;
263  dynamic_addr, dynamic_address)) {
264  dynamic_address.SetRawAddress(dynamic_addr);
265  }
266  return true;
267 }
268 
269 TypeAndOrName ItaniumABILanguageRuntime::FixUpDynamicType(
270  const TypeAndOrName &type_and_or_name, ValueObject &static_value) {
271  CompilerType static_type(static_value.GetCompilerType());
272  Flags static_type_flags(static_type.GetTypeInfo());
273 
274  TypeAndOrName ret(type_and_or_name);
275  if (type_and_or_name.HasType()) {
276  // The type will always be the type of the dynamic object. If our parent's
277  // type was a pointer, then our type should be a pointer to the type of the
278  // dynamic object. If a reference, then the original type should be
279  // okay...
280  CompilerType orig_type = type_and_or_name.GetCompilerType();
281  CompilerType corrected_type = orig_type;
282  if (static_type_flags.AllSet(eTypeIsPointer))
283  corrected_type = orig_type.GetPointerType();
284  else if (static_type_flags.AllSet(eTypeIsReference))
285  corrected_type = orig_type.GetLValueReferenceType();
286  ret.SetCompilerType(corrected_type);
287  } else {
288  // If we are here we need to adjust our dynamic type name to include the
289  // correct & or * symbol
290  std::string corrected_name(type_and_or_name.GetName().GetCString());
291  if (static_type_flags.AllSet(eTypeIsPointer))
292  corrected_name.append(" *");
293  else if (static_type_flags.AllSet(eTypeIsReference))
294  corrected_name.append(" &");
295  // the parent type should be a correctly pointer'ed or referenc'ed type
296  ret.SetCompilerType(static_type);
297  ret.SetName(corrected_name.c_str());
298  }
299  return ret;
300 }
301 
302 // Static Functions
304 ItaniumABILanguageRuntime::CreateInstance(Process *process,
305  lldb::LanguageType language) {
306  // FIXME: We have to check the process and make sure we actually know that
307  // this process supports
308  // the Itanium ABI.
309  if (language == eLanguageTypeC_plus_plus ||
310  language == eLanguageTypeC_plus_plus_03 ||
311  language == eLanguageTypeC_plus_plus_11 ||
312  language == eLanguageTypeC_plus_plus_14)
313  return new ItaniumABILanguageRuntime(process);
314  else
315  return nullptr;
316 }
317 
319 public:
321  : CommandObjectParsed(interpreter, "demangle",
322  "Demangle a C++ mangled name.",
323  "language cplusplus demangle") {
325  CommandArgumentData index_arg;
326 
327  // Define the first (and only) variant of this arg.
328  index_arg.arg_type = eArgTypeSymbol;
329  index_arg.arg_repetition = eArgRepeatPlus;
330 
331  // There is only one variant this argument could be; put it into the
332  // argument entry.
333  arg.push_back(index_arg);
334 
335  // Push the data for the first argument into the m_arguments vector.
336  m_arguments.push_back(arg);
337  }
338 
339  ~CommandObjectMultiwordItaniumABI_Demangle() override = default;
340 
341 protected:
342  bool DoExecute(Args &command, CommandReturnObject &result) override {
343  bool demangled_any = false;
344  bool error_any = false;
345  for (auto &entry : command.entries()) {
346  if (entry.ref().empty())
347  continue;
348 
349  // the actual Mangled class should be strict about this, but on the
350  // command line if you're copying mangled names out of 'nm' on Darwin,
351  // they will come out with an extra underscore - be willing to strip this
352  // on behalf of the user. This is the moral equivalent of the -_/-n
353  // options to c++filt
354  auto name = entry.ref();
355  if (name.startswith("__Z"))
356  name = name.drop_front();
357 
358  Mangled mangled(name);
359  if (mangled.GuessLanguage() == lldb::eLanguageTypeC_plus_plus) {
360  ConstString demangled(mangled.GetDisplayDemangledName());
361  demangled_any = true;
362  result.AppendMessageWithFormat("%s ---> %s\n", entry.c_str(),
363  demangled.GetCString());
364  } else {
365  error_any = true;
366  result.AppendErrorWithFormat("%s is not a valid C++ mangled name\n",
367  entry.ref().str().c_str());
368  }
369  }
370 
371  result.SetStatus(
372  error_any ? lldb::eReturnStatusFailed
373  : (demangled_any ? lldb::eReturnStatusSuccessFinishResult
375  return result.Succeeded();
376  }
377 };
378 
380 public:
383  interpreter, "cplusplus",
384  "Commands for operating on the C++ language runtime.",
385  "cplusplus <subcommand> [<subcommand-options>]") {
386  LoadSubCommand(
387  "demangle",
388  CommandObjectSP(
390  }
391 
392  ~CommandObjectMultiwordItaniumABI() override = default;
393 };
394 
395 void ItaniumABILanguageRuntime::Initialize() {
396  PluginManager::RegisterPlugin(
397  GetPluginNameStatic(), "Itanium ABI for the C++ language", CreateInstance,
398  [](CommandInterpreter &interpreter) -> lldb::CommandObjectSP {
399  return CommandObjectSP(
400  new CommandObjectMultiwordItaniumABI(interpreter));
401  });
402 }
403 
404 void ItaniumABILanguageRuntime::Terminate() {
405  PluginManager::UnregisterPlugin(CreateInstance);
406 }
407 
408 lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginNameStatic() {
409  static ConstString g_name("itanium");
410  return g_name;
411 }
412 
413 // PluginInterface protocol
414 lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginName() {
415  return GetPluginNameStatic();
416 }
417 
418 BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
419  const BreakpointSP &bkpt, bool catch_bp, bool throw_bp) {
420  return CreateExceptionResolver(bkpt, catch_bp, throw_bp, false);
421 }
422 
423 BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
424  const BreakpointSP &bkpt, bool catch_bp, bool throw_bp,
425  bool for_expressions) {
426  // One complication here is that most users DON'T want to stop at
427  // __cxa_allocate_expression, but until we can do anything better with
428  // predicting unwinding the expression parser does. So we have two forms of
429  // the exception breakpoints, one for expressions that leaves out
430  // __cxa_allocate_exception, and one that includes it. The
431  // SetExceptionBreakpoints does the latter, the CreateExceptionBreakpoint in
432  // the runtime the former.
433  static const char *g_catch_name = "__cxa_begin_catch";
434  static const char *g_throw_name1 = "__cxa_throw";
435  static const char *g_throw_name2 = "__cxa_rethrow";
436  static const char *g_exception_throw_name = "__cxa_allocate_exception";
437  std::vector<const char *> exception_names;
438  exception_names.reserve(4);
439  if (catch_bp)
440  exception_names.push_back(g_catch_name);
441 
442  if (throw_bp) {
443  exception_names.push_back(g_throw_name1);
444  exception_names.push_back(g_throw_name2);
445  }
446 
447  if (for_expressions)
448  exception_names.push_back(g_exception_throw_name);
449 
450  BreakpointResolverSP resolver_sp(new BreakpointResolverName(
451  bkpt, exception_names.data(), exception_names.size(),
452  eFunctionNameTypeBase, eLanguageTypeUnknown, 0, eLazyBoolNo));
453 
454  return resolver_sp;
455 }
456 
457 lldb::SearchFilterSP ItaniumABILanguageRuntime::CreateExceptionSearchFilter() {
458  Target &target = m_process->GetTarget();
459 
460  FileSpecList filter_modules;
461  if (target.GetArchitecture().GetTriple().getVendor() == llvm::Triple::Apple) {
462  // Limit the number of modules that are searched for these breakpoints for
463  // Apple binaries.
464  filter_modules.EmplaceBack("libc++abi.dylib");
465  filter_modules.EmplaceBack("libSystem.B.dylib");
466  }
467  return target.GetSearchFilterForModuleList(&filter_modules);
468 }
469 
470 lldb::BreakpointSP ItaniumABILanguageRuntime::CreateExceptionBreakpoint(
471  bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal) {
472  Target &target = m_process->GetTarget();
473  FileSpecList filter_modules;
474  BreakpointResolverSP exception_resolver_sp =
475  CreateExceptionResolver(nullptr, catch_bp, throw_bp, for_expressions);
476  SearchFilterSP filter_sp(CreateExceptionSearchFilter());
477  const bool hardware = false;
478  const bool resolve_indirect_functions = false;
479  return target.CreateBreakpoint(filter_sp, exception_resolver_sp, is_internal,
480  hardware, resolve_indirect_functions);
481 }
482 
483 void ItaniumABILanguageRuntime::SetExceptionBreakpoints() {
484  if (!m_process)
485  return;
486 
487  const bool catch_bp = false;
488  const bool throw_bp = true;
489  const bool is_internal = true;
490  const bool for_expressions = true;
491 
492  // For the exception breakpoints set by the Expression parser, we'll be a
493  // little more aggressive and stop at exception allocation as well.
494 
495  if (m_cxx_exception_bp_sp) {
496  m_cxx_exception_bp_sp->SetEnabled(true);
497  } else {
498  m_cxx_exception_bp_sp = CreateExceptionBreakpoint(
499  catch_bp, throw_bp, for_expressions, is_internal);
500  if (m_cxx_exception_bp_sp)
501  m_cxx_exception_bp_sp->SetBreakpointKind("c++ exception");
502  }
503 }
504 
505 void ItaniumABILanguageRuntime::ClearExceptionBreakpoints() {
506  if (!m_process)
507  return;
508 
509  if (m_cxx_exception_bp_sp) {
510  m_cxx_exception_bp_sp->SetEnabled(false);
511  }
512 }
513 
514 bool ItaniumABILanguageRuntime::ExceptionBreakpointsAreSet() {
515  return m_cxx_exception_bp_sp && m_cxx_exception_bp_sp->IsEnabled();
516 }
517 
518 bool ItaniumABILanguageRuntime::ExceptionBreakpointsExplainStop(
519  lldb::StopInfoSP stop_reason) {
520  if (!m_process)
521  return false;
522 
523  if (!stop_reason || stop_reason->GetStopReason() != eStopReasonBreakpoint)
524  return false;
525 
526  uint64_t break_site_id = stop_reason->GetValue();
527  return m_process->GetBreakpointSiteList().BreakpointSiteContainsBreakpoint(
528  break_site_id, m_cxx_exception_bp_sp->GetID());
529 }
530 
531 ValueObjectSP ItaniumABILanguageRuntime::GetExceptionObjectForThread(
532  ThreadSP thread_sp) {
533  if (!thread_sp->SafeToCallFunctions())
534  return {};
535 
536  TypeSystemClang *clang_ast_context =
537  ScratchTypeSystemClang::GetForTarget(m_process->GetTarget());
538  if (!clang_ast_context)
539  return {};
540 
541  CompilerType voidstar =
542  clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
543 
544  DiagnosticManager diagnostics;
545  ExecutionContext exe_ctx;
547 
548  options.SetUnwindOnError(true);
549  options.SetIgnoreBreakpoints(true);
550  options.SetStopOthers(true);
551  options.SetTimeout(m_process->GetUtilityExpressionTimeout());
552  options.SetTryAllThreads(false);
553  thread_sp->CalculateExecutionContext(exe_ctx);
554 
555  const ModuleList &modules = m_process->GetTarget().GetImages();
556  SymbolContextList contexts;
557  SymbolContext context;
558 
560  ConstString("__cxa_current_exception_type"), eSymbolTypeCode, contexts);
561  contexts.GetContextAtIndex(0, context);
562  if (!context.symbol) {
563  return {};
564  }
565  Address addr = context.symbol->GetAddress();
566 
567  Status error;
568  FunctionCaller *function_caller =
569  m_process->GetTarget().GetFunctionCallerForLanguage(
570  eLanguageTypeC, voidstar, addr, ValueList(), "caller", error);
571 
572  ExpressionResults func_call_ret;
573  Value results;
574  func_call_ret = function_caller->ExecuteFunction(exe_ctx, nullptr, options,
575  diagnostics, results);
576  if (func_call_ret != eExpressionCompleted || !error.Success()) {
577  return ValueObjectSP();
578  }
579 
580  size_t ptr_size = m_process->GetAddressByteSize();
581  addr_t result_ptr = results.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
582  addr_t exception_addr =
583  m_process->ReadPointerFromMemory(result_ptr - ptr_size, error);
584 
585  if (!error.Success()) {
586  return ValueObjectSP();
587  }
588 
589  lldb_private::formatters::InferiorSizedWord exception_isw(exception_addr,
590  *m_process);
591  ValueObjectSP exception = ValueObject::CreateValueObjectFromData(
592  "exception", exception_isw.GetAsData(m_process->GetByteOrder()), exe_ctx,
593  voidstar);
594  exception = exception->GetDynamicValue(eDynamicDontRunTarget);
595 
596  return exception;
597 }
598 
599 TypeAndOrName ItaniumABILanguageRuntime::GetDynamicTypeInfo(
600  const lldb_private::Address &vtable_addr) {
601  std::lock_guard<std::mutex> locker(m_dynamic_type_map_mutex);
602  DynamicTypeCache::const_iterator pos = m_dynamic_type_map.find(vtable_addr);
603  if (pos == m_dynamic_type_map.end())
604  return TypeAndOrName();
605  else
606  return pos->second;
607 }
608 
609 void ItaniumABILanguageRuntime::SetDynamicTypeInfo(
610  const lldb_private::Address &vtable_addr, const TypeAndOrName &type_info) {
611  std::lock_guard<std::mutex> locker(m_dynamic_type_map_mutex);
612  m_dynamic_type_map[vtable_addr] = type_info;
613 }
lldb_private::CommandObjectParsed
Definition: CommandObject.h:378
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
Scalar.h
Mangled.h
lldb_private::TypeAndOrName::GetCompilerType
CompilerType GetCompilerType() const
Definition: Type.h:408
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:616
FunctionCaller.h
lldb_private::EvaluateExpressionOptions::SetTimeout
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:330
lldb_private::TypeAndOrName::SetName
void SetName(ConstString type_name)
Definition: Type.cpp:770
lldb_private::Value
Definition: Value.h:38
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:208
lldb::ExpressionResults
ExpressionResults
The results of expression evaluation.
Definition: lldb-enumerations.h:270
lldb_private::TypeAndOrName::SetCompilerType
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:786
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
lldb_private::Process
Definition: Process.h:342
Module.h
BreakpointLocation.h
lldb_private::CommandObject::CommandArgumentData
Definition: CommandObject.h:89
lldb_private::Process::GetTarget
Target & GetTarget()
Get the target object pointer for this module.
Definition: Process.h:1214
lldb_private::EvaluateExpressionOptions
Definition: Target.h:262
lldb_private::ValueObject::GetPointerValue
lldb::addr_t GetPointerValue(AddressType *address_type=nullptr)
Definition: ValueObject.cpp:1433
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Flags
Definition: Flags.h:22
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1265
SectionLoadList.h
lldb_private::Process::ReadSignedIntegerFromMemory
int64_t ReadSignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, int64_t fail_value, Status &error)
Definition: Process.cpp:2111
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb_private::ValueList
Definition: Value.h:157
lldb_private::CommandObject::CommandArgumentData::arg_repetition
ArgumentRepetitionType arg_repetition
Definition: CommandObject.h:92
ValueObjectMemory.h
lldb_private::Args
Definition: Args.h:33
lldb_private::Target::CreateBreakpoint
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:331
CommandObjectMultiwordItaniumABI
Definition: ItaniumABILanguageRuntime.cpp:379
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:444
lldb_private::TypeList::GetTypeAtIndex
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::TypeAndOrName::Clear
void Clear()
Definition: Type.cpp:796
lldb_private::eArgRepeatPlus
@ eArgRepeatPlus
Definition: lldb-private-enumerations.h:97
CommandReturnObject.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:454
lldb_private::formatters::InferiorSizedWord
Definition: FormattersHelpers.h:65
LLDB_PLUGIN_DEFINE_ADV
LLDB_PLUGIN_DEFINE_ADV(ObjectContainerUniversalMachO, ObjectContainerMachOArchive) void ObjectContainerUniversalMachO
Definition: ObjectContainerUniversalMachO.cpp:23
lldb_private::ValueObject::GetTypeName
virtual ConstString GetTypeName()
Definition: ValueObject.h:365
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:928
lldb::eLanguageTypeC_plus_plus_11
@ eLanguageTypeC_plus_plus_11
ISO C++:2011.
Definition: lldb-enumerations.h:465
Process.h
lldb::eReturnStatusSuccessFinishNoResult
@ eReturnStatusSuccessFinishNoResult
Definition: lldb-enumerations.h:260
lldb_private::ModuleList::FindSymbolsWithNameAndType
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:462
Target.h
lldb_private::Value::GetScalar
const Scalar & GetScalar() const
Definition: Value.h:112
lldb_private::CommandObjectMultiword
Definition: CommandObjectMultiword.h:19
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
lldb::eDynamicDontRunTarget
@ eDynamicDontRunTarget
Definition: lldb-enumerations.h:497
lldb::eLanguageTypeC_plus_plus_03
@ eLanguageTypeC_plus_plus_03
ISO C++:2003.
Definition: lldb-enumerations.h:464
ID
static char ID
Definition: IRDynamicChecks.cpp:32
lldb_private::TypeAndOrName::GetName
ConstString GetName() const
Definition: Type.cpp:762
lldb_private::ModuleList
Definition: ModuleList.h:72
lldb_private::TypeList::Empty
bool Empty() const
Definition: TypeList.h:37
lldb_private::Scalar::ULongLong
unsigned long long ULongLong(unsigned long long fail_value=0) const
Definition: Scalar.cpp:334
Log.h
TypeSystemClang.h
lldb_private::ItaniumABILanguageRuntime
Definition: ItaniumABILanguageRuntime.h:26
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:121
lldb::eExpressionCompleted
@ eExpressionCompleted
Definition: lldb-enumerations.h:271
lldb_private::TypeList::GetSize
uint32_t GetSize() const
Definition: TypeList.cpp:60
lldb_private::Process::GetAddressByteSize
uint32_t GetAddressByteSize() const
Definition: Process.cpp:3340
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Args::entries
llvm::ArrayRef< ArgEntry > entries() const
Definition: Args.h:130
lldb_private::EvaluateExpressionOptions::SetTryAllThreads
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:342
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
lldb_private::Value::ValueType
ValueType
Type that describes Value::m_value.
Definition: Value.h:41
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::Flags::AllSet
bool AllSet(ValueType mask) const
Test if all bits in mask are 1 in the current flags.
Definition: Flags.h:83
lldb::eBasicTypeVoid
@ eBasicTypeVoid
Definition: lldb-enumerations.h:743
CommandObjectMultiword.h
lldb::eReturnStatusFailed
@ eReturnStatusFailed
Definition: lldb-enumerations.h:265
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb::eArgTypeSymbol
@ eArgTypeSymbol
Definition: lldb-enumerations.h:585
lldb_private::ValueObject::GetExecutionContextRef
const ExecutionContextRef & GetExecutionContextRef() const
Definition: ValueObject.h:330
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
lldb_private::CommandObject::CommandArgumentData::arg_type
lldb::CommandArgumentType arg_type
Definition: CommandObject.h:91
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
lldb_private::EvaluateExpressionOptions::SetUnwindOnError
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:309
Thread.h
lldb_private::ModuleList::ResolveSymbolContextForAddress
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address
Definition: ModuleList.cpp:641
lldb_private::Symbol::GetMangled
Mangled & GetMangled()
Definition: Symbol.h:121
lldb_private::SectionLoadList::ResolveLoadAddress
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
Definition: SectionLoadList.cpp:208
lldb_private::CompilerType::GetLValueReferenceType
CompilerType GetLValueReferenceType() const
Return a new CompilerType that is a L value reference to this type if this type is valid and the type...
Definition: CompilerType.cpp:414
ValueObject.h
lldb_private::Address::SetRawAddress
void SetRawAddress(lldb::addr_t addr)
Definition: Address.h:435
TypeList.h
lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:313
Symbol.h
lldb_private::formatters::InferiorSizedWord::GetAsData
DataExtractor GetAsData(lldb::ByteOrder byte_order=lldb::eByteOrderInvalid) const
Definition: FormattersHelpers.h:167
lldb_private::SectionLoadList::IsEmpty
bool IsEmpty() const
Definition: SectionLoadList.cpp:37
CommandObjectMultiwordItaniumABI_Demangle::CommandObjectMultiwordItaniumABI_Demangle
CommandObjectMultiwordItaniumABI_Demangle(CommandInterpreter &interpreter)
Definition: ItaniumABILanguageRuntime.cpp:320
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:970
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
LIBLLDB_LOG_OBJECT
#define LIBLLDB_LOG_OBJECT
Definition: Logging.h:25
lldb_private::CompilerType::GetPointerType
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
Definition: CompilerType.cpp:407
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:437
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
uint32_t
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
CommandObject.h
lldb::eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishResult
Definition: lldb-enumerations.h:261
lldb_private::Address
Definition: Address.h:59
lldb_private::TypeAndOrName::SetTypeSP
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:778
lldb_private::CommandReturnObject::AppendMessageWithFormat
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:64
lldb_private::CompilerType::GetTypeInfo
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
Definition: CompilerType.cpp:290
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
lldb_private::Target::GetSearchFilterForModuleList
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition: Target.cpp:526
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::ValueObject::GetCompilerType
CompilerType GetCompilerType()
Definition: ValueObject.h:352
lldb::eLanguageTypeC_plus_plus_14
@ eLanguageTypeC_plus_plus_14
ISO C++:2014.
Definition: lldb-enumerations.h:472
StopInfo.h
lldb_private::SymbolContext::module_sp
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SymbolContext.h:318
lldb::eStopReasonBreakpoint
@ eStopReasonBreakpoint
Definition: lldb-enumerations.h:243
lldb_private::CommandReturnObject::Succeeded
bool Succeeded()
Definition: CommandReturnObject.cpp:125
lldb_private::BreakpointResolverName
Definition: BreakpointResolverName.h:24
PluginManager.h
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1043
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
CommandObjectMultiwordItaniumABI_Demangle::DoExecute
bool DoExecute(Args &command, CommandReturnObject &result) override
Definition: ItaniumABILanguageRuntime.cpp:342
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
DiagnosticManager.h
lldb_private::CommandReturnObject::AppendErrorWithFormat
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:46
Status.h
lldb::eLanguageTypeC
@ eLanguageTypeC
Non-standardized C, such as K&R.
Definition: lldb-enumerations.h:439
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeAndOrName::HasType
bool HasType() const
Definition: Type.h:424
lldb_private::FunctionCaller::ExecuteFunction
lldb::ExpressionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager, Value &results)
Run the function this FunctionCaller was created with.
Definition: FunctionCaller.cpp:313
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::TypeSystemClang::GetBasicType
CompilerType GetBasicType(lldb::BasicType type)
Definition: TypeSystemClang.cpp:938
lldb_private::TypeSystemClang
A TypeSystem implementation based on Clang.
Definition: TypeSystemClang.h:106
ConstString.h
lldb_private::Log
Definition: Log.h:49
lldb_private::ModuleList::FindTypes
void FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet< SymbolFile * > &searched_symbol_files, TypeList &types) const
Find types by name.
Definition: ModuleList.cpp:526
lldb_private::Process::ReadPointerFromMemory
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition: Process.cpp:2122
lldb_private::EvaluateExpressionOptions::SetStopOthers
void SetStopOthers(bool stop_others=true)
Definition: Target.h:346
lldb_private::TypeAndOrName
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:394
ItaniumABILanguageRuntime.h
lldb_private::CommandObject::CommandArgumentEntry
std::vector< CommandArgumentData > CommandArgumentEntry
Definition: CommandObject.h:105
FormattersHelpers.h
CommandObjectMultiwordItaniumABI::CommandObjectMultiwordItaniumABI
CommandObjectMultiwordItaniumABI(CommandInterpreter &interpreter)
Definition: ItaniumABILanguageRuntime.cpp:381
vtable_demangled_prefix
static const char * vtable_demangled_prefix
Definition: ItaniumABILanguageRuntime.cpp:45
lldb
Definition: SBAddress.h:15
RegisterContext.h
SymbolFile.h
CommandObjectMultiwordItaniumABI_Demangle
Definition: ItaniumABILanguageRuntime.cpp:318
lldb_private::FunctionCaller
Definition: FunctionCaller.h:56
lldb::eLanguageTypeC_plus_plus
@ eLanguageTypeC_plus_plus
ISO C++:1998.
Definition: lldb-enumerations.h:441
lldb_private::Symbol::GetAddress
Address GetAddress() const
Definition: Symbol.h:73